about summary refs log tree commit diff stats
path: root/example/expression/asm_to_ir.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2020-08-22 12:47:01 +0200
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2020-08-31 07:50:01 +0200
commit80e40a3d2ca735db955807ad0605b43ca22e4e35 (patch)
tree4d41d7b53565f833444d3520eb22eed3e8bf26f1 /example/expression/asm_to_ir.py
parent5d8beb271d9890241a6d61dd476fab26ca37ebbf (diff)
downloadfocaccia-miasm-80e40a3d2ca735db955807ad0605b43ca22e4e35.tar.gz
focaccia-miasm-80e40a3d2ca735db955807ad0605b43ca22e4e35.zip
Avoid generate default locationdb
Diffstat (limited to 'example/expression/asm_to_ir.py')
-rw-r--r--example/expression/asm_to_ir.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/example/expression/asm_to_ir.py b/example/expression/asm_to_ir.py
index 83eac728..edc23437 100644
--- a/example/expression/asm_to_ir.py
+++ b/example/expression/asm_to_ir.py
@@ -9,10 +9,13 @@ from miasm.expression.expression import *
 from miasm.core import asmblock
 from miasm.arch.x86.ira import ir_a_x86_32
 from miasm.analysis.data_flow import DeadRemoval
+from miasm.core.locationdb import LocationDB
 
 
 # First, asm code
-asmcfg, loc_db = parse_asm.parse_txt(mn_x86, 32, '''
+loc_db = LocationDB()
+asmcfg = parse_asm.parse_txt(
+    mn_x86, 32, '''
 main:
    MOV    EAX, 1
    MOV    EBX, 2
@@ -25,7 +28,9 @@ loop:
    ADD    EAX, ECX
    JZ     loop
    RET
-''')
+''',
+    loc_db
+)
 
 
 loc_db.set_location_offset(loc_db.get_name_location("main"), 0x0)