Reversed from Halo CE 1.08 using OllyDbg, IDA Pro, Hexrays, and msdn.
Calculates a Crc32 from the inputed buffer, the buffer length, and the current Crc32 value. It first checks if a Crc32 lookup table has been created, then uses it in calculating the Crc32.
Code://----- (004D37E0) -------------------------------------------------------- bool *Crc32TableInit = (bool *)0x006B4CA0; DWORD *Crc32Table = (DWORD *)0x00652968; // 256 dwords void CalcCrc32(DWORD *Crc32, constchar *Buffer, DWORD Length) { DWORD Crc = *Crc32; if(!*Crc32TableInit) { InitCrc32Table(Crc32Table); *Crc32TableInit = true; } for(DWORD i = 0; i < Length; i++) { Crc = (*Crc32 >> 8) ^ Crc32Table[(*Buffer++ ^ *Crc32) & 0xFF]; } *Crc32 = Crc; }






Bookmarks