How do I find cheats (a crash course)

Read this and see if your question has already been answered

Moderator: Moderators

How do I find cheats (a crash course)

Postby Vampier » 24-Mar-2005 00:36

The screenshots have the function name cheatfind
in them this has been replaced by findcheat


Finding Direct Value Cheats

Finding cheats with the cheat.tcl script is easy. First make sure you have the script in your openmsx\share\scripts folder. If it is not there download it from the CVS on sf.net.

Start your openMSX with a rom inserted, I have chosen Pippols for this little tutorial.

Let's go over the first cheat step by step.

Direct Value Cheats

Pippols starts with 2 lives, which is actually enough to finish the game but we want more lives. So as soon as you see the playfield with our smiling friend pause openMSX with pause (it's next to your scroll lock key) and bring up the console with F10.

Since this is the first time we look for a cheat we have to make a snapshot form the current situation. We do this by typing:

findcheat -start

That was step 1, on to step 2. Finding the address where the amount of lives are stored. We look at the amount of lives and see the number 2. So we have to search for the value of 2. We do this by typing:

findcheat 2

Probably it will tell you that too many values are found. So we continue our search.

Unpause the game with the pause key. And touch an enemy, this might sound cruel but since it is a computer game I assure you the sprite will not feel a thing. After this the amount of lives should have gone down to 1, if not you are playing a cheated version. But for now I assume it is 1.

You guessed it, we pause the game and bring up the openMSX console again with F10. We then type:

findcheat 1

Most likely there are 2 values left. If not you are lucky and will see the address where the lives are stored. But just in case we get our cute little sprite killed again, pause the game and bring up the console again. This time we type:

findcheat 0

Amazing! OpenMSX tells us:0xE050 : 1 -> 0

I will explain this result:
0xE050 is the location where the lives are stored in hexadecimals
1 is the old value
0 is the new value

Now comes the tricky part. Putting more lives into the address we just found. This is easier than it sounds. Let's give our friend 10 lives since he's always smiling. Just make sure you are still in the console and type:

debug write memory 0xE050 10

The results may not show but after our sprite has committed suicide it will become clear he has 9 lives left.

Image

Just to go into technical details really quick. Most games store their values in a hexadecimal way this means if you get strange results applying a value to an address just try to put a hexadecimal value in that address. For example:

debug write memory 0xE050 64 may not give you 64 lives. Try debug write memory 0xE050 0x64 instead.


Comparison search

If you didn't read part one then please read it now.

Comparison search is mostly used when the value you are looking for is not clear or if there is an offset in the value you are trying to find (e.a a value starting with a base of 40 instead of 0)

Comparison search is looking for an address by means of dropping addresses trough logical operations like looking for:

-equal values
-not equal values
-bigger values
-smaller values
-less or equal values
-more or equal values


I will use the power bar of metal gear as an example.

We start off with findcheat -start ,if you do not do this there will be no results. Next we do a search for an equal value since no changes have occurred to the power bar. We do this with findcheat equal

As you see only a few values have been dropped during this search. So let's make some guards angry so you can take some damage. After they have done some damage pause the game and bring up the console. Now type: findcheat smaller

This should reduce the amounts of addresses greatly.

Run the game for a second and do not take any damage. Now pause the game again and type in findcheat equal

Now we are almost there! The best thing to do it to refill your life and type findcheat bigger

Refilling your life can be done by picking up a ratio and using it or using the DS 4 cheat.

Now we probably have only a few values left. Keep on repeating to be hit followed by a findcheat smaller if you heal yourself of course use a findcheat bigger

In the end we should have found 0xC131 as the value where the bar information is stored.

Type : debug write memory 0xC131 64

Image

You will see that the red bar is longer than the original box. It's good practice to not make the value bigger then the original box. So we type : debug write memory 0xC131 48

We now have found our second cheat address.

Operators that can be used are
Code: Select all
findcheat equal
findcheat notequal

findcheat smaller
findcheat bigger

findcheat less
findcheat more

findcheat loe
findcheat moe


moe=more or equal
loe=less or equal

For convenience I have added 2 aliases for 2 operators:
- Less and smaller are the same operator.
- More and bigger are the same operator.

Using expressions

Now we have covered the basics of the cheat finder. Most users should be able to find most cheats with the functions described above. But after a while it gets boring looking for cheats or you just can't find that one cheat you are looking for. That's where expressions come into play.

What is an expression? An expression can be best described as a 'formula' that combines logical operators and 2 values. For example:

oldvalue=newvalue*2 this would translate into findcheat new == (2 * old) for the cheat finder. You are basicly putting TCL into the findcheat procedure.

More options are

findcheat new == (old+2) - find the old value +2
findcheat new == (old-2) -find the old value -2
findcheat new == (old/2) -find half of the old value (use only on multiples of 2)


If this sounds to complicated just watch the following example:

Gather experience of 4 then do a findcheat -start continue gathering experience until you have 8. Now do a findcheat new == (old*2) you could also do a findcheat new == (old+2) since that has the same result though.

Anyway here is an example with YS 1:
Image

this example is the same as described above only I added an extra findcheat new == (old+2) I knew which value it was befor the last search but I just wanted to make sure I had the right value.

Little and Big endians.
not Indians!

With games like YS you have to look for values greater then the 8 bit range. So we have to go to the 16 bit range values. The MSX programmers never really had an agreement on how to use 16bit values so basicly some programmers have stores their values like this.

HH LL for example 34567 is stored as a 2 8 bit pair like hexadecimal 87 07

Let me explain this:

87 hexadecimal = 135 and 135*256=34560 We now miss the 7 so this means we have to add those hexadecimal 07 to the value making it 34560

Unfortunately some programmers use LL HH which means the same 34567 is stored as 07 87.

the only way to find out how a programmer did this is to change the address value before or after the initial value you found.

Image

As you can see I first changed 0xCFC9 to 255 (hexadecimal FF) which brought my experience up to 255. I then changes 0xCFC8 which didn't do much to my experience but it just increased my money. Which was a nice surprise of course but not what I wanted. So I changed 0xCFCA to 255 which changed the value of my experience to 65535 (hexadecimal FF FF)

So I figured out by trial that YS (Falcon) stores is values like LL HH.

Most Konami's will store their values like HH LL so use this tip ;)

Going deeper
findcheat -start (addr > 0xE000) && (new == 42)
look for a value for 42 above address 0xE0000

Anyway I leave it all up to you now

That's it.
Last edited by Vampier on 13-May-2005 23:27, edited 11 times in total.
Vampier
Site Admin
 
Posts: 133
Joined: 05-Feb-2005 23:26
Location: Anaheim CA

Postby AuroraMSX » 24-Mar-2005 09:07

Nice work, Vamp!

-fixed :) thanks

