about summary refs log tree commit diff stats
path: root/example/disasm_02.py
diff options
context:
space:
mode:
authorCamille Mougey <camille.mougey@cea.fr>2015-01-08 17:07:17 +0100
committerCamille Mougey <camille.mougey@cea.fr>2015-01-23 17:24:42 +0100
commitd0a21b0738db10c38d20bb9ebeafd5fb8e72fc3a (patch)
tree3448bbcdec34ae822fc872d4fa9e50d0adb88704 /example/disasm_02.py
parentb139ca5b454f442eeffe2bc18cb6aa0f3391049b (diff)
downloadmiasm-d0a21b0738db10c38d20bb9ebeafd5fb8e72fc3a.tar.gz
miasm-d0a21b0738db10c38d20bb9ebeafd5fb8e72fc3a.zip
Example/Disasm_02: Comment and expand variables names
Diffstat (limited to 'example/disasm_02.py')
-rw-r--r--example/disasm_02.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/example/disasm_02.py b/example/disasm_02.py
index 5bfd77de..0d443c26 100644
--- a/example/disasm_02.py
+++ b/example/disasm_02.py
@@ -1,13 +1,18 @@
 from miasm2.arch.x86.disasm import dis_x86_32
 from miasm2.core.asmbloc import bloc2graph
 
-
-s = '\xb8\xef\xbe7\x13\xb9\x04\x00\x00\x00\xc1\xc0\x08\xe2\xfb\xc3'
-mdis = dis_x86_32(s)
+# MOV        EAX, 0x1337BEEF
+# MOV        ECX, 0x4
+# loop:
+# ROL        EAX, 0x8
+# LOOP       loop
+# 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)
 
-for b in blocs:
-    print b
+for bloc in blocs:
+    print bloc
 
-g = bloc2graph(blocs)
-open('graph.txt', 'w').write(g)
+graph = bloc2graph(blocs)
+open('graph.txt', 'w').write(graph)