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 /test/jitter/jit_options.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 'test/jitter/jit_options.py')
| -rw-r--r-- | test/jitter/jit_options.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/jitter/jit_options.py b/test/jitter/jit_options.py index 74808330..f1258323 100644 --- a/test/jitter/jit_options.py +++ b/test/jitter/jit_options.py @@ -5,6 +5,7 @@ import sys from miasm.core.utils import decode_hex from miasm.jitter.csts import PAGE_READ, PAGE_WRITE from miasm.analysis.machine import Machine +from miasm.core.locationdb import LocationDB from pdb import pm # Shellcode @@ -21,16 +22,17 @@ from pdb import pm data = decode_hex("b810000000bb0100000083e8010f44cb75f8c3") run_addr = 0x40000000 +loc_db = LocationDB() def code_sentinelle(jitter): jitter.run = False jitter.pc = 0 return True -def init_jitter(): +def init_jitter(loc_db): global data, run_addr # Create jitter - myjit = Machine("x86_32").jitter(sys.argv[1]) + myjit = Machine("x86_32").jitter(loc_db, sys.argv[1]) myjit.vm.add_memory_page(run_addr, PAGE_READ | PAGE_WRITE, data) @@ -44,7 +46,7 @@ def init_jitter(): # Test 'max_exec_per_call' print("[+] First run, to jit blocks") -myjit = init_jitter() +myjit = init_jitter(loc_db) myjit.init_run(run_addr) myjit.continue_run() @@ -78,7 +80,7 @@ assert myjit.cpu.EAX >= 0xA # Test 'jit_maxline' print("[+] Run instr one by one") -myjit = init_jitter() +myjit = init_jitter(loc_db) myjit.jit.options["jit_maxline"] = 1 myjit.jit.options["max_exec_per_call"] = 1 |