The K Desktop Environment

Next Previous Table of Contents

4. Examples

Here's a few step by step examples to get you started.

4.1 Fun with Ksnake

Ksnake is KDE's snake race game. Ksnake is my favorite game to use for testing Kcheat with as there's lots of fun stuff we can do.

Score enhancements

First, attach to Ksnake (process->attach). Now we search (process->search). The type is integer, unaligned searches is unchecked, and type your current score into the value to search for box. (Your current score in Ksnake is displayed in the upper right of the Ksnake window). Click on 'new search'. You probably have a bunch of addresses, so let's prune that search. Play Ksnake a bit more to change your score. Once it has changed, put that new value into the value to search for box and click 'prune search'. Keep pruning until you have only 1 address left. If you can't get down to 1 address, that's ok. Ksnake often has 2 addresses for the score as the value is left on the stack. If you are on an x86 system, Just pick the lower numbered address (stack values start at 0xbffffff). Double click on the address you want to keep to keep it and click 'ok'.

We now have the address in our main Kcheat window, so let's name it. Click the address and change its properties (address->properties). Replace the 'name' field with 'Score' and click 'ok'. Turn on auto-update (address->auto update) so Kcheat can display the current score.

Now for some fun, let's change the value. Double click on your new 'Score' item and set the value to 999. Note that Ksnake won't show the new value until the next time it updates the score display. Have your snake grab and apple and notice your new score. :)

Too many balls!

Let's try something more.. fun. :) Follow the procedure we described in the first section, but this time we're going to search for a different value. Look at Ksnake's options->balls menu. It lets you select a number of balls from 0->3. How boring! We Ksnake masters know Ksnake doesn't get really exciting until you have at least 99 balls. How can we correct this oversight? First, set the number of balls to 3. Now use Kcheat to search for an integer, 3. You'll get lots of results. Now we need to prune the search, so set Ksnake's ball count to 2, set Kcheat's value to search for to 2, and prune. Keep pruning like this until you have one address. You might wind up with 2 addresses that match, if so, keep them both (only one is probably the one we are interested in, one is just program leftovers), we can figure out which is the real one through experimentation. Once you have determined which address handles balls, set it to 99 and start a new game. You can almost hear the snake scream. :)

Next Previous Table of Contents