Author Topic: Final Fantasy VII PSX Saved Game Checksum Problem  (Read 2519 times)

Topher

  • *
  • Posts: 111
    • View Profile
Right, so I've managed to locate the checksum, however I can't seem to rebuild it -- ever. Someone said that it's CRC16 and I need some special thingy. I'm going over the source for Jenova at the moment, but if anyone could help it would be greatly appreciated. Thanks!

-- EDIT --

I've found what I think is the code for the checksum rebuilder. Unfortunately I can't seem to read it too well. If someone could try to translate this into BASIC format, or tell me if that's the wrong part that'd be great.

Code: [Select]
int CFF7File::Checksum( char* b )
{
int i = 0, t, d;
long r = 0xFFFF, len = 4336;
long pbit = 0x8000;

while( len-- ) {
t = b[i++];
r ^= t << 8;
for(d=0;d<8;d++) {
if( r & pbit )
r = ( r << 1 ) ^ 0x1021;
else
r <<= 1;
}
r &= ( 1 << 16 ) - 1;
}
return ~r;
}