Override system function
From: Darkone (degrade_at_msn.com)
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
So if LD_PRELOAD is the way to go then how do I get the original
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?