Monthly Archives: 十二月 2011

114 vnet

Leave a comment

moss

Leave a comment

在某某软件发现sqlserver服务器帐号

在某某软件发现sqlserver服务器帐号。你说丫的不注意安全,他还是知道把1433改为2433。 我还记得在读大学的时候,学校的机房有个虚拟磁盘软件,可以通过学号登录,每个学生有10MB的容量,用PB写的。同样用winhex、peid之类的软件哥获取了本校所有学生的帐号 xD。 某些人的做法是在client中or配置文件写加密密码,密码算法自己实现。但这个方法也不是绝对的安全。因为牛逼的hacker同样可以反编译出来。也不能用不可逆的算法(md5,sha1)。因为最后不管怎么玩,最后连接的配置信息还是明文的。 其实类似c/s的程序最好的解决方法三层结构。中间的逻辑层负责客户端的数据请求,而无需出示帐号。因为密码保存在中间件中。

Leave a comment

wm手机不支持j2me mmapi调用摄像头

I wanted to let my j2me project have the ability to take picutre using MMAPI(JSR135) So I check my HTC Diamond with the following code import javax.microedition.lcdui.Command; import javax.microedition.lcdui.CommandListener; import javax.microedition.lcdui.Display; import javax.microedition.lcdui.Displayable; import javax.microedition.lcdui.Form; import javax.microedition.midlet.MIDlet; public class jsrtest … Continue reading

Leave a comment

C字符串转数组,类似于php的explode()

/************************************************************************/ /* 字符串转数组,类似于php的explode(),通过参数指定分隔符号,写得很烂,将就用着*/ /* http://tunps.com */ /************************************************************************/ #include <stdio.h> #include <windows.h> #define N 10 #define M 10 void explode(char *delimiter,int delimiterSize,char *strIn,int strInSize,char** strOut) { int i,j,k=0,m=0,n=0; int isDelimiter[1000]={0}; for(i=0;i<strInSize;i++) { for(j=0;j<delimiterSize;j++) { if(strIn[i] == delimiter[j]) { isDelimiter[i] = 1; … Continue reading

Tagged | Leave a comment

传递多个参数给_beginthread

/*******Test Return Value of Struct *******/ #include <stdio.h> #include <process.h> typedef struct ST{ int num; char* buf; }thestruct; void Addem(thestruct* ); int main() { thestruct st; st.num = 6000; _beginthread((void(*)(void*))Addem,0,(void*)&st); getchar(); // freeze program so you can see output } … Continue reading

Tagged , | Leave a comment

libcurl sample program

#define CURL_STATICLIB #define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_DEPRECATE #pragma comment(lib,"ws2_32.lib") #pragma comment(lib,"D:\\win32dev\\curl-7.19.0\\lib\\Debug\\curllib.lib") /* Start of test program */ #include <stdio.h> #include <stdlib.h> #include <curl/curl.h> #include <curl/types.h> #include <curl/easy.h> size_t write_data(void *ptr, size_t size, size_t nmemb, FILE *stream) { static int first_time=1; char … Continue reading

Tagged | Leave a comment