Karatorian
Guest
|
 |
« Reply #3 on: April 05, 2008, 12:09:19 pm » |
|
One thing you can try can try that which may work if the checksum is a very simple one is to reduce another value by the same ammount that you increase the value you wish to edit. If the checksum is actually a simple checksum and not some sort of more advanced error detection algorithm, it should work.
Of course, this isn't a solution for being able to edit things at will, but it can be used. For instance, in some games, you can edit your current HP down and put the increase into permanant stats. Another thing you may be able to do is to move values from the low byte to the high byte of multibyte values. For example, before I learned how to fix the checksum of Final Fantasy saves, I was able to hack in a lot of gold by reducing the low byte and incresing the high byte by the same ammount.
Of course, what you really want to do is locate the checksum and figure out it's algorithm. There are two ways to go about doing this. The first is by using code tracing or debugging or disassebly (whichever you prefer) to locate the save game and/or load game routines. This is proabably the easiest way if you have the skills and are already familiar with the game's codebase.
The other method is basically brute force. You can attempt to find the location of the checksum by making a series of saves and comparing them. First make one save and move it so it doesn't get overwritten. Then load that save into the game, change some value, and save the game again. Try to change as little as possible. How one does this depends on the exact details of the game you're hacking. But try to keep as much the same as you can. For example, save in the same location. In fact, don't even move if you can alter the game state without doing so. (Like drop an item from your inventory or something).
Once you've got two or more similar, but slightly different saves, start comparing them. Hopefully you'll already know where the value you changed is stored, so you can ignore that. Look for other values that changed. This will give you a list of places to investigate. If the addition and subtraction method I mentioned above works, it will help a lot. Going through the changed values, you would be able to edit them and reload the ROM and see what changed, so you can tell what is stored there. As you eliminate addresses, one of them should be the checksum.
If the addition and subtraction method doesn't work, it'll be more complicated, but it's still workable.
As mentioned above, some games only checksum a portion of the save state. You can test for this by seeing if there are any parts of the save you can edit without corrupting it. If you find any such areas, you can narrow in on the exact checksummed region by progressively moving the edited area until you get corruption. Then you move back until it works again. The fastest way to do this is to move in large steps one direction until you've had a state change (uncorrupted to corrupted or vice-versa) and then start moveing the other way in smaller steps. Keep doing this until you narrow down exactly the byte range covered by the checksum.
If only a portion of the save is checksummed, this will help out in your search for the checksum as you can ignore any changes outside the checksummed areas.
Once you've located the checksum, you'll have to puzzle out the algorithm. There are a variety of error correction algorithms, but the basic ones consist of adding together all the checksummed values with some sort of truncation or modulo arithmetic. More complex versions will require some research. Once you've done that, it'll be a simple matter of programming a small utility to fixup the save.
Best of luck.
|