diff options
| author | serpilliere <serpilliere@users.noreply.github.com> | 2020-08-31 09:27:56 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-31 09:27:56 +0200 |
| commit | 06239dde95cd984548deb40e9945d8bd85d83425 (patch) | |
| tree | 2fb59bca2aada9280fb1aecd2ebdd633a23cdc4b /example/jitter/run_with_linuxenv.py | |
| parent | 5d8beb271d9890241a6d61dd476fab26ca37ebbf (diff) | |
| parent | 24ce193b8bad352853a9c5589f6fdcf5177d5466 (diff) | |
| download | miasm-06239dde95cd984548deb40e9945d8bd85d83425.tar.gz miasm-06239dde95cd984548deb40e9945d8bd85d83425.zip | |
Merge pull request #1274 from serpilliere/dont_gen_locationdb
Avoid generate default locationdb
Diffstat (limited to 'example/jitter/run_with_linuxenv.py')
| -rw-r--r-- | example/jitter/run_with_linuxenv.py | 6 |
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 |