FindPattern("0x400000",<<<< wrong...
FindPattern(0x400000, <<<< correct..
0x400000 is the base address of warband , your trying to find the string not the address no "...".
yeah I know it already.the thing is I have to convert datatypes
cannot convert parameter 1 from 'int' to 'char *'
I am looking for solution.
ok this will work
DWORD FindPattern(char *module, char *pattern, char *mask)
{
MODULEINFO mInfo = GetModuleInfo(module);
DWORD base = 0x400000;
DWORD size = (DWORD)mInfo.SizeOfImage;
DWORD patternLength = (DWORD)strlen(mask);
for(DWORD i = 0; i < size - patternLength; i++)
{
bool found = true;
for(DWORD j = 0; j < patternLength; j++)
{
found &= mask[j] == '?' || pattern[j] == *(char*)(base + i + j);
}
if(found)
{
return base + i;
}
}
return NULL;
}
FindPattern("".....
it can easily be modified more , i will let you do that yourself , its very simple to do but ^ that will work for warband.