regomne / ilhook-rs

A library that provides methods to inline hook binary codes in x86 and x86_64 architecture
MIT License
69 stars 10 forks source link

"Hooker::new" support "extra_data" #4

Closed persytry closed 1 year ago

persytry commented 1 year ago

Could you support "extra_data" for Hooker::new function? Then, pass the "extra_data" to callback of HookType, example:

pub type JmpBackRoutine = unsafe extern "win64" fn(regs: *mut Registers, src_addr: usize, extra_data: *const u8);

thanks.

regomne commented 1 year ago

Yeah, that is a useful feature. I will add it next week.

persytry commented 1 year ago

Thank you

regomne commented 1 year ago

Feature added. The parameter src_addr in callbacks is replaced by user_data which is passed previously to Hooker::new.

persytry commented 1 year ago

Thank you, great

persytry commented 1 year ago

Are not you published v2.0 to the crates.io? I want to use the new feature, that's exciting!

regomne commented 1 year ago

https://crates.io/crates/ilhook From the webpage, it has been published.

persytry commented 1 year ago

thanks