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/arch/mips32/unit/asm_test.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/arch/mips32/unit/asm_test.py')
| -rw-r--r-- | test/arch/mips32/unit/asm_test.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/test/arch/mips32/unit/asm_test.py b/test/arch/mips32/unit/asm_test.py index 2dcaf6fc..d6194b00 100644 --- a/test/arch/mips32/unit/asm_test.py +++ b/test/arch/mips32/unit/asm_test.py @@ -10,6 +10,7 @@ from miasm.core import asmblock from miasm.loader.strpatchwork import StrPatchwork from miasm.analysis.machine import Machine from miasm.jitter.csts import * +from miasm.core.locationdb import LocationDB reg_and_id = dict(mn_mips32.regs.all_regs_ids_byname) @@ -17,7 +18,8 @@ reg_and_id = dict(mn_mips32.regs.all_regs_ids_byname) class Asm_Test(object): def __init__(self, jitter): - self.myjit = Machine("mips32l").jitter(jitter) + self.loc_db = LocationDB() + self.myjit = Machine("mips32l").jitter(self.loc_db, jitter) self.myjit.init_stack() def __call__(self): @@ -26,12 +28,11 @@ class Asm_Test(object): self.check() def asm(self): - blocks, loc_db = parse_asm.parse_txt(mn_mips32, 'l', self.TXT, - loc_db=self.myjit.ir_arch.loc_db) + asmcfg = parse_asm.parse_txt(mn_mips32, 'l', self.TXT, self.loc_db) # fix shellcode addr - loc_db.set_location_offset(loc_db.get_name_location("main"), 0x0) + self.loc_db.set_location_offset(self.loc_db.get_name_location("main"), 0x0) s = StrPatchwork() - patches = asmblock.asm_resolve_final(mn_mips32, blocks, loc_db) + patches = asmblock.asm_resolve_final(mn_mips32, asmcfg) for offset, raw in viewitems(patches): s[offset] = raw |