Qhimm.com Forums

Miscellaneous Forums => Scripting and Reverse Engineering => Topic started by: burekfust on 2007-07-05 04:08:12

Title: Generating FF7 save data checksum
Post by: burekfust on 2007-07-05 04:08:12
So I've been wanting to make a save file editor for FFVII (Playstation version)
and I needed to know something and I figured this was the place to ask.
(Since you guys are pretty much the experts on this game)

I found this wonderful page here... http://wiki.qhimm.com/FF7/Savemap
which is great, by the way, and I started digging into my save file.
The problem for me comes with generating the checksum at the top.
I tried generating the different standard checksums for my save block,
which goes to 4339/10F3 (the last byte), I believe...
but my results don't match the one in the data.

I don't know much about checksums and I was hoping you guys might help me with generating one.
Like, for example, what algorithm does the game use?
And am I generating the right blocks of data?
Title: Re: Generating FF7 save data checksum
Post by: dziugo on 2007-07-05 11:49:26
Link (http://forums.qhimm.com/index.php?topic=4211.msg60545#msg60545).
Title: Re: Generating FF7 save data checksum
Post by: burekfust on 2007-07-05 17:44:37
Hi! I see that you have a checksum calculator there.
Unfortunately I don't know the language. (Me is stupid :-()
I was hoping that I could be given some plain English specifics.
Thanks a lot!
Title: Re: Generating FF7 save data checksum
Post by: ice_cold513 on 2007-07-05 19:16:24
Dziugo

Thank you, never know i might need this some day.
Title: Re: Generating FF7 save data checksum
Post by: burekfust on 2007-07-07 03:02:06
Well, I don't know how that code works, so I'll try something myself...
Maybe I'll change 99% of my save data bytes to zeros and then use a gameshark cheat to bypass the checksum error and then once my save is loaded I'll save the game again and see how it generates the checksum based on the bytes that aren't zeros.
But I have a feeling that that won't give me an easy answer either.
There's probably unobvious math in there, besides addition, that I'll have to figure out.
Title: Re: Generating FF7 save data checksum
Post by: dziugo on 2007-07-07 07:59:52
Which (programming) language do you understand, then?
Title: Re: Generating FF7 save data checksum
Post by: burekfust on 2007-07-07 08:09:52
Well, what language I'll use isn't important since I'm not asking for code.
I'm just wondering how the game calculates the checksum.
Like, it adds up all the bytes, adds 100, divides it by 32, yada yada etc....
Title: Re: Generating FF7 save data checksum
Post by: dziugo on 2007-07-07 09:39:37
More like shifts(<<), ands(&), xors(^), yada yada etc...
Title: Re: Generating FF7 save data checksum
Post by: burekfust on 2007-07-07 09:57:40
I see that I have to figure everything out myself.
I'll just let myself out.
Title: Re: Generating FF7 save data checksum
Post by: Cyberman on 2007-07-09 23:25:29
I see that I have to figure everything out myself.
I'll just let myself out.
This is why the language is important because the CRC calculator is based on C or C++ I think, actually I recommend you look up CRC calculations to find out about it.
Title: Re: Generating FF7 save data checksum
Post by: dziugo on 2007-07-10 07:33:44
I asked for the language, because it's usually easier to understand an algorithm analysing the code written in language you know + you won't have to convert it from pseudo-code later (I highly doubt, that you want to calculate the checksum on a piece of paper).