forked from DownWithUp/DynamicKernelShellcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdjb2.py
More file actions
15 lines (12 loc) · 474 Bytes
/
djb2.py
File metadata and controls
15 lines (12 loc) · 474 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# From http://www.cse.yorku.ca/~oz/hash.html
import sys
def djb2Hash(string):
hash = 5381
for char in string:
hash = (( hash << 5) + hash) + ord(char)
return(hash & 0xFFFFFFFF) # limit to DWORD size
# main
if (len(sys.argv) == 2):
print(hex(djb2Hash(sys.argv[1])))
else:
print("Example: djb2.py CreateFileA")