From ccca65f4a3d344959f515b57e50afad9a25a5aa9 Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Sun, 19 Nov 2017 17:20:03 +0100 Subject: [PATCH] 'Executable' --- infernal | 1 + infernal.py => main.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 120000 infernal rename infernal.py => main.py (87%) mode change 100644 => 100755 diff --git a/infernal b/infernal new file mode 120000 index 0000000..798d0f3 --- /dev/null +++ b/infernal @@ -0,0 +1 @@ +./main.py \ No newline at end of file diff --git a/infernal.py b/main.py old mode 100644 new mode 100755 similarity index 87% rename from infernal.py rename to main.py index 9fd8599..6668d3d --- a/infernal.py +++ b/main.py @@ -1,3 +1,4 @@ +#!/usr/bin/python2 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('-o', '--output-file', default='-', help = '.S file to use as output', dest = 'output-file') 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()) # Determine args # registers_init = {} 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['rsp'] = 0 registers_init['rbp'] = Junk.Junk('old bp') + # + for register in REGISTERS: + if args[register]: + registers_init[register[1:]] = args[register][0] # program = ""