lief-project / LIEF

LIEF - Library to Instrument Executable Formats (C++, Python, Rust)
https://lief.re
Apache License 2.0
4.5k stars 624 forks source link

is it possible to write a Detours like hook? #619

Closed danyhm closed 3 years ago

danyhm commented 3 years ago

Hello,

I saw the example for modifying console to show message box instead. But it needs assembly coding and for bigger functions it may be too hard.

Is it possible to hook the function like other hooking engines such as microsoft detours do? And provide a c like function to be executed instead of the hook?

Thanks

romainthomas commented 3 years ago

Hello @danyhm Actually the examples in LIEF related to hooking are PoC and these PoC do not aim at being a feature in LIEF (at least not in the mid-term).

I would recommend to use a library that has this purpose (like Frida or Dobby).

danyhm commented 3 years ago

@romainthomas Thanks for the tip! I'll definitly look into them.