Skip to content

Instantly share code, notes, and snippets.

@crashish
Created September 30, 2013 21:46
Show Gist options
  • Save crashish/6770773 to your computer and use it in GitHub Desktop.
Save crashish/6770773 to your computer and use it in GitHub Desktop.

Revisions

  1. crashish created this gist Sep 30, 2013.
    13 changes: 13 additions & 0 deletions peid2pebear.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    import textwrap, re, urllib

    parse_sig = re.compile(
    '\[(.*?)\]\s+?signature\s*=\s*(.*?)(\s+\?\?)*\s*ep_only\s*=\s*(\w+)(?:\s*section_start_only\s*=\s*(\w+)|)', re.S)
    sig_f = urllib.urlopen('userdb.txt')
    sig_data = sig_f.read()
    sig_f.close()
    sigs = parse_sig.findall(sig_data)
    for packer_name, signature, superfluous_wildcards, ep_only, section_start_only in sigs:
    print packer_name
    print len(signature.replace(' ',''))/2
    print textwrap.fill(signature,48)
    print ''