From anonymous, 5 Months ago, written in Plain Text.
Embed
  1. bool Compare(const BYTE *pData, const BYTE *bMask, const char *szMask)
  2.     {
  3.         for (; *szMask; ++szMask, ++pData, ++bMask)
  4.             if (*szMask == 'x' && *    pData != *bMask) return 0;
  5.         return (*szMask) == NULL;
  6.     }
  7.  
  8.     DWORD SearchAddress(DWORD dwAddress, DWORD dwLen, BYTE *bMask, char *szMask)
  9.     {
  10.         for (int i = 0; i < (int)dwLen; i++)
  11.             if (Compare((BYTE*)(dwAddress + (int)i), bMask, szMask))  return (int)(dwAddress + i);
  12.         return 0;
  13.     }