OK, I was unable to make the algorithm for CRC32 you posted work.
In case you, or anyone else, is in burning need of this routine, I am posting the code I found posted on the internet (as modified by me) that will calculate the CRC32 the same way that the game and SimPE calculate it. It ain't pretty, and I didn't worry about optimizing it because I use it once per bone for exporting animation data. The two lines commented out are for a bit reflection routine I didn't include, or need:
unsigned long crcbitbybitfast(unsigned char* p) {
// fast bit by bit algorithm without augmented zero bytes.
// does not use lookup table, suited for polynom orders between 1...32.
unsigned long i, j, c, bit;
unsigned long crc = 0xffffffff;
unsigned long crchighbit = 0x80000000;
unsigned long polynom = 0x04c11db7;
unsigned long crcxor = 0;
unsigned long crcmask = 0xFFFFFFFF;
unsigned long order = 32;
unsigned long len;
len=strlen(p);
for (i=0; i<len; i++) {
c = (unsigned long)*p++;
// if (refin) c = reflect(c, 8);
for (j=0x80; j; j>>=1) {
bit = crc & crchighbit;
crc<<= 1;
if (c & j) bit^= crchighbit;
if (bit) crc^= polynom;
}
}
// if (refout) crc=reflect(crc, order);
crc^= crcxor;
crc&= crcmask;
return(crc);
}