diff options
| author | Camille Mougey <commial@gmail.com> | 2018-06-09 09:05:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-09 09:05:05 +0200 |
| commit | 990060f21e515ff1a25246f8fdf0936a97ac698f (patch) | |
| tree | b10543391f9a66ddd5e3f6852c30d96b169b623d /test/arch/x86/sem.py | |
| parent | dadfaabc3fff5edb9bf4ef7e7e8c4cfc4baccb94 (diff) | |
| parent | 61551fa78e9dd22ed1f982b4fe171fd6383c39a6 (diff) | |
| download | miasm-990060f21e515ff1a25246f8fdf0936a97ac698f.tar.gz miasm-990060f21e515ff1a25246f8fdf0936a97ac698f.zip | |
Merge pull request #751 from serpilliere/ExprLabel
Expr Loc
Diffstat (limited to 'test/arch/x86/sem.py')
| -rwxr-xr-x | test/arch/x86/sem.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/test/arch/x86/sem.py b/test/arch/x86/sem.py index b3b7e940..baa05341 100755 --- a/test/arch/x86/sem.py +++ b/test/arch/x86/sem.py @@ -25,11 +25,11 @@ symbol_pool = AsmSymbolPool() m32 = 32 m64 = 64 -def symb_exec(interm, inputstate, debug): +def symb_exec(lbl, interm, inputstate, debug): sympool = dict(regs_init) sympool.update(inputstate) symexec = SymbolicExecutionEngine(interm, sympool) - symexec.run_at(0) + symexec.run_at(lbl) if debug: for k, v in symexec.symbols.items(): if regs_init.get(k, None) != v: @@ -43,18 +43,19 @@ def compute(ir, mode, asm, inputstate={}, debug=False): instr = mn.dis(code, mode) instr.offset = inputstate.get(EIP, 0) interm = ir() - interm.add_instr(instr) - return symb_exec(interm, inputstate, debug) + lbl = interm.add_instr(instr) + return symb_exec(lbl, interm, inputstate, debug) def compute_txt(ir, mode, txt, inputstate={}, debug=False): - blocks, symbol_pool = parse_asm.parse_txt(mn, mode, txt) + asmcfg, symbol_pool = parse_asm.parse_txt(mn, mode, txt) symbol_pool.set_offset(symbol_pool.getby_name("main"), 0x0) - patches = asmblock.asm_resolve_final(mn, blocks, symbol_pool) + patches = asmblock.asm_resolve_final(mn, asmcfg, symbol_pool) interm = ir(symbol_pool) - for bbl in blocks: + lbl = symbol_pool.getby_name("main") + for bbl in asmcfg.blocks: interm.add_block(bbl) - return symb_exec(interm, inputstate, debug) + return symb_exec(lbl, interm, inputstate, debug) op_add = lambda a, b: a+b op_sub = lambda a, b: a-b |