1
0

'Executable'

This commit is contained in:
Jon Michael Aanes 2017-11-19 17:20:03 +01:00
parent f7aeb27e6e
commit ccca65f4a3
2 changed files with 9 additions and 2 deletions

1
infernal Symbolic link
View File

@ -0,0 +1 @@
./main.py

10
infernal.py → main.py Normal file → Executable file
View File

@ -1,3 +1,4 @@
#!/usr/bin/python2
import sys import sys
@ -13,16 +14,21 @@ def parse_args ():
parser.add_argument('-i', '--input-file', default='-', help = '.S file to use as input', dest = 'input-file') parser.add_argument('-i', '--input-file', default='-', help = '.S file to use as input', dest = 'input-file')
parser.add_argument('-o', '--output-file', default='-', help = '.S file to use as output', dest = 'output-file') parser.add_argument('-o', '--output-file', default='-', help = '.S file to use as output', dest = 'output-file')
for register in REGISTERS: for register in REGISTERS:
parser.add_argument('--'+register[1:], nargs = 1, type = int, default = [Junk.Junk()], dest = register) parser.add_argument('--'+register[1:], nargs = 1, type = int, default = None, dest = register, help = 'the initial value of the register')
args = vars(parser.parse_args()) args = vars(parser.parse_args())
# Determine args # # Determine args #
registers_init = {} registers_init = {}
for register in REGISTERS: for register in REGISTERS:
registers_init[register[1:]] = args[register][0] registers_init[register[1:]] = Junk.Junk('prev '+register)
#
registers_init['rip'] = 0 registers_init['rip'] = 0
registers_init['rsp'] = 0 registers_init['rsp'] = 0
registers_init['rbp'] = Junk.Junk('old bp') registers_init['rbp'] = Junk.Junk('old bp')
#
for register in REGISTERS:
if args[register]:
registers_init[register[1:]] = args[register][0]
# #
program = "" program = ""