|
Example hijacking getpid(2) to modify the return value: Compiling and execution:Hijacking functions with LD_PRELOAD (II)
pid_t getpid(void)
{
return 42;
}
$ LD_PRELOAD=./getpid.so bash -c 'echo $$'
42