Anyone here can tell me what this function do?
PHP Code:
DWORD SearchPattern(char* pattern,DWORD start_offset ,DWORD ende)
{
DWORD offset=start_offset;
DWORD start=offset;
DWORD backoffset=0;
DWORD size =strlen(pattern)-1;
DWORD foundoffset=0;
char * pEnd=pattern;
while(1)
{
char &myposition=*(char*)offset;
if ((pEnd[1]!='x'))
{
char temp=(char)strtoul(pEnd, &pEnd, 0x10);
if (temp==myposition)
{
if (foundoffset==0)
{
foundoffset=offset;
}
}
else
{
pEnd=pattern;
if (foundoffset != 0)
offset=foundoffset;
foundoffset=0;
}
}
else
{
pEnd=&pEnd[2];
}
offset++;
if (((DWORD)pEnd-(DWORD)pattern>=size)||(offset>=ende))
break;
}
return foundoffset;
}
PHP Code:
SearchPattern("55 8B EC 83 EC 18 83 3D x x x x 00 74 07 33 C0 E9 x x x x 8A 45 08",0x00400000,0x007FFFFF);
PHP Code:
char &myposition=*(char*)offset;






