Advertisement
wtfbbq

hexify.py

Aug 25th, 2017
2,056
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. #usage python script.py binary > output
  2. #converts ELF to hex
  3. #fixed since LiGhT can't code to save his life
  4.  
  5. import sys,binascii
  6.  
  7. def insert_slashx(string, every=2):
  8.         return '\\x'.join(string[i:i+every] for i in xrange(0, len(string), every))
  9.  
  10. def splitCount(s,count):
  11.         return [''.join(x) for x in zip(*[list(s[z::count]) for z in range(count)])]
  12.  
  13. dogs = '\\x'+insert_slashx(binascii.hexlify(open(sys.argv[1]).read()))
  14. dingle = '" >> .bot\necho -ne "'.join(splitCount(dogs,(128*4))) + '" >> .bot'
  15.  
  16. print 'echo -ne "'+dingle
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement