about summary refs log tree commit diff stats
path: root/example/jitter/run_with_linuxenv.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/jitter/run_with_linuxenv.py
parent5d8beb271d9890241a6d61dd476fab26ca37ebbf (diff)
downloadfocaccia-miasm-80e40a3d2ca735db955807ad0605b43ca22e4e35.tar.gz
focaccia-miasm-80e40a3d2ca735db955807ad0605b43ca22e4e35.zip
Avoid generate default locationdb
Diffstat (limited to 'example/jitter/run_with_linuxenv.py')
-rw-r--r--example/jitter/run_with_linuxenv.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/example/jitter/run_with_linuxenv.py b/example/jitter/run_with_linuxenv.py
index 9b17b172..9290e6a8 100644
--- a/example/jitter/run_with_linuxenv.py
+++ b/example/jitter/run_with_linuxenv.py
@@ -7,6 +7,7 @@ from miasm.loader import elf as elf_csts
 from miasm.os_dep.linux import environment, syscall
 from miasm.analysis.machine import Machine
 from miasm.analysis.binary import Container
+from miasm.core.locationdb import LocationDB
 
 parser = ArgumentParser("Run an ELF in a Linux-like environment")
 parser.add_argument("target", help="Target ELF")
@@ -23,8 +24,9 @@ args = parser.parse_args()
 if args.verbose:
     syscall.log.setLevel(logging.DEBUG)
 
+loc_db = LocationDB()
 # Get corresponding interpreter and reloc address
-cont_target_tmp = Container.from_stream(open(args.target, 'rb'))
+cont_target_tmp = Container.from_stream(open(args.target, 'rb'), loc_db)
 ld_path = bytes(cont_target_tmp.executable.getsectionbyname(".interp").content).strip(b"\x00")
 if cont_target_tmp.executable.Ehdr.type in [elf_csts.ET_REL, elf_csts.ET_DYN]:
     elf_base_addr = 0x40000000
@@ -35,7 +37,7 @@ else:
 
 # Instantiate a jitter
 machine = Machine(cont_target_tmp.arch)
-jitter = machine.jitter(args.jitter)
+jitter = machine.jitter(loc_db, args.jitter)
 jitter.init_stack()
 
 # Get elements for the target architecture