-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
need support for "thiscall" #51
Comments
thiscall ABI should be supported, is behind a feature flag [dependencies]
retour = { version = "0.3", features = ["thiscall-abi"] } A little background on why the feature flag: If you have any issues with the flag enabled, let me know and I can try to help out further! |
static_detour! { pub fn set_hook() { #[no_mangle] pls see this test in StaticDetour. i tried this ,but when initialize will show error like i tried GenericDetour work is ok.but i wanna know why cause this problem. |
Ah I see the issue. This isn't an issue exclusive to "thiscall" ABI, it's an issue with unsafe hooks. StaticDetour is meant to allow any function to be detoured by another function with the same arguments and return type. That's done through the In order to hook an static_detour! {
static Test: unsafe extern "thiscall" fn(i32, i32, i32, i32) -> i32;
}
pub fn set_hook() {
unsafe {
let original_call = std::mem::transmute::<
usize,
unsafe extern "thiscall" fn(i32, i32, i32, i32) -> i32,
>(0x00BE5900);
Test.initialize(original_call, test_hook)
.unwrap()
.enable()
.unwrap()
};
}
fn test_hook(arg0: i32, arg1: i32, arg2: i32, arg3: i32) -> i32 {
unsafe { Test.call(arg0, arg1, arg2, arg3) };
0
} |
need support fo "thiscall"
The text was updated successfully, but these errors were encountered: