Hi! Looking at old code, I sometimes see that people found offsets using strange pattern-matching constructs like these:
Code:
// Glow offset
DWORD gpStart = mem.FindPatternArr(modClient.dwBase, modClient.dwSize, "xx????x????xxx????xx????xx", 27, 0x8D, 0x8F, 0, 0, 0, 0, 0xA1, 0, 0, 0, 0, 0xC7, 0x4, 0x2, 0, 0, 0, 0, 0x89, 0x35, 0x0, 0x0, 0x0, 0x0, 0x8B, 0x51);
offGlow = mem.Read<DWORD>(gpStart + 7) - modClient.dwBase;
// Entity list
DWORD elStart = mem.FindPatternArr(modClient.dwBase, modClient.dwSize, "x????xx?xxx", 11, 0x5, 0x0, 0x0, 0x0, 0x0, 0xC1, 0xE9, 0x0, 0x39, 0x48, 0x4);
DWORD elP1 = mem.Read<DWORD>(elStart + 1);
BYTE elP2 = mem.Read<BYTE>(elStart + 7);
offEntityList = (elP1 + elP2) - modClient.dwBase;
// Local player
DWORD lpStart = mem.FindPatternArr(modClient.dwBase, modClient.dwSize, "xxx????xx????xxxxx?", 19, 0x8D, 0x34, 0x85, 0x0, 0x0, 0x0, 0x0, 0x89, 0x15, 0x0, 0x0, 0x0, 0x0, 0x8B, 0x41, 0x8, 0x8B, 0x48, 0x0);
DWORD lpP1 = mem.Read<DWORD>(lpStart + 3);
BYTE lpP2 = mem.Read<BYTE>(lpStart + 18);
offLocalPlayer = (lpP1 + lpP2) - modClient.dwBase;
However, I find that this code doesn't find correct offsets for me. Is this no longer a viable method of getting offsets, or am I doing something wrong? If this technique doesn't work anymore, have the patterns just changed, or is it necessary to hard-code in new offsets after each patch?
Thanks in advance.