Skip to content

yoggy/hook_fork

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hook_fork.cpp

fork() function hook sample

shell

Linux, FreeBSD

  $ gcc -Wall -fPIC -shared -o hook_fork.so hook_fork.c
  $ LD_PRELOD=/path/to/hook_fork.so ./target_program

Mac OS X

  $ gcc -Wall -fPIC -shared -o hook_fork.dylib hook_fork.c
  $ DYLD_INSERT_LIBRARIES=/path/to/hook_fork.dylib DYLD_FORCE_FLAT_NAMESPACE=Y ./target_program

gdb

  $ gdb ./target_program
  (gdb) set environment LD_PRELOAD=LD_PRELOD=/path/to/hook_fork.so
  (gdb) run

gdbserver

  $ gdbserver --wrapper env LD_PRELOAD=./hook_fork.so -- :2222 ./test_main

see also:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors