楼主的keygen并非按照原样还原的-_-!
#include <stdio.h>
#include <string.h>
int main(void)
{
signed long int g_const=0x0c0def;
char name[20];
signed long int X_name;
signed long int Y_name;
signed long int count=0;
signed long int result;
signed int i=0;
printf("Please input your Name:");
gets(name);
while(strlen(name)==0)
{
printf("Please input your Name:");
gets(name);
}
for(i=0;i<(signed int)(strlen(name));i++)
{
X_name=(signed long int)name[i];
Y_name=(signed long int)name[i];
X_name*=16;
Y_name/=32;
X_name^=Y_name;
X_name+=0x26;
X_name^=count;
count+=X_name;
}
result=g_const-count;
result*=result;
printf("CM2-%lx-%lx\n",count,result);
}
for循环简化后:
for(i=0;i<strlen(name);i++)
g_count+=(long)(((long)(name[i]*16)^(long)(name[i]/32))+0x26)^g_count;
g_const-=g_count;
g_const*=g_const;
搂主用的是+连接name[i]*16,name[i]/32