Homebrew Save Data Checksum Help

  • Thread starter Thread starter Scarlet
  • Start date Start date
  • Views Views 2,963
  • Replies Replies 1

Scarlet

Editorial Aspirant
Editorial Team
GBAtemp Patron
Joined
Jan 7, 2015
Messages
6,638
Solutions
2
Reaction score
19,435
Trophies
5
Location
Middleish South-Left
Website
scarlet.works
XP
28,314
Country
United Kingdom
Hey all,

I've been looking at creating a save editor for the DS Harvest Moon games, but I've not messed with checksums before. In looking around, I found this and thought I might be able to do it myself. Sadly, I'm coming up blank. In the save file for Harvest Moon DS for Girl (the JP ver of HMDS Cute), the first line looks something like this.
Code:
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
AA AA BB BB CC CC DD DD EE EE FF FF -- -- -- --

A = File 1 exists? 01 00 if yes, 00 00 if no
B = File 2 exists? 01 00 if yes, 00 00 if no
C = File 1 checksum
D = File 2 checksum (00 00 if file doesn't exist)
E = Always 4B 42
F = Full save checksum?
I've messed with changing one value at a time in-game and seeing if it affects the values in any logical way, but I just can't figure it out. I made ten different saves, altering only the money at 0x4FC, but there's no kind of logical pattern. Comparing each of these files, the only changes are in the File1 value and the FullFile value, aside from the money.
Code:
##   File1   FullFile
00 = C5B7   4B93
01 = 2071   34BE
02 = 4E38   B5C9
03 = ABFE   CAE4
04 = 92AA   F724
05 = 776C   8809
06 = 1925   097E
07 = FCE3   7653
08 = 6B8D   72FE
09 = 8E4B   0DD3
Am I going about this the wrong way? And if so, can anybody point me to the right way? I've attached the save files should anybody be interested. Thanks in advance.
 

Attachments

That link is a nice link for what it is but not quite sure it is what you are looking for.

Some saves alternate between one or more slots as a kind of wear levelling, pokemon being among the more notorious for this but harvest moon would also be a good candidate (few items changing per average save would lead to a lot of writes to the same sectors). Said thing might also trouble your compare checks.

Also there is another way.
Figure out the part of the game that checks the save checksum and nuke that -- it can be the most complicated multi hash function HMAC setup in the world but if you change the sequence of instructions which decide "is hash good, if yes proceed to load, if no then say that" to "is hash good, if yes proceed to load, if no proceed to load"* then you have bypassed the hash protection and get to do the rest of making a save editor. Once you have done all the tedious stuff, got familiar with the necessary coding, familiar with debugging emulators you can then approach the checksum again with some more knowledge and confidence. Failing that looking at an otherwise fully working save editor is far more likely to elicit some help than the almost nothing you have here, though that is not to say someone else won't come along on this site and help you.

*probably not how it will appear in game. More likely it will be a simple compare, you change the resulting failure jump to the success jump or lose the compare entirely to a NOP (no-operation, an operation that does nothing of consequence like mov r1,r1 which just copies register 1 into register 1 and thus a favourite of ROM hackers looking to lose an instruction without having to worry about all the code following it) and you have your hack.
 
  • Like
Reactions: Scarlet

Site & Scene News

Popular threads in this forum