How to override printf/scanf calls

Bharath Ramesh bramesh@vt.edu
Thu Oct 8 04:16:00 GMT 2009


I know that I can override most system calls in libc writing the function
with the right signature and then creating a shard library out of it and use
the LD_PRELOAD mechanism when I run any application. This method doesn't not
work for libc calls like printf/scanf. Writing a shared library with any of
this calls has issues as ld cant preload this shared library. The only other
option I have at the moment is to download glibc source and rebuild glibc
with appropriate changes. This makes the solution not portable, I was
wondering if there was any other way by which I could override libc calls
like printf/scanf?

Regards,

Bharath
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3441 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-help/attachments/20091008/48396ca2/attachment.bin>


More information about the Libc-help mailing list