Problems on injecting into printf using LD_PRELOAD method
问题 I was hacking printf() of glibc in one of my project and encountered some problem. Could you please give some clues? And one of my concern is why the same solution for malloc/free works perfect! As attached, “PrintfHank.c” contains my own solution of printf() which will be preloaded before standard library; and “main.c” just outputs a sentence using printf(). After editing two files, I issued following commands: compile main.c gcc –Wall –o main main.c create my own library gcc –Wall –fPIC