Created
March 8, 2024 15:13
-
-
Save usualsuspect/26639fb07a100bdacca92a5e7c3ad403 to your computer and use it in GitHub Desktop.
Unknown 64bit hash used for API lookup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Used in custom import table to lookup APIs via hash instead of name | |
# | |
def hash_str64(s): | |
h = 0x1111111111111111 | |
for i in range(len(s)): | |
h = h*0xABFFF385ABFFF386 | |
h &= 0xFFFFFFFFFFFFFFFF | |
h += s[i] | |
h &= 0xFFFFFFFFFFFFFFFF | |
return h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment