Would this works ?
I hope anyone know C# enought to decide, if this would work or not:
Code:
static unsafe bool bCompare(byte* pData, byte bMask, char szMask)
{
for (; szMask != 0; ++szMask, ++pData, ++bMask)
if ((szMask != '?') && (szMask == 'x' && *pData != bMask))
return false;
return true;
}
static unsafe IntPtr FindPattern(IntPtr dwAddress, IntPtr dwLen, byte[] bMask, char[] szMask)
{
bool Return = false;
for (int i = 0; i < (int)dwLen; i++)
{
for (int j = 0; j < bMask.Length; j++)
{
Return = Return && bCompare((byte*)(dwAddress + i), bMask[j], szMask[j]);
}
if (Return)
return (IntPtr)(dwAddress + i);
}
return (IntPtr)0;
}



and hey, it works