Override system function
From: Darkone (degrade_at_msn.com)
Date: 11/03/04
- Next message: Tomas Carnecky: "Re: reserving memory without allocating it"
- Previous message: Anton Ertl: "Re: Why do I need #define _XOPEN_SOURCE 500 for pread() declaration?"
- Next in thread: Måns Rullgård: "Re: Override system function"
- Reply: Måns Rullgård: "Re: Override system function"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 3 Nov 2004 05:49:06 -0800
I need to override open() and close() system functions.
I have read about writing a LKM to do this, but this will only work
under 2.4 kernels and kernels with LKM support.
I also read about using LD_PRELOAD but this leads to the problem of
how to call the original (real) open() which I will also need to do.
Therefore, I would like to know if anyone knows how I can achieve
this?
So if LD_PRELOAD is the way to go then how do I get the original
open()?
Under Mac OS X and Windows I am finding the address of the real open
function and changing the first instruction to branch to a new area of
memory which can also re-enter the original.
Problem is I dont know enough about Linux and the system functions to
know if this is possible on Linux?
- Next message: Tomas Carnecky: "Re: reserving memory without allocating it"
- Previous message: Anton Ertl: "Re: Why do I need #define _XOPEN_SOURCE 500 for pread() declaration?"
- Next in thread: Måns Rullgård: "Re: Override system function"
- Reply: Måns Rullgård: "Re: Override system function"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|