From 4fee4acce52f9d7c23219cdd66ac077ece2796ff Mon Sep 17 00:00:00 2001 From: BroGamer <64546358+BroGamer4256@users.noreply.github.com> Date: Fri, 19 Aug 2022 17:29:25 +1200 Subject: [PATCH] Stop exitwindows calls --- src/boilerplate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/boilerplate.c b/src/boilerplate.c index 485872f..a905960 100644 --- a/src/boilerplate.c +++ b/src/boilerplate.c @@ -2,6 +2,10 @@ // force show cursor HOOK_DYNAMIC (i32, __stdcall, ShowMouse, i32 show) { return originalShowMouse (true); } +HOOK_DYNAMIC (i32, __stdcall, ExitWindows, i32 exitCode, i32 reason) { + ExitProcess (0); + return true; +} // xinput stuff HOOK_DYNAMIC (u32, __stdcall, XinputGetState, u32 index, void *state) { return ERROR_DEVICE_NOT_CONNECTED; } @@ -80,6 +84,8 @@ HOOK_DYNAMIC (i32, __stdcall, bngrw_reqCancel) { return 1; } void init_boilerplate () { INSTALL_HOOK_DYNAMIC (ShowMouse, PROC_ADDRESS ("user32.dll", "ShowCursor")); + INSTALL_HOOK_DYNAMIC (ExitWindows, PROC_ADDRESS ("user32.dll", "ExitWindowsEx")); + INSTALL_HOOK_DYNAMIC (XinputGetState, PROC_ADDRESS ("xinput9_1_0.dll", "XInputGetState")); INSTALL_HOOK_DYNAMIC (XinputSetState, PROC_ADDRESS ("xinput9_1_0.dll", "XInputSetState")); INSTALL_HOOK_DYNAMIC (XinputGetCapabilites, PROC_ADDRESS ("xinput9_1_0.dll", "XInputGetCapabilities"));