Open
Description
//经过测试应该适用大多数Unity游戏
ULONG64 GetGOM()
{
ULONG64 addr = _UnityPlayer;
ULONG64 end = _UnityPlayer + _UnityPlayer_ModuleSize;
ULONG64 offset = 0;
bool found = false;
unsigned char tmp[0x1000];
ULONG64 code_addr = 0;
while (!found && end - offset > 0x1000)
{
mread_buffer((void*)tmp, addr + offset, 0x1000);
auto p = FindPattern(tmp, "E8 ? ? ? ? 83 FF 03", 0x1000);
if (p)
{
code_addr = ((ULONG64)p - (ULONG64)tmp) + offset;
break;
}
offset += 0x1000;
}
printf("CODE_ADDR=[ 0x%x ]\n", code_addr);
ULONG64 code_addr1 = mread<int>(_UnityPlayer + code_addr + 1) + (_UnityPlayer + code_addr + 5);
printf("code_addr1=[ 0x%x ]\n", code_addr1);
mread_buffer((void*)tmp, code_addr1, 0x100);
for (int i = 0; i < 240; i++)
{
if (tmp[i] == 0x48 && tmp[i + 1] == 0x8B && tmp[i + 2] == 0x05)
{
int gom_offset = *(int*)&tmp[i + 3];
ULONG64 gom = (code_addr1 + i + 7) + gom_offset;
return gom;
}
}
return NULL;
}
Metadata
Metadata
Assignees
Labels
No labels