Index


RISC World

Desktop Hacker

Foundation RISCWorld

1. Running Desktop Hacker.

Double-click on the !dHacker icon to start Desktop Hacker. Interactive help is supported. To quit Desktop Hacker, click Menu on the icon bar icon and choose 'Quit'.

1.1. Starting a game.

To use Desktop Hacker on a game, run Desktop Hacker and then start the game by dragging it to the Desktop Hacker icon on the icon bar instead of double- clicking on it.

If the program being hacked multi-tasks, the dHacker icon changes to say Running whilst the program is still running. You can only hack one program at a time in this manner.

If you quit Desktop Hacker whilst a program being hacked is running, that program will be quit as well. Doing this is not recommended - the hacked program will not be quit 'properly', a bit like using the Risc PC's watchdog feature (by pressing Alt and Break).

1.2. Interrupting with the hot-keys.

When a game is running that was started by dragging it to Desktop Hacker, you can interrupt it at any point by holding down both Alt keys, either side of the space bar. Desktop Hacker will return to the desktop immediately, and open the disassembler and register windows ready for you to find cheats. You can use the desktop and any applications without affecting the game, though Desktop Hacker turns the sound system off to avoid crashes with certain games' music systems.

To go back to the game where you left off:

  • Click Select on the icon bar icon

  • Click 'Continue' on the button bar at the top of the disassembler
  • Or choose 'Continue' from the disassembler menu.

It is possible to quit the game from the desktop, but as with pressing Alt- Break during the game on the Risc PC, this isn't guaranteed to work perfectly if at all; it depends on the game. To try to quit the game without its permission, choose 'Kill game' from the disassembler menu.

Sometimes games don't allow you to interrupt them. These are a few of the reasons this can happen:

* Lack of memory. If there is not enough free memory to interrupt the game when the hot-keys are pressed, nothing will happen until you quit the game and then return to the desktop. Then an error window will appear to tell you of the memory problem. Try to free up some more memory, or see memory reservation [1.4].

* Not being paged in. If the program you're hacking multi-tasks, it may not be active when you press the hot-keys, so Desktop Hacker will not interrupt. The easiest way to make sure the program gets paged in and thus interrupted is to click on one of its windows whilst holding down the hot- keys.

* Sometimes the program you get when you run the game application is not the game itself, but another program which itself launches the game. If the launcher program starts the game directly Desktop Hacker will detect this and you can do something about it (see Forking [1.3]), but if the game is started by a command like *Filer_Run you'll have to open the game and look at the !Run file in a text editor to see what it runs. If it contains a line like:

    Filer_Run <Obey$Dir>.!Run2

then you should drag the !Run2 file inside the game to the icon bar icon instead of the game itself.

* Some games stop Desktop Hacker interrupting by turning interrupts off or deliberately kill Desktop Hacker. There is not much can be done about this.

Changing the hot-keys

It is possible to change the key combination used to activate Desktop Hacker. Users of the Acorn A4 in particular will need to change it since the A4 only has one Alt key.

Choose 'Choices...' from the icon bar menu and click on the Change button to change the hot-key combination. Hold down the combination of keys you want to use to activate Desktop Hacker; up to four keys can be used together.

All the options on this window, including the hot-key settings, may be put into action by clicking on 'OK' or saved to disc to be used every time Desktop Hacker is loaded by clicking on 'Save'.

1.3. Forking.

Under RISC OS, a program can start off another task to run concurrently with it using the SWI Wimp_StartTask. However, Desktop Hacker can only hack one task at once, so when it detects this happening it will ask you which of the tasks you wish to hack.

If you click on 'Follow', Desktop Hacker will forgot the old task it was following, and hack the new one. This is usually what you want with games, as generally it is a Wimp front end task launching a main game task, and the latter is what you want to hack.

If you click on 'Stay', Desktop Hacker will ignore the new task and continue with the existing one. On some versions of the WIMP, this may sometimes not work and cause Desktop Hacker to follow no task at all, due to the odd way Wimp_StartTask works. So it's usually best not to choose 'Stay'.

