Well.. it is possible, but the solution is a bit complicated:
(1) I created a new library, with the same dispatch table as the one I
wanted to trap.
(2) I created a Hack that traps the SysFindLib trap. When some program asks
for a specific lib, I return mine. When I wanted the original lib, I used a
special name for it (this gives the ability to use the original lib)
That's it, and you can also debug it on your POSE !!!
Regards,
Dan Hod
R&D Manager
The PalmMate Team
Gotta Palm? Gotta visit www.PalmMate.com
----- Original Message -----
From: Bob Ebert <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: ��� ����� 18 ����� 2000 19:41
Subject: Re: Patching library traps with HackMaster
> 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
>
>
>
>