From d839ad1b7d7187467ac1161e3d364141102d3cb0 Mon Sep 17 00:00:00 2001 From: FutureRave Date: Tue, 22 Mar 2022 23:50:09 +0000 Subject: [PATCH] ASM --- src/component/cheats.cpp | 50 ++++++++++++++++++------------------- src/component/user_info.cpp | 17 ++++++------- 2 files changed, 33 insertions(+), 34 deletions(-) diff --git a/src/component/cheats.cpp b/src/component/cheats.cpp index 4d6c5fd..4d45203 100644 --- a/src/component/cheats.cpp +++ b/src/component/cheats.cpp @@ -12,45 +12,45 @@ game::dvar_t* cl_EnableCheats; __declspec(naked) void draw_red_box_stub() { __asm { - push eax - mov eax, cl_EnableCheats - cmp byte ptr [eax + 12], 1 - pop eax + push eax + mov eax, cl_EnableCheats + cmp byte ptr [eax + 12], 1 + pop eax - je draw + je draw - test byte ptr ds:0x8FF110, 0x10 + test byte ptr ds:0x8FF110, 0x10 - push 0x430568 - retn + push 0x430568 + retn - draw: - push 0x43056A - retn + draw: + push 0x43056A + retn } } __declspec(naked) void blind_eye_check_stub() { __asm { - push eax - mov eax, cl_EnableCheats - cmp byte ptr [eax + 12], 1 - pop eax + push eax + mov eax, cl_EnableCheats + cmp byte ptr [eax + 12], 1 + pop eax - je draw + je draw - test byte ptr [esi], 0x20 - jnz skip_because_blindeye + test byte ptr [esi], 0x20 + jnz skip_because_blindeye - jmp draw + jmp draw - skip_because_blindeye: - push 0x5AA5A2 - retn + skip_because_blindeye: + push 0x5AA5A2 + retn - draw: - push 0x05AA529 - retn + draw: + push 0x05AA529 + retn } } diff --git a/src/component/user_info.cpp b/src/component/user_info.cpp index 51696e1..5567dd3 100644 --- a/src/component/user_info.cpp +++ b/src/component/user_info.cpp @@ -44,17 +44,16 @@ void cl_check_user_info(int _a1, const int force) { } __declspec(naked) void cl_check_user_info_stub() { - __asm - { - pushad + __asm { + pushad - push 0 - push esi - call cl_check_user_info - add esp, 8 + push 0 + push esi + call cl_check_user_info + add esp, 8 - popad - ret + popad + ret } } } // namespace