At 7:38 PM +0100 14-01-00, Todd L. Cignetti wrote:
>Is it possible to patch a library trap from HackMaster?
>
>The trap numbers for the library traps start at 0xA800 and go up from there.
>For example, I want to patch all of the 'Open' library calls (library calls
>with trap number 0xA801), SerOpen(refnum, ...), NetLibOpen, etc..
I don't believe this is possible.
Each library has its own dispatch table. The library call dispatcher uses
the library number (you pass that as the 1st argument) to figure out which
function table to find the real address of the function.
HackMaster patches the OS trap table (perhaps via SysSetTrapAddress), which
is always at a well-known location.
I suppose it's possible to do something like a SysSetTrapAddress for
library traps, but I think it could be very tricky, because the library
dispatch table is normally stored in protected memory (in the shared
library itself.)
--Bob