Skip to content

Commit 8f1aaf0

Browse files
authoredJun 4, 2018
Cleaned up code a bit because blocksize is not needed
1 parent 46f6023 commit 8f1aaf0

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed
 

‎js_shellcode.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,16 @@ def swap32(i):
77

88
parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter)
99
parser.add_argument("file", type=argparse.FileType('rb'), help="specify binary file")
10-
parser.add_argument("buffer", type=str, help="name of buffer to write shellcode to")
11-
parser.add_argument("-b", "--blocksize", type=int, required=False, default=30000, help="specify block size")
10+
parser.add_argument("-b", "--buffer", type=str, required=False, default='addr', help="name of buffer to write shellcode to")
1211
parser.add_argument("-o", "--output", type=str, required=False, default='stdout', help="output file")
1312
args = parser.parse_args()
1413
if args.output == "stdout":
1514
from sys import stdout as output
1615
else:
1716
output = open(args.output,'w')
18-
assert args.blocksize > 0, "block size must be positive"
1917

20-
block = args.file.read(args.blocksize)
2118
hexStr = ""
22-
for blockOffset,ch in enumerate(block):
19+
for blockOffset,ch in enumerate(args.file.read()):
2320
if isinstance(ch,int):
2421
o = ch
2522
else:

0 commit comments

Comments
 (0)