This invention provides a system and method for instrumenting an executable
file by replacing an original function in the executable file with a user-supplied
function and enabling the user-supplied function to invoke the original function.
In particular, the executable file includes an access to the original function.
To instrument the executable file, the access to the original function is replaced
with an access to the user-supplied function. Access information associated with
the original function is retained, which enables the user-supplied function to
locate the original function.