Skip to content

Commit d2e3cf9

Browse files
authored
fix(gta-core-five): queriable interface incorrect offset in new gamebuilds
1 parent 5a187b3 commit d2e3cf9

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

code/components/gta-core-five/src/CrashFixes.TaskNMShotFailureExploit.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,24 @@ static HookFunction hookFunction([]
1414
:
1515
hook::get_pattern("48 8B 88 ? ? ? ? 48 85 C9 74 ? 8B 41 ? D1 E8 83 E0 ? EB ? 41 8B C6 EB ? 8B 51 ? D1 EA 83 E2 ? 3B C2 73 ? 83 F8 ? 73 ? 81 79 ? ? ? ? ? 8B C2 74 ? 48 8B 49 ? 48 85 C9 75 ? 49 8B CE 48 85 C9 74 ? F3 0F 10 05 ? ? ? ? 44 88 74 24 ? C7 44 24 ? ? ? ? ? 44 88 74 24 ? 44 89 74 24 ? 83 C8 ? F3 0F 11 44 24 ? 89 44 24 ? 44 89 74 24 ? 4C 89 74 24 ? 89 44 24 ? 48 8D 15 ? ? ? ? 45 33 C9 45 33 C0 48 8B CB 44 88 74 24 ? E8 ? ? ? ? 8B 86 ? ? ? ? 48 8D 15");
1616

17+
auto queriableInterfaceOffset = *(uint32_t*)(location + 0x3);
18+
1719
static struct : jitasm::Frontend
1820
{
21+
uint32_t queriableInterfOffset;
1922
intptr_t ret;
2023

21-
void Init(intptr_t location)
24+
void Init(intptr_t location, uint32_t queriableInterfaceOffset)
2225
{
2326
this->ret = location;
27+
this->queriableInterfOffset = queriableInterfaceOffset;
2428
}
2529

2630
void InternalMain() override
2731
{
2832
test(rax, rax);
2933
jz("fail");
30-
mov(rcx, qword_ptr[rax+0xB08]); // PedIntelligence->m_queriableInterface
34+
mov(rcx, qword_ptr[rax+queriableInterfOffset]); // PedIntelligence->m_queriableInterface
3135

3236
mov(rax, ret);
3337
jmp(rax);
@@ -40,7 +44,7 @@ static HookFunction hookFunction([]
4044
}
4145
} stub;
4246

43-
stub.Init((intptr_t)location + 0x7);
47+
stub.Init((intptr_t)location + 0x7, queriableInterfaceOffset);
4448
hook::nop(location, 0x7);
4549
hook::jump_rcx(location, stub.GetCode());
4650
});

0 commit comments

Comments
 (0)