This commit is contained in:
6arelyFuture 2021-11-17 00:19:05 +00:00
parent ed8ab4bd60
commit 42f1f31352
No known key found for this signature in database
GPG Key ID: E883E2BC9657D955

View File

@ -7,14 +7,14 @@
namespace cheats namespace cheats
{ {
game::dvar_t* cl_wallhack; game::dvar_t* cl_EnableCheats;
__declspec(naked) void draw_red_box_stub() __declspec(naked) void draw_red_box_stub()
{ {
__asm __asm
{ {
push eax push eax
mov eax, cl_wallhack mov eax, cl_EnableCheats
cmp byte ptr [eax + 12], 1 cmp byte ptr [eax + 12], 1
pop eax pop eax
@ -36,7 +36,7 @@ namespace cheats
__asm __asm
{ {
push eax push eax
mov eax, cl_wallhack mov eax, cl_EnableCheats
cmp byte ptr [eax + 12], 1 cmp byte ptr [eax + 12], 1
pop eax pop eax
@ -62,7 +62,7 @@ namespace cheats
public: public:
void post_unpack() override void post_unpack() override
{ {
cl_wallhack = game::Dvar_RegisterBool("cl_EnableCheats", false, game::DVAR_FLAG_NONE, "Enable FoF wallhack"); cl_EnableCheats = game::Dvar_RegisterBool("cl_EnableCheats", false, game::DVAR_FLAG_NONE, "Enable FoF wallhack");
utils::hook::jump(0x430561, draw_red_box_stub); utils::hook::jump(0x430561, draw_red_box_stub);
utils::hook::nop(0x430566, 2); utils::hook::nop(0x430566, 2);
@ -76,12 +76,12 @@ namespace cheats
{ {
key_catcher::on_key_press("Z", [](const game::LocalClientNum_t&) key_catcher::on_key_press("Z", [](const game::LocalClientNum_t&)
{ {
game::Dvar_SetBool(cl_wallhack, true); game::Dvar_SetBool(cl_EnableCheats, true);
}); });
key_catcher::on_key_press("X", [](const game::LocalClientNum_t&) key_catcher::on_key_press("X", [](const game::LocalClientNum_t&)
{ {
game::Dvar_SetBool(cl_wallhack, false); game::Dvar_SetBool(cl_EnableCheats, false);
}); });
} }
}; };