Skip to content

Instantly share code, notes, and snippets.

@Sh1n0g1
Created January 25, 2017 11:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sh1n0g1/a44a7c2ec3d79bf92d0d2e3bbd3e8737 to your computer and use it in GitHub Desktop.
Save Sh1n0g1/a44a7c2ec3d79bf92d0d2e3bbd3e8737 to your computer and use it in GitHub Desktop.
Get the matching result of UserDB.txt(PEid) using pefile
import sys
import peutils
import pefile
try:
pe = pefile.PE(sys.argv[1])
signatures = peutils.SignatureDatabase('./sig/userdb.txt')
matches = signatures.match_all(pe, ep_only = True)
if type(matches) is list:
for m in matches:
print m
else:
print "['Unmached']"
except Exception as e:
print e
sys.exit(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment