diff options
| author | serpilliere <devnull@localhost> | 2014-07-21 11:38:01 +0200 |
|---|---|---|
| committer | serpilliere <devnull@localhost> | 2014-07-21 11:38:01 +0200 |
| commit | 0c2b5ebcf567c4ef7649930d3f72a11677220de6 (patch) | |
| tree | 83e7e4d81266fd78c253624f2aaaf9349fadb987 | |
| parent | 2342e243c9a5ef398c0f4faa05da9439e2e4949a (diff) | |
| download | miasm-0c2b5ebcf567c4ef7649930d3f72a11677220de6.tar.gz miasm-0c2b5ebcf567c4ef7649930d3f72a11677220de6.zip | |
X86; fix disasm cb transformation call/pop
| -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] |