-
-
[旧帖]
求如下代码的密码)____在线等
0.00雪花
-
发表于:
2011-1-6 13:06
3151
-
[旧帖] 求如下代码的密码)____在线等
0.00雪花
#include <stdio.h>
#include <string.h>
#define PASSFILE "/levels/level16.pass"
int _strcmp(char * a, char * b){
int val = 0;
int tmp = 0;
while(*a||*b)
{
if(*a!=*b)
{
if(!val)
{
val=*a-*b;
}
}
else
{
if(!val)
{
tmp=*a-*b;
}
}
a++;
b++;
}
return (val);
}
int main(int argc, char ** argv){
FILE * fd;
int i=0;
char c;
char realpass[20];
fd = fopen(PASSFILE, "r");
fgets(realpass, sizeof(realpass)-1, fd);
*(strchr(realpass, '\n'))= '\0' ;
fclose(fd);
if(!_strcmp(realpass, argv[1]))
((void (*)()) argv[2])();
}
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!