nfsu2 - fixed
@@ -459,14 +459,14 @@ DWORD WINAPI Init(LPVOID bDelay)
};
static bool Zstate, Pstate, Tstate, Dstate, Qstate, Cstate, LBRACKETstate, RBRACKETstate;
- pattern = hook::pattern("5E 5D 5F 33 C0 5B 59 C2 04 00"); //5C8C5F
- injector::WriteMemory(pattern.count(2).get(1).get<uint32_t>(7 + 5), 0x900004C2, true);
static int32_t* nGameState = (int32_t*)*hook::pattern("83 3D ? ? ? ? 06 ? ? A1").count(1).get(0).get<uint32_t*>(2);
+ pattern = hook::pattern("B9 ? ? ? ? BE ? ? ? ? F3 A5 5F 5E 5B C3");
struct CatchPad
{
void operator()(injector::reg_pack& regs)
{
- PadState* PadKeyPresses = *(PadState**)(regs.esp + 0x4);
+ regs.ecx = 0x88;
+ PadState* PadKeyPresses = (PadState*)(regs.edi);
if (PadKeyPresses != nullptr && PadKeyPresses != (PadState*)0x1 && *nGameState == 3)
{
@@ -495,7 +495,7 @@ DWORD WINAPI Init(LPVOID bDelay)
Zstate = false;
}
}
- }; injector::MakeInline<CatchPad>(pattern.count(2).get(1).get<uint32_t>(7));
+ }; injector::MakeInline<CatchPad>(pattern.get_first(0));
const char* MenuTexts[] = { "Quit Game", "Continue", "Back", "Reset Keys To Default", "Activate GPS", "Deactivate GPS", "Install Package", "Install Part", "Install Paint", "Install Decal", "Reset To Default", "Delete Tuned Car", "Logoff", "Cancel Changes", "Customize", "Host LAN Server", "Read Message", "Delete", "Test N2O Purge", "Accept", "Reset to default", "Select", "Open/Close Doors", "Open/Close Hood" }; // "Tip",
