mirror of
https://github.com/vxunderground/VX-API
synced 2026-06-06 16:54:55 +00:00
f0b5d2bd5d
Some function names renamed to avoid confusion, some function annotations added.
41 lines
692 B
C++
41 lines
692 B
C++
#include "Win32Helper.h"
|
|
|
|
INT HashStringUnknownGenericHash1A(_In_ PCHAR String)
|
|
{
|
|
PCHAR Pointer;
|
|
INT Generic;
|
|
INT Hash = 0;
|
|
|
|
for (Pointer = String; *Pointer != '\0'; Pointer++)
|
|
{
|
|
Hash = (Hash << 4) + (INT)(*Pointer);
|
|
Generic = Hash & 0xF0000000L;
|
|
|
|
if (Generic != 0)
|
|
Hash = Hash ^ (Generic >> 24);
|
|
|
|
Hash = Hash & ~Generic;
|
|
}
|
|
|
|
return Hash;
|
|
}
|
|
|
|
INT HashStringUnknownGenericHash1W(_In_ PWCHAR String)
|
|
{
|
|
PWCHAR Pointer;
|
|
INT Generic;
|
|
INT Hash = 0;
|
|
|
|
for (Pointer = String; *Pointer != '\0'; Pointer++)
|
|
{
|
|
Hash = (Hash << 4) + (INT)(*Pointer);
|
|
Generic = Hash & 0xF0000000L;
|
|
|
|
if (Generic != 0)
|
|
Hash = Hash ^ (Generic >> 24);
|
|
|
|
Hash = Hash & ~Generic;
|
|
}
|
|
|
|
return Hash;
|
|
} |