Projects STRLCPY ticofookfook Commits 9d1f8c39
🤬
  • ■ ■ ■ ■ ■ ■
    Shellcode/Bin2shellcode/bin2shell.py
    1  -#!/usr/bin/env python
    2  -import sys
    3  -if __name__ == "__main__":
    4  - if len(sys.argv) < 2:
    5  - print "usage: %s file.bin\n" % (sys.argv[0],)
    6  - sys.exit(0)
    7  - 
    8  - shellcode = "\""
    9  - ctr = 1
    10  - maxlen = 15
    11  - 
    12  - for b in open(sys.argv[1], "rb").read():
    13  - shellcode += "\\x" + b.encode("hex")
    14  - if ctr == maxlen:
    15  - shellcode += "\" +\n\""
    16  - ctr = 0
    17  - ctr += 1
    18  - shellcode += "\""
    19  - print shellcode
    20  - 
Please wait...
Page is in error, reload to recover