diff options
| author | Ajax <commial@gmail.com> | 2016-01-25 11:05:29 +0100 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2016-01-26 17:09:18 +0100 |
| commit | 455cfbe8b7aed7cb5be8e1b9aa1917a9f7d51821 (patch) | |
| tree | 58c354de7afe7b4b0ca6af923616941ba9c2e79e /example/disasm/function.py | |
| parent | 01b1f292c84d4cbda38b6c308fc7b1af52595cec (diff) | |
| download | miasm-455cfbe8b7aed7cb5be8e1b9aa1917a9f7d51821.tar.gz miasm-455cfbe8b7aed7cb5be8e1b9aa1917a9f7d51821.zip | |
BasicBlocks: update examples with the new API
Diffstat (limited to 'example/disasm/function.py')
| -rw-r--r-- | example/disasm/function.py | 10 |
1 files changed, 4 insertions, 6 deletions
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()) |