
Originally Posted by
SabreToothLeopard
I'm having a hard time getting this function to work, The code itself works I use it in BO3 but It doesnt seem to work in MWR and yes I've updated the XOR and Mul values using IDA on latest version.
Anyone know what the issue is? did they change the hash function for MWR?
"xor eax, 319712C3h
imul r8d, eax, 0B3CB2E29h"
Code:
unsigned int SL_GetCanonicalString(const char *str)
{
unsigned int result;
if (str)
{
unsigned int hash = (tolower(*str) ^ 0x319712C3) * 0xB3CB2E29;
for (int i = 1; i <= strlen(str); i++)
hash = (tolower(str[i]) ^ hash) * 0xB3CB2E29;
result = hash;
}
else
{
result = 0;
}
return result;
}
What do you mean by it doesn't seem to work, tested it and it produces the correct dvar hash.