Files
28Zaaky-khaos-c2/techniques/reflect-dll/tools/gen_hashes.py
T
2026-06-30 18:02:46 +03:00

21 lines
438 B
Python

def rl_hash(s):
h = 0
for c in s.upper():
h = ((h >> 13) | (h << 19)) & 0xFFFFFFFF
h = (h + ord(c)) & 0xFFFFFFFF
return h
apis = [
'kernel32.dll',
'LoadLibraryA',
'GetProcAddress',
'VirtualAlloc',
'VirtualProtect',
'FlushInstructionCache',
'GetCurrentProcess',
]
for a in apis:
key = a.replace('.', '_')
print('#define HASH_%-30s 0x%08XULL // %s' % (key, rl_hash(a), a))