diff options
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..164cc143 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) + blocks = 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, blocks, self.loc_db) for offset, raw in viewitems(patches): s[offset] = raw |