1.4. Reserving memory and screen memory.

Some games have a habit of claiming all available memory in your computer when you run them. This means that when Desktop Hacker comes to interrupt them it cannot claim the memory it needs to do so, and it can't do anything until you return to the desktop and it can complain at you.

If you always get out-of-memory complaints when trying to hack a certain game, it is likely that it is claiming all the memory. You can get around this by asking Desktop Hacker to claim some memory before you run the game.

Desktop Hacker will then keep the memory until it needs it to interrupt the game.

Enable the 'Reserve' option on the Choices window to turn this feature on, and enter an amount of memory to keep in reserve in the fill-in field. You will generally need about 100K more reserve memory than the amount of memory your Wimp screen mode takes up (see the Task Manager display to see how much this is). If you have a Risc PC with a reasonable amount of memory it may be a good idea to leave this option enabled with a few thousand kilobytes of reserve memory.

Below this option on the Choices window is the 'Don't keep screen display' feature. This feature is intended to save memory on smaller machines where memory is a problem and games tend to fill the memory; if you enable it, the screen-saving feature will not be available, and the game's screen display is likely to be corrupted when you return, but the memory saving will make it easier for Desktop Hacker to interrupt.

1.5. The disassembler.

The disassembler is the main view you have on the game's memory. The order of the items in the disassembler is:

    Text Value     Address    Disassembled instruction.

The text part of the disassembler shows the contents of memory converted to ASCII text; the value part is shown in hex. The address is shown in the middle (rather than on the left, so you can line it up with the instruction more easily).

Choose a list in the 'Use list' field and all the visible addresses included in that list will be highlighted in red, as above. If you click on the address with Adjust, the address will be toggled in or out of the list. Use the List arrows next to the List selector to move the disassembler through addresses in the list: the inner arrows move through the addresses one by one, and the outer arrows move to the first and last addresses in the list.

You can also move to a different address by entering the address in the Goto field and pressing Return on clicking on Goto. Also, if an instruction refers to another address - for example, a branch instruction or a load/ store instruction, you can move the disassembler to that address by holding down Shift and clicking Select on the instruction. You can go back to the last instruction you jumped from in this way by clicking on 'Goto last' on the button bar - this is useful for investigating and returning from subroutines.

To print a section of disassembled code, open the disassembler window and choose 'Print'. Enter a range of addresses to disassemble between and click on 'Print'.

Because everyone writes assembler code in different ways, Desktop Hacker can disassemble in different styles. The disassembly style is set from the Choices window.

The register set is chosen on the left. As well as the normal register names with or without R12 to R15 renamed, Desktop Hacker can use the APCS register set, which is nice if you like that sort of thing. (I don't.).

On the right, the case of the disassembled instructions can be set to your own personal style. Upper and lower case mnemonics and registers may be set separately; there is also a mixed case mnemonics option, wherein the only the first letters of mnemonics, condition codes and flags are capitalised. I like this, but some people think it is evil. S'what options are for, innit?

1.6. Configuring the interface.

The other bit on the Choices window I haven't covered is for configuring the style of the user interface. This will not concern most people, but border- bigots (like me) have their own preferences and violently dislike applications that do not stick to them.

If you are mad and like the standard RISC OS Style Guide type of icon, select the 'Style guide borders' option. Otherwise, pick 'NewerLook' and choose a colour for the buttons to go when you click on them. I think grey 2 looks best, but if you like the old Impression style you'll prefer orange.

Below that you can pick out a font to use in windows (Desktop Hacker uses outline fonts regardless of whether you're running a Wimp that uses them).

Two fonts are used: one for normal icons and one for 'data' icons (that is, icons containing changeable information, including writable icons). I think it looks good if the 'data' font is an italic or oblique version of the normal font, but your mileage may vary. You can change the size of both the fonts below.

It is also possible to turn off outline fonts, by picking 'System font' from the menus. Due to restrictions in the Wimp, Desktop Hacker won't switch between using fonts and not using fonts until the next time it is loaded, though.

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 [4.5]), 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 specify 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.

Foundation RISCWorld

 Index