Skip to content

Commit 2e24232

Browse files
committed
We used to have this
1 parent ee3f735 commit 2e24232

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

shellcodeAsArray/sa.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env python
2+
from isis import chunk
3+
4+
from sys import argv
5+
if len(argv)<2:
6+
print 'Usage: {} <shellcode> [<bytes/line>]'.format(argv[0])
7+
exit(1)
8+
9+
LINE_LEN=15
10+
if len(argv)>2:
11+
LINE_LEN=int(argv[2])
12+
13+
shellcode = file(argv[1]).read()
14+
hex_bytes=[i.encode('hex').zfill(2) for i in shellcode]
15+
16+
print 'shellcode = (',
17+
for i in chunk(hex_bytes, LINE_LEN):
18+
print '"',
19+
print r'\x'+r'\x'.join(i),
20+
print '"'
21+
22+
print ')'
23+
24+

0 commit comments

Comments
 (0)