unsigned long _STRING_GetHashValue(char* Str) {
unsigned long Hash;
__asm {
push ebp
mov eax, Str
mov ebp, eax
push esi
push edi
mov edi, ebp
or ecx, 0FFFFFFFFh
xor eax, eax
repne scasb
not ecx
dec ecx
mov esi, ecx
mov eax, ecx
sar esi, 6
inc esi
test ecx, ecx
jle short loc_482B9D
push ebx
loc_482B80: ; CODE XREF: _STRING_GetHashValue+3A?j
mov edx, eax
mov edi, eax
shl edx, 5
sar edi, 2
xor ebx, ebx
add edx, edi
mov bl, [ebp+0]
sub ecx, esi
add edx, ebx
xor eax, edx
inc ebp
test ecx, ecx
jg short loc_482B80
pop ebx
loc_482B9D: ; CODE XREF: _STRING_GetHashValue+1D?j
pop edi
pop esi
pop ebp
mov Hash, eax
}
return Hash;
}
I will be very happy if you help me. I really need to translate this to c++ code and make the opposite function.