Hooking Example (case 1. getchar() / rand())


 Hooking Example:
 1. Getchar() / rand
   only C , and this code is meaningless code. Only test!


Target code.
- target.c
  : gcc –o target target.c




Hook code.
- hook.c
  : gcc -shared -fPIC -o hook.so main.c –ldl




Exec:


Normal:
$  ./target


Hook:
$LD_PRELOAD="/home/xxxx/hook_test/hook/hook.so" ./target






*the blue box : privacy.

#C #C++ #Linux #Embedded #Hooking Example #Hooking 

No comments:

Post a Comment

Apartment Buying Guide 2025: Shocking Red Flags You Should NEVER Ignore!

 🏙️ Apartment Buying Guide 2025: Shocking Red Flags You Should NEVER Ignore! 🚨 Are you thinking about buying an apartment in 2025? 🏢  It’...