diff options
| author | Florent <florent.monjalet@gmail.com> | 2015-10-30 08:56:49 +0100 |
|---|---|---|
| committer | Florent <florent.monjalet@gmail.com> | 2015-10-30 08:56:49 +0100 |
| commit | 9d23ef12b2c41c1c826e1108dd11e651d12a473e (patch) | |
| tree | ed0783670ca655d9b50ac2c739d9ef19e3599794 /example | |
| parent | fefb609f7ed8267815e3ab4b7467a8fada7040b8 (diff) | |
| parent | 7bd9f72a3c3c48c246a6d4917bcfaa0075fd0860 (diff) | |
| download | miasm-9d23ef12b2c41c1c826e1108dd11e651d12a473e.tar.gz miasm-9d23ef12b2c41c1c826e1108dd11e651d12a473e.zip | |
Merge pull request #245 from serpilliere/fix_parse_asm
Fix parse asm
Diffstat (limited to 'example')
| -rw-r--r-- | example/asm/shellcode.py | 6 | ||||
| -rw-r--r-- | example/asm/simple.py | 4 | ||||
| -rw-r--r-- | example/expression/asm_to_ir.py | 1 | ||||
| -rw-r--r-- | example/expression/solve_condition_stp.py | 2 |
4 files changed, 6 insertions, 7 deletions
diff --git a/example/asm/shellcode.py b/example/asm/shellcode.py index 3f3aa877..945cac8c 100644 --- a/example/asm/shellcode.py +++ b/example/asm/shellcode.py @@ -76,14 +76,14 @@ if args.PE: pe.DirImport.get_funcvirt('MessageBoxA')) # Print and graph firsts blocs before patching it -for bloc in blocs[0]: +for bloc in blocs: print bloc -graph = asmbloc.bloc2graph(blocs[0]) +graph = asmbloc.bloc2graph(blocs) open("graph.txt", "w").write(graph) # Apply patches patches = asmbloc.asm_resolve_final(machine.mn, - blocs[0], + blocs, symbol_pool, dst_interval) if args.encrypt: diff --git a/example/asm/simple.py b/example/asm/simple.py index 1929961f..45954f91 100644 --- a/example/asm/simple.py +++ b/example/asm/simple.py @@ -27,10 +27,10 @@ loop: symbol_pool.set_offset(symbol_pool.getby_name("main"), 0x0) # Spread information and resolve instructions offset -patches = asmbloc.asm_resolve_final(mn_x86, blocs[0], symbol_pool) +patches = asmbloc.asm_resolve_final(mn_x86, blocs, symbol_pool) # Show resolved blocs -for bloc in blocs[0]: +for bloc in blocs: print bloc # Print offset -> bytes diff --git a/example/expression/asm_to_ir.py b/example/expression/asm_to_ir.py index 942e5e19..19ffd659 100644 --- a/example/expression/asm_to_ir.py +++ b/example/expression/asm_to_ir.py @@ -23,7 +23,6 @@ loop: RET ''') -blocs = blocs[0] symbol_pool.set_offset(symbol_pool.getby_name("main"), 0x0) for b in blocs: diff --git a/example/expression/solve_condition_stp.py b/example/expression/solve_condition_stp.py index a25a7072..385c5d78 100644 --- a/example/expression/solve_condition_stp.py +++ b/example/expression/solve_condition_stp.py @@ -170,7 +170,7 @@ if __name__ == '__main__': ''') - b = blocs[0][0] + b = blocs[0] print b # add fake address and len to parsed instructions for i, l in enumerate(b.lines): |