An example of hooking libc's malloc()
and free()
calls using
Linux's LD_PRELOAD
method. In this example global variables inside
the shared object track each pointer and it's allocated size. The size can
then be used to print out the contents of the buffer during a call to
free()
.
vykt / malloc_free_hook_example Goto Github PK
View Code? Open in Web Editor NEWExample of hooking malloc() and free() using LD_PRELOAD on Linux systems. Contents of buffer are printed on release.
License: GNU General Public License v3.0