Skip to content

Commit

Permalink
Fix free oob crash reading - reading invalid memory
Browse files Browse the repository at this point in the history
  • Loading branch information
lipsanen committed Sep 19, 2024
1 parent 41d53fc commit 6290e78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spt/features/game_fixes/free_oob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ void FreeOobFeature::LoadFeature()

// we assume TryPlayerMove is 2 entries below CheckJumpButton in the vftable.
uintptr_t cjbPtr = (uintptr_t)spt_autojump.ptrCheckJumpButton;
for (uintptr_t vftEntry = (uintptr_t)serverBase; vftEntry <= (uintptr_t)serverBase + serverSize; vftEntry++)
uintptr_t end = (uintptr_t)serverBase + serverSize - 4;
for (uintptr_t vftEntry = (uintptr_t)serverBase; vftEntry <= end; vftEntry += 4)
{
auto funcPtr = *(uintptr_t*)vftEntry;

Expand Down

0 comments on commit 6290e78

Please sign in to comment.