Files
hkrpg-patch/hkrpg/src/modules/hk_check.rs
2025-08-22 06:04:37 +07:00

28 lines
740 B
Rust

use ilhook::x64::Registers;
use crate::addr::rva_config;
use super::{HkrpgModule, HkrpgModuleContext};
pub struct HkCheck;
impl HkrpgModule for HkrpgModuleContext<HkCheck> {
unsafe fn init(&mut self) -> Result<(), ilhook::HookError> {
let config = rva_config();
if config.hk_check1 != 0 && config.hk_check2 != 0 {
self.interceptor
.replace(config.hk_check1, HkCheck::replacement)?;
self.interceptor
.replace(config.hk_check2, HkCheck::replacement)?;
println!("[hk_check::init] hk_check bypassed")
}
Ok(())
}
}
impl HkCheck {
extern "win64" fn replacement(_: *mut Registers, _: usize, _: usize) -> usize {
0
}
}