This is a simple and minimal hooking library that uses syscalls. It was made to bypass anticheat hooks (e.g., NtProtectVirtualMemory, VirtualProtect) that block access to changing the assembly, rendering libraries like MinHook unusable.
You could also use the .asm file provided in this project to update minhook to work. (VirtualProtect in Minhook)
UC thread: https://www.unknowncheats.me/forum/combat-master/663786-hooks.html
(The function is an standard get fov for unity)
void WINAPI hk_weapon_sway_update(void* thisptr) {
if (modules::noSwayEnabled) {
//stop weapon sway
return;
}
//return normal function
return original_weapon_sway_update(thisptr);
}
void main(){
//init library
maticHook::init()
//make hook
lpTarget = (LPVOID)(CombatMaster::GameAssembly + Offsets::WeaponSwayUpdate);
maticHook::create(lpTarget, hk_weapon_sway_update, reinterpret_cast<void*&>(original_weapon_sway_update));
}