萌新上路,代码写的很恶心,可读性差,大佬勿喷
#include "stdafx.h"char x[]=
{
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x07,0x09,
0x00,0x20,0x10,0x03,0x03,0x0C,0x00,0x00,0x44,0x00,
0x00,0x33,0x00,0x47,0x0C,0x0E,0x00,0x0D,0x00,0x11,
0x00,0x00,0x00,0x02,0x64,0x00,0x00,0x00,0xAA,0x00,
0x00,0x00,0x64,0x10,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x02,0x00,0x74,0x0F,0x41,0x00,0x00,0x00,
0x01,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x0A,0x00,
0x00,0x02,0x57,0x4F,0x57,0x00,0x06,0x08,0x00,0x00,
0x00,0x00,0x00,0x64,0x00,0x0F,0x00,0x00,0x0D,0x00,
0x00,0x00,0x23,0x00,0x00,0x64,0x00,0x00,0x64,0x00
};
char y[]={"WOW"};
int l=0;
char* FindRoleNameAddr(char* x,char* y)
{
int n;
char* e;
char* a=&y[0];
char* b=&x[0];
for(int i=0;i<100;i++)
{
n=0;
y=a;
x=b++;
e=x;
while(*y!=0)
{
if(*y==*x)
{
n++;
x++;
y++;
}else
{
break;
}
}
if(n==3)
{
l++;
return e;
}
}
return 0;
}
int main()
{
int* t=(int*)FindRoleNameAddr(x,y);
printf("%x\n",t);
char* f=FindRoleNameAddr(x,y);
while(*f!=0)
{
printf("%c",*f);
f++;
}
printf("\n%d",l);
return 0;
}