[saco] Correct SetIPLs to spell out the last two patches; retail inlines the protect/memcpy/restore there instead of calling _patch, only the two spare frame slots and one materialised address differ now

This commit is contained in:
ricardoofnl
2026-09-05 10:28:46 +07:00
parent 35e99d286f
commit ba47566596
+11 -2
View File
@@ -49,8 +49,17 @@ void SetIPLs(int iIPLs, int iGtaVersion)
patch(0x156495A,bIPLs);
patch(0x156115C,bIPLs);
}
patch(0x40619B,bIPLs);
patch(0x405C3D,bIPLs);
// the last two are _patch spelled out, not a call to it
DWORD dwProtect[2];
VirtualProtect((PVOID)0x40619B,sizeof(bIPLs),PAGE_EXECUTE_READWRITE,&dwProtect[0]);
memcpy((PVOID)0x40619B,bIPLs,sizeof(bIPLs));
VirtualProtect((PVOID)0x40619B,sizeof(bIPLs),dwProtect[0],&dwProtect[1]);
VirtualProtect((PVOID)0x405C3D,sizeof(bIPLs),PAGE_EXECUTE_READWRITE,&dwProtect[0]);
memcpy((PVOID)0x405C3D,bIPLs,sizeof(bIPLs));
VirtualProtect((PVOID)0x405C3D,sizeof(bIPLs),dwProtect[0],&dwProtect[1]);
}
}