Checksum

  • Thread starter Thread starter Evil Peer
  • Start date Start date
Status
Not open for further replies.
E

Evil Peer

Guest
I'm interested in editing files for other Square games, and I was wondering if anyone knew if they all used a common checksum function.

I've looked at the source for both Griever and Jenova, but I don't know assembly well enough to make out what's going on in Griever, and Jenova's one letter variables are a little hard to follow.  I can sort of make out what's happening on each line, but I'm a little fuzzy on the bigger picture.

---Evil Peer
 
Ant's right. If you check Qhimm's Site, he even says they are built using "Visual Studio 6.0" which happens to have several languages, but it's generally known that Qhimm programs using C++.

Sephiroth 3D

"I don't understand..." "You don't have to understand." - Final Fantasy: The Spirits Within

Sephiroth 3D.com
[email protected]
 
Right, but the checksum routine is done in Assembler, or at least it looks to me like Assembler.
 
The checksum part was (re)writen in assembler to opimize it, so it'd be faster.

---Evil Peer
 
The checksum routine in Griever *is* made in assembler. There, should be no doubt about it now.
 
ohhhh you guys got told! :) can you program assembly in visual studio?
 
Really? Must've missed that.

And yes, of course you can program assembly in VS. Most powerful languages let you use inline assembler. It's hardly ever needed though; on modern CPU's there's *rarely* a need for it.
 
In fact you'd be hard-pressed to optimize better than the compiler (except when using MMX and other extensions).

And about "powerful languages"...I guess you don't think C and C++ is powerful then because it does NOT allow it (except through compiler extensions that vary between compilers, and then you're not really dealing with C or C++ any longer). I think this is a good thing though.

(Going away for some days now so I won't reply more to this)
 
Well, so stuff varies between compilers; so do a lot of things in C++. I remember looking at the IOCCC entries, and some guys mentioned that their entries were specifically compiler-testers: they conformed perfectly to all the C++ specs but *no* compiler dealt with them properly, or sometimes even compiled them at all. So the fact that C++ has no "standard" way of using assembler doesn't mean it's not powerful ... no compiler conforms to the specs totally anyway, last time I heard. You often need compiler specific options with many languages, C++ included ... so what?

But yes, you often are hard pressed to optimise better than the compiler nowadays.
 
It looks like both FF7 and FF8 use CRC-CCITT.  The polynomial corresponds to the 0x1021 you'll find in both Griever and Jenova.

Based on the assumption that all of their games use this polynomial, I am going to investigate some of their other games.

---Evil Peer
 
There was something odd with FF8's checksum routine, something different from FF7. First I tried to use Jenova's checksum routine on FF8's save files, but with flawed results. Then I looked at FF8's code and made an updated version, but still nothing. In the end, I had to rewrite the routine from scratch to match FF8's system.

Now, the odd thing is that I ended up with the same routine I started with.  :-?
 
Very alike, as in I couldn't really find the difference from the one I started with, aside from the obvious fact that it worked.
 
Qhimm, I've got a wild guess.  Could it have something to do with the difference in file extensions?  I mean, when you tried using Jenova to open the FF8 save files, could the program have looked at the file extension, then said, "Uh, no, this won't work"?

Or would that even apply?  It sounds like you're mainly dealing with just the raw data, so I don't know if the file extension would have any influence on Jenova.
 
I don't know how I should put this without being rude... I'm afraid the problem is at quite a higher level of technical thinking than you speak of.  :D
 
Wild guess: Qhimm's savegame editor edits the savegames hexidecimally, right?
 
Offhand, the only difference I can think of is which portions of the data are covered by the checksum.  FF7 and 8 checksumed different portions.

The game I'm currently investigating is Legend of Mana (I hate forging).  While I might be a bit off, my preliminary guess is that there are two (three?) checksums in the save file, but unlike FF8, they are different, covering different portions of data.

I might be wrong though, I'm still mapping all of the data to in game stats.  What's going to be really fun is trying to figure out if they checksum the data before they write it out to file, and then write it differently (most of the data is in reverse-byte-order).

--Evil Peer
 
Well, that would explain why Bleem! can't understand the way Legend of Mana and Final Fantasy IX saves the data to the "memory card" that it emulates.

It sounds like it's a "one size doesn't fit everybody" type of thing for Squaresoft games.
 
Status
Not open for further replies.
Back
Top