From 1a4a7b7568e5698d29a3dd782bd9be91d9d72c67 Mon Sep 17 00:00:00 2001 From: Thomas Jones Date: Mon, 17 Jun 2024 00:02:40 +1000 Subject: [PATCH] Remove unnecessary offset on `patch_vm` --- hooks.c | 2 +- patches.c | 12 ++---------- patches.h | 4 ++-- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/hooks.c b/hooks.c index 045da92..2ff3924 100644 --- a/hooks.c +++ b/hooks.c @@ -57,7 +57,7 @@ void __cdecl My_Sys_SetModuleOffset(char* moduleName, void* offset) { SearchVmFunctions(); HookVm(); InitializeVm(); - patch_vm(offset); + patch_vm(); } } diff --git a/patches.c b/patches.c index 4b7ce63..1eaa6b7 100644 --- a/patches.c +++ b/patches.c @@ -37,14 +37,6 @@ void vote_clientkick_fix(void) { patch_by_mask( ADDR_VOTE_CLIENTKICK_FIX, PTRN_VOTE_CLIENTKICK_FIX, MASK_VOTE_CLIENTKICK_FIX ); } -void framerate_fix(void* offset) { - unsigned char str_125[] = "125"; - int page_size = sysconf(_SC_PAGESIZE); - mprotect((void*)((uint64_t)(offset + 0x254878) & ~(page_size-1)), page_size, PROT_READ | PROT_WRITE); - *(int64_t*)(offset + 0x254878) = (int64_t)str_125; -} - -void patch_vm(void* moduleOffset) { +void patch_vm(void) { vote_clientkick_fix(); - framerate_fix(moduleOffset); -} +} \ No newline at end of file diff --git a/patches.h b/patches.h index 43cb11f..80c33d4 100644 --- a/patches.h +++ b/patches.h @@ -1,4 +1,4 @@ -void patch_vm(void* moduleOffset); +void patch_vm(void); #if defined(__x86_64__) || defined(_M_X64) @@ -12,4 +12,4 @@ void patch_vm(void* moduleOffset); #define PTRN_VOTE_CLIENTKICK_FIX "\x69\xc8\xd0\x0b\x0\x0\x01\xca\x90\x0\x44\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x6c\x90\x90\x90\x90\x90\x90\x90\x90" #define MASK_VOTE_CLIENTKICK_FIX "XXXXXXXXX-X------------XXXXXXXXX" -#endif +#endif \ No newline at end of file