View Single Post
  #11  
Old 01-21-2015, 15:59
DMichael's Avatar
DMichael DMichael is offline
Family
 
Join Date: Apr 2012
Location: Israel
Posts: 197
Rept. Given: 138
Rept. Rcvd 281 Times in 72 Posts
Thanks Given: 13
Thanks Rcvd at 32 Times in 26 Posts
DMichael Reputation: 200-299 DMichael Reputation: 200-299 DMichael Reputation: 200-299
hmm probably no one need it anyway i'm have modified the algorithm by patrick and dom1n1k in my old project for x64 compatibility here it is:

Quote:
bool Match(const BYTE* pData, const BYTE* bMask, const char* szMask)
{
for(; *szMask; ++szMask,++pData,++bMask)
{
if(*szMask=='x' && *pData!=*bMask )
return false;
}

if(*szMask == 0x00)
return true;

return false;
}

DWORD_PTR FindPattern(DWORD_PTR dwAddress,size_t dwLen,const BYTE *bMask,const char * szMask)
{
for(size_t i=0; i < dwLen; i++)
{
if( Match ( (BYTE*) (dwAddress+i) ,bMask,szMask ) == true )
return (DWORD_PTR)(dwAddress+i);
}

return NULL;
}
Reply With Quote