This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: About hacking libc
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: Xinyang Ge <xxg113 at cse dot psu dot edu>
- Cc: libc-help at sourceware dot org
- Date: Tue, 23 Apr 2013 16:35:37 -0400
- Subject: Re: About hacking libc
- References: <CACY857JO7HoMRQyX1sb1gqR0DzK0PksBy0OPd7awCVbBSVKCPQ at mail dot gmail dot com>
On Tue, Apr 23, 2013 at 2:37 PM, Xinyang Ge <xxg113@cse.psu.edu> wrote:
> I am a graduate student at Penn State and currently doing some experiments
> on glibc and hoping to put some hooks inside open() library call. However,
> as I examined the source code, I noticed these system call wrappers are
> dynamically generated at compile time from syscall-template.S. I renamed the
> wrapper's name (e.g., from open() to _open()) in syscalls.list and add
> another layer of wrapper to add code beyond _open().
That sounds reasonable.
> Does anyone know some more elegant way in doing the same thing? Thanks a
> lot!
Write a library, preload it, and within your open function dlopen libc
and call the
real open?
Use systemtap to instrument the syscall on the kernel side?
Cheers,
Carlos.