-
Re: Thief 4
Perhaps due to the fact that my project is built on python, an error occurs while executing the line "(CRC << 8) ^ Crc32Table [(buffer [i] ^ (CRC >> 24))]", "tuple index out of range", although this may be due to my carelessness)) In any case, the other day I will try to finalize the code, as I will write the results on the forum.
And another question, why did you decide that the polynomial is "EDB88320" ?? There is an argument of "0x4c11db70".
-
Re: Thief 4
Here is a class you can port and use, this is the only information I have
Code:
class CustomEA
{
private uint[] Table;
private uint Polynomial = 0x4C11DB70;
private uint InitialValue = 0xDEADBEEF;
public CustomEA()
{
//generate table
Table = new uint[256];
for (int i = 0; i < Table.Length; i++)
{
uint value = (uint)i;
for (int x = 8; x > 0; x--)
{
value = (((value & 1) == 1) ? ((value >> 1) ^ Polynomial) : value >> 1);
}
Table[i] = value;
}
}
public uint Compute(byte[] buffer, int index, int count)
{
uint result = ~InitialValue;
for (int i = index; i < count; i++)
{
result = ((result << 8) ^ Table[(byte)((buffer[i] ^ (result >> 24)) & 0xFF)]);
}
return ~result;
}
}