From 455cfbe8b7aed7cb5be8e1b9aa1917a9f7d51821 Mon Sep 17 00:00:00 2001 From: Ajax Date: Mon, 25 Jan 2016 11:05:29 +0100 Subject: BasicBlocks: update examples with the new API --- example/disasm/function.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'example/disasm/function.py') diff --git a/example/disasm/function.py b/example/disasm/function.py index a1a9b393..1fe1754f 100644 --- a/example/disasm/function.py +++ b/example/disasm/function.py @@ -1,5 +1,4 @@ from miasm2.arch.x86.disasm import dis_x86_32 -from miasm2.core.asmbloc import bloc2graph # MOV EAX, 0x1337BEEF # MOV ECX, 0x4 @@ -9,10 +8,9 @@ from miasm2.core.asmbloc import bloc2graph # RET shellcode = '\xb8\xef\xbe7\x13\xb9\x04\x00\x00\x00\xc1\xc0\x08\xe2\xfb\xc3' mdis = dis_x86_32(shellcode) -blocs = mdis.dis_multibloc(0) +blocks = mdis.dis_multibloc(0) -for bloc in blocs: - print bloc +for block in blocks: + print block -graph = bloc2graph(blocs) -open('graph.dot', 'w').write(graph) +open('graph.dot', 'w').write(blocks.dot()) -- cgit 1.4.1