gustavorv86 / preloadwrite

LD_PRELOAD system call example.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

preloadwrite

LD_PRELOAD system call example.

gustavorv86@debian:~/preloadwrite$ make
"/usr/bin/gcc" -shared -fPIC -ldl -o preloadwrite.so src/preloadwrite.c
gustavorv86@debian:~/preloadwrite$ echo "hello" > file.txt
gustavorv86@debian:~/preloadwrite$ cat file.txt
hello
gustavorv86@debian:~/preloadwrite$ export LD_PRELOAD=${PWD}/preloadwrite.so
gustavorv86@debian:~/preloadwrite$ cat file.txt
Hello world
hello
Goodbye cruel world
gustavorv86@debian:~/preloadwrite$ unset LD_PRELOAD

About

LD_PRELOAD system call example.

License:GNU General Public License v3.0


Languages

Language:C 79.2%Language:Makefile 20.8%