diff options
| -rw-r--r-- | example/asm_x86.py | 3 | ||||
| -rw-r--r-- | miasm2/arch/x86/disasm.py | 11 |
2 files changed, 12 insertions, 2 deletions
diff --git a/example/asm_x86.py b/example/asm_x86.py index 3637f9ed..fc165da4 100644 --- a/example/asm_x86.py +++ b/example/asm_x86.py @@ -27,6 +27,9 @@ main: SUB ESP, 0x100 MOV EAX, 0x1337 LEA ESI, DWORD PTR [mystr] + CALL toto +toto: + POP EDI MOV ESP, EBP POP EBP RET diff --git a/miasm2/arch/x86/disasm.py b/miasm2/arch/x86/disasm.py index 7185a973..e0841041 100644 --- a/miasm2/arch/x86/disasm.py +++ b/miasm2/arch/x86/disasm.py @@ -7,7 +7,14 @@ def cb_x86_callpop(mn, attrib, pool_bin, cur_bloc, offsets_to_dis, symbol_pool): """ 1000: call 1005 1005: pop + + Will give: + + 1000: push 1005 + 1005: pop + """ + if len(cur_bloc.lines) < 1: return l = cur_bloc.lines[-1] @@ -19,8 +26,8 @@ def cb_x86_callpop(mn, attrib, pool_bin, cur_bloc, offsets_to_dis, symbol_pool): if dst.name.offset != l.offset + l.l: return l.name = 'PUSH' - # cur_bloc.bto.pop() - cur_bloc.bto[0].c_bto = asm_constraint.c_next + cur_bloc.bto = set() + cur_bloc.add_cst(dst.name.offset, asm_constraint.c_next, symbol_pool) cb_x86_funcs = [cb_x86_callpop] |