Hpmason / retour-rs

A cross-platform detour library written in Rust
Other
112 stars 18 forks source link

Support Detouring Functions With >14 Args #53

Open Hpmason opened 6 months ago

Hpmason commented 6 months ago

Adds a feature that increases the number of args in detourable functions (from 14 to 26). Putting behind a feature since it may increase compilation times. I want to do more investigation to see if it actually has a negligible effect on comp times, since it may make more sense to not put behind feature.

If put behind feature, I'd want to add docs.rs macros so that the docs more clearly state the that more arguments are behind the feature extra-impls. e.g.:

#[cfg(feature = "extra-impls")]
#[cfg_attr(docsrs, doc(cfg(feature = "extra-impls")))]

Resolves #52

zhefenfei commented 5 months ago

static_detour! { pub static CAvatar_PrepareActionLayerHook:extern "thiscall" fn(&'static CAvatar, u32, u32, u32); pub static xxx:extern "thiscall" fn(i32,i32,*const i16,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32,i32); }

retour = { git = "https://github.com/Hpmason/retour-rs.git", branch = "impl-more-params",features = [ "extra-impls", "static-detour", "thiscall-abi", ] }

why can not compile it.

Hpmason commented 5 months ago

My latest commits should fix this issue. Can you try rerunning it after running cargo update?