char data[255]={0},user[15],password[32];
if((fp=fopen("QQ.ini","wb+"))==NULL)
{
printf("ÎÞ·¨´´½¨QQ.iniÎļþ\n");
system("pause");
exit(0);
}
else
{
printf("³õʼ»¯Êý¾ÝÉÐδ´´½¨\nÇëÊäÈëQQÕ˺Å:");
gets(user);
printf("ÇëÊäÈëQQÃÜÂë:");
gets(password);
sprintf(data,"user:%spassword:%s",user,password);
fwrite(data,strlen(data),1,fp);
memset(data,0,255);
fseek(fp,0L,0);
fread(data,strlen(data),1,fp);
printf("Êä³ö:%s\n",data);
fclose(fp);
printf("´´½¨³õʼ»¯Îļþ³É¹¦\n");
}
ΪʲôÊä³ö½á¹ûΪ¿Õ£¿£¿´´½¨µÄQQ.iniÎļþÕý³££¬ÎÊÌâ¾ÍÊÇÎÞ·¨´ÓÕâ¸öÎļþ¶Á³öÊý¾Ý
ÎÒÒ»ÏòÓÃ"w+b"
strlen(data)ºÃÏñÊÇ0
ÎÊÌâÖØÐÂÃèÊöÏ£º
ÎÒÓиöQQ.ini£¬ÀïÃæÄÚÈÝÊÇ:user:35555password:444
ÕâÊÇÎÒfwrite(data,strlen(data),1,fp);Ò»´ÎдÈëµÄ£¬´ò¿ª·½Ê½wb closeÎļþ
È»ºóÎÒµÚ¶þ´ÎÔËÐгÌÐò£¬Ïë¶ÁÈ¡Õâ¸öÎı¾Êý¾Ý
rb·½Ê½´ò¿ª£¬È·±£ÎļþÖ¸Õë²»¿Õºó£¬fseek(fp,0L,2);fread(data,ftell(fp),1,fp)£»
ÔÙÒ»´ÎÐÔ¶Á³ö
ΪʲôµÃµ½µÄ½á¹ûÊÇ¿Õ×Ö´®£¿£¿£¿£¿£¿
memset(data,0,255);
Ö®ºóstrlen(data)=0
¶Á0³¤¶È,µ±È»ÊÇ¿Õ
µÚ¶þÖÖ:
fseek(fp,0L,2);
long l = ftell(fp);
fseek(fp,0L,0);
fread(data,l,1,fp);
ÎļþÖ¸ÕëÒƵ½ÎļþÍ·
C/C++ code
¶¼ËµÍøÉÏÓкö࣬µ«ÎÒһֱûÕÒµ½¡£Èç¹ûÄúÖªµÀ£¬Çë¸æËßÎÒÏêϸµÄÏÂÔصØÖ·¡£Òª´óÐÍÏîÄ¿»òÊǼܹ¹±È½ÏºÃµÄ¡£
ÄúÒ²²»Ìá51aspxÁË¡£ÉÏÃæµÄ¶«Î÷ÊDz»´í£¬µ«ÎÒÏëÒª¼Ü¹¹±È½ÏºÃµÄ¡£¡£
ÎÒÏë¿´¿´ËûÃÇÊÇÔõô×öÏîÄ¿ÕûºÏ ......
1001.exe ÖÐµÄ 0x0041394f ´¦Î´´¦ÀíµÄÒì³£: 0xC0000005: дÈëλÖà 0x66792e62 ʱ·¢Éú·ÃÎʳåÍ»
ÕâÊÇÔõô»ØÊ£¿Ð»Ð»ÁË£¬ÎÒÊDzËÄñ
ËÖªµÀÔõô»ØÊ¡¡ÕâÊǸöͨÓõĴíÎóÌáʾ¡¡ÉÏ´úÂë
ÐèÒªÖØнøÐбàÒë
Ò ......