Created
November 12, 2014 03:37
-
-
Save jseidl/a40c6de8e5149fea486f to your computer and use it in GitHub Desktop.
Calculates sll1AddHash32 hashes
This file contains 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
#!/usr/bin/env python | |
""" | |
Calculate sll1AddHash32 hashes | |
based on pseudocode from https://github.com/mandiant/Reversing/blob/master/shellcode_hashes/make_sc_hash_db.py | |
@author Jan Seidl <[email protected]> | |
""" | |
import sys | |
if len(sys.argv) != 2: | |
print "Please supply name" | |
sys.exit(1) | |
dllname = sys.argv[1] | |
acc = 0 | |
for c in dllname: | |
acc = acc + (ord(c) | 0x60) | |
acc = acc << 1 | |
print "0x%08x" % acc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment