Skip to content

Instantly share code, notes, and snippets.

@jseidl
Created November 12, 2014 03:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jseidl/a40c6de8e5149fea486f to your computer and use it in GitHub Desktop.
Save jseidl/a40c6de8e5149fea486f to your computer and use it in GitHub Desktop.
Calculates sll1AddHash32 hashes
#!/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 <jseidl@wroot.org>
"""
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