From 05ade5dc4352f531d7808c5c6172f1f95de087ff Mon Sep 17 00:00:00 2001 From: ThirteenAG Date: Sun, 21 Apr 2024 01:33:03 +0800 Subject: [PATCH] aim zoom pad fix - fixes #477 --- source/fixes.ixx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/source/fixes.ixx b/source/fixes.ixx index d0862723..f2c66068 100644 --- a/source/fixes.ixx +++ b/source/fixes.ixx @@ -76,7 +76,7 @@ public: *(uint8_t*)(regs.esi + 0x200) |= 1; byte_F47AB1 = 1; } - }; + }; if (!pattern.empty()) injector::MakeInline(pattern.get_first(0), pattern.get_first(7)); else { @@ -108,6 +108,20 @@ public: pattern = hook::pattern("88 1D ? ? ? ? 74 10"); injector::WriteMemory(pattern.get_first(1), 0x25, true); //mov ah } + + //gamepad handler + pattern = find_pattern("88 8E ? ? ? ? 84 DB"); + if (!pattern.empty()) + { + struct AimZoomHook3 + { + void operator()(injector::reg_pack& regs) + { + *(uint8_t*)(regs.esi + 0x200) = regs.ecx & 0xFF; + byte_F47AB1 = *(uint8_t*)(regs.esi + 0x200); + } + }; injector::MakeInline(pattern.get_first(0), pattern.get_first(6)); + } } if (bRecoilFix)