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