about summary refs log tree commit diff stats
path: root/example/expression/asm_to_ir.py
diff options
context:
space:
mode:
authorCamille Mougey <commial@gmail.com>2017-03-14 08:27:13 +0100
committerGitHub <noreply@github.com>2017-03-14 08:27:13 +0100
commit67117bf808b8348a103f91ca64749d46de3f2db5 (patch)
tree0317a4ba83bd3fe0cc21a89855139271d04af318 /example/expression/asm_to_ir.py
parent5ee794990ff30ca18909dd3815eda26ac267cbf4 (diff)
parentf1a2d7456c8a7482939d43ac5c1d6b829db4cdaf (diff)
downloadfocaccia-miasm-67117bf808b8348a103f91ca64749d46de3f2db5.tar.gz
focaccia-miasm-67117bf808b8348a103f91ca64749d46de3f2db5.zip
Merge pull request #497 from serpilliere/rename_symb
Rename symb
Diffstat (limited to 'example/expression/asm_to_ir.py')
-rw-r--r--example/expression/asm_to_ir.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/example/expression/asm_to_ir.py b/example/expression/asm_to_ir.py
index 2f8999a4..b28f8a81 100644
--- a/example/expression/asm_to_ir.py
+++ b/example/expression/asm_to_ir.py
@@ -3,12 +3,12 @@ from pdb import pm
 from miasm2.arch.x86.arch import mn_x86
 from miasm2.core import parse_asm
 from miasm2.expression.expression import *
-from miasm2.core import asmbloc
+from miasm2.core import asmblock
 from miasm2.arch.x86.ira import ir_a_x86_32
 
 
 # First, asm code
-blocs, symbol_pool = parse_asm.parse_txt(mn_x86, 32, '''
+blocks, symbol_pool = parse_asm.parse_txt(mn_x86, 32, '''
 main:
    MOV    EAX, 1
    MOV    EBX, 2
@@ -25,24 +25,24 @@ loop:
 
 
 symbol_pool.set_offset(symbol_pool.getby_name("main"), 0x0)
-for b in blocs:
-    print b
+for block in blocks:
+    print block
 
 
 print "symbols:"
 print symbol_pool
-patches = asmbloc.asm_resolve_final(mn_x86, blocs, symbol_pool)
+patches = asmblock.asm_resolve_final(mn_x86, blocks, symbol_pool)
 
 # Translate to IR
 ir_arch = ir_a_x86_32(symbol_pool)
-for b in blocs:
-    print 'add bloc'
-    print b
-    ir_arch.add_bloc(b)
+for block in blocks:
+    print 'add block'
+    print block
+    ir_arch.add_bloc(block)
 
 # Display IR
-for lbl, b in ir_arch.blocs.items():
-    print b
+for lbl, irblock in ir_arch.blocks.items():
+    print irblock
 
 # Dead propagation
 open('graph.dot', 'w').write(ir_arch.graph.dot())
@@ -51,6 +51,6 @@ ir_arch.dead_simp()
 open('graph2.dot', 'w').write(ir_arch.graph.dot())
 
 # Display new IR
-print 'new ir blocs'
-for lbl, b in ir_arch.blocs.items():
-    print b
+print 'new ir blocks'
+for lbl, irblock in ir_arch.blocks.items():
+    print irblock