Hpmason / retour-rs

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

Could u add the params count #52

Open zhefenfei opened 3 months ago

zhefenfei commented 3 months ago

i see the params only support 14,but in some very especially c function it need 15 params,could u add params count support.appreciate.

//see only 14 params right? impl_hookable! { arg_0: A, __arg_1: B, arg_2: C, arg_3: D, __arg_4: E, arg_5: F, arg_6: G, __arg_7: H, arg_8: I, arg_9: J, __arg_10: K, arg_11: L, __arg_12: M, __arg_13: N }

Hpmason commented 3 months ago

Yeah, you're correct, it's only 14 arguments atm. I'm thinking of either increasing the default amount of args to a higher number or putting additional argument counts behind a feature (putting it behind a feature that increases the amount to like 26 should be more than enough).

I'm gonna do some testing this week to see which route I'm going with and will have it merged later. If you want to try the branch in my PR, you can modify the Cargo.toml:

[dependencies]
retour = { git = "https://github.com/Hpmason/retour-rs.git", branch = "impl-more-params" }

If you get a chance, let me know if you run into any issues or notice a significant change in comp times (I'm on a pretty beefy machine so I want to run some benchmarks on some weaker machines before I go with either solution).

zhefenfei commented 3 months ago

Yeah, you're correct, it's only 14 arguments atm. I'm thinking of either increasing the default amount of args to a higher number or putting additional argument counts behind a feature (putting it behind a feature that increases the amount to like 26 should be more than enough).

I'm gonna do some testing this week to see which route I'm going with and will have it merged later. If you want to try the branch in my PR, you can modify the Cargo.toml:

[dependencies]
retour = { git = "https://github.com/Hpmason/retour-rs.git", branch = "impl-more-params" }

If you get a chance, let me know if you run into any issues or notice a significant change in comp times (I'm on a pretty beefy machine so I want to run some benchmarks on some weaker machines before I go with either solution).

yea,it's enough i guess for 26 params.thx again.and is there any util about closure detour?