Vamp -

Now, the real question: what happens if the value I want to change sits in some memory mapper block? I haven't seen the cheatfinder code, but I assume it just takes a snapshot of the 64K visible to the Z80 at the time you run cheatfind -start ...
1+1=3 for large values of 1
AuroraMSX
Newbie
 
Posts: 12
Joined: 06-Mar-2005 19:53
Location: Munich

Postby Vampier » 24-Mar-2005 13:53

To be honest... until now all values have been stored in those 64kb.... there hasn't been a cheat I could not find yet.

Anyway:
Image

Until cheats get automated I have writen a script like this:
Code: Select all
proc gradius2 {} {
   debug write memory 0xE200 0x99
   #all weapons
   debug write memory 0xE206 7
   debug write memory 0xE20f 7
   # fake metalion mode
   debug write memory 0xE446 1
   #nice colors
   debug write memory 0xE408 15
   debug write memory 0xE283 14
   #shield 2=on 0=off
   debug write memory 0xE400 2
   #option #1
   debug write memory 0xE33b 2
   debug write memory 0xE40b 2
   debug write memory 0xE410 1
   #option #2   
   debug write memory 0xE420 1
   #Napalm missle (missle #3)
   debug write memory 0xE433 3
   #uplaser
   debug write memory 0xE434 3   
   #nemesis 3 circling options
   debug write memory 0xE439 3   
      
   after frame gradius2
}


Until cheats are supported trough an external program I'll just do it like this :) Nice and simple trough TCL.
Vampier
Site Admin
 
Posts: 133
Joined: 05-Feb-2005 23:26
Location: Anaheim CA

Postby AuroraMSX » 29-Mar-2005 10:06

Vampier wrote:To be honest... until now all values have been stored in those 64kb.... there hasn't been a cheat I could not find yet.


And I do guess you will get about 99% of all cheats this way. Things like score, nr of lives, XP, and whatever are too important to hide in some far away memory block :)
1+1=3 for large values of 1
AuroraMSX
Newbie
 
Posts: 12
Joined: 06-Mar-2005 19:53
Location: Munich

Postby Vampier » 23-Jun-2005 05:27

AuroraMSX wrote:
Vampier wrote:To be honest... until now all values have been stored in those 64kb.... there hasn't been a cheat I could not find yet.


And I do guess you will get about 99% of all cheats this way. Things like score, nr of lives, XP, and whatever are too important to hide in some far away memory block :)


Well Ijust reached my 250'th trainer (1400+ pokes) and I can say that all pokes that I wanted could be found in the first 64Kb :)
Vampier
Site Admin
 
Posts: 133
Joined: 05-Feb-2005 23:26
Location: Anaheim CA

Princess Maker

Postby Gilneas » 22-Jul-2005 19:01

I made a small Princess Maker trainer, just the essentials.

Sets and keeps: gold at 65535 and fatigue at 0.

proc trainer_princess {} {
#inf gold
poke 0x1C96 255
poke 0x1C97 255
#0 fatigue
poke 0x1c3c 0
after time 1 trainer_princess
}
Gilneas
 

Postby Gilneas » 22-Jul-2005 20:03

PS there's a problem with Fatigue, because the stats tend to get moved up a bit.

As it is now, it presumes Fatigue AND ALL OTHER STATS are 1 byte!
Later in the game this changes to 2 bytes for some stats, and the trainer somehow forces fatigue's high byte to 1.

Haven't found a problem with gold yet though.
Gilneas
 

Postby Vampier » 04-Sep-2005 18:17

I just added it to the trainer file :)
Vampier
Site Admin
 
Posts: 133
Joined: 05-Feb-2005 23:26
Location: Anaheim CA

Postby Vampier » 31-Jan-2006 06:26

Let's keep this topic for questions and new ideas. Mars2000 please use the other topic ;)
Vampier
Site Admin
 
Posts: 133
Joined: 05-Feb-2005 23:26
Location: Anaheim CA

Postby mars2000you » 31-Jan-2006 11:45

It seems me a very good idea :)

(But why I don't have thought about that ????)

I think I'll make a similar splitsing on the blueMSX Forum !
Benoît
blueMSX co-developer and Passion MSX co-webmaster
blueMSX- Passion MSX- MSX blue
mars2000you
Crazed cheat master
 
Posts: 462
Joined: 12-Feb-2005 11:50
Location: Namur (Wallonia)


Return to FAQ

Who is online

Users browsing this forum: No registered users and 0 guests

cron