1.7. Breakpoints

There are other ways to interrupt a program than pressing the hot-keys. Firstly, the program may execute a DesktopHacker_BreakPoint (&82743) SWI. The SWI call itself does nothing, but if the program calls it whilst it is being hacked, Desktop Hacker will try to interrupt.

By including this SWI in your programs you can use Desktop Hacker as a primitive debugger as well as a games hacker. Good, eh? The other use is to insert a breakpoint into a program you're hacking. However, you'll have to remember what the instruction you replace with the call to DesktopHacker_BreakPoint was and put it back afterwards, as well as altering the return address to re-execute that instruction (see altering registers), so it's not particularly convenient. But it works.

Secondly, you can set Desktop Hacker to interrupt a task when it executes certain SWIs. These options are controlled from the command line rather than the Wimp. For example, to trap Wimp_Initialise, press F12 and enter:

SetHackPoint SWI Wimp_Initialise

This traps both the normal and non-error-returning version of the SWI (XWimp_Initialise). It is also possible to trap all the SWIs in a chunk provided by one module. For example, you can trap all Wimp SWIs by entering:

SetHackPoint SWIGroup Wimp

You can also specifiy a SWI number or chunk base number in these * commands.

The final type of HackPoint you can set is a delay. This could be useful if the keyboard becomes unusable when a game is run, making it impossible for Desktop Hacker to spot the hot-keys being pressed. With this option, Desktop Hacker interrupts a game a certain amount of time after the game is first run. This time is specified in centiseconds, so:

SetHackPoint Delay 5000

interrupts a game five seconds after it started.

Use *ListHackPoints to show what breakpoint conditions are currently set. To remove a hackpoint, use *ClearHackPoint with the type and value of the hackpoint. You can remove all hackpoints of a certain type by just giving the type alone, or all hackpoints at once by giving no parameters.


(-- /!\ Configuring the interface
/\ Running Desktop Hacker


ajc@doggysoft.co.uk
23rd April 1998