diff options
Diffstat (limited to 'test/arch')
| -rw-r--r-- | test/arch/aarch64/unit/asm_test.py | 2 | ||||
| -rw-r--r-- | test/arch/mips32/unit/asm_test.py | 2 | ||||
| -rwxr-xr-x | test/arch/x86/sem.py | 4 | ||||
| -rw-r--r-- | test/arch/x86/unit/asm_test.py | 2 | ||||
| -rwxr-xr-x | test/arch/x86/unit/mn_strings.py | 12 |
5 files changed, 11 insertions, 11 deletions
diff --git a/test/arch/aarch64/unit/asm_test.py b/test/arch/aarch64/unit/asm_test.py index d3221ec0..677d474f 100644 --- a/test/arch/aarch64/unit/asm_test.py +++ b/test/arch/aarch64/unit/asm_test.py @@ -25,7 +25,7 @@ class Asm_Test(object): blocks, loc_db = parse_asm.parse_txt(mn_aarch64, 'l', self.TXT, loc_db = self.myjit.ir_arch.loc_db) # fix shellcode addr - loc_db.set_offset(loc_db.getby_name("main"), 0x0) + loc_db.set_location_offset(loc_db.get_name_location("main"), 0x0) s = StrPatchwork() patches = asmblock.asm_resolve_final(mn_aarch64, blocks, loc_db) for offset, raw in patches.items(): diff --git a/test/arch/mips32/unit/asm_test.py b/test/arch/mips32/unit/asm_test.py index be26bf49..da792874 100644 --- a/test/arch/mips32/unit/asm_test.py +++ b/test/arch/mips32/unit/asm_test.py @@ -27,7 +27,7 @@ class Asm_Test(object): blocks, loc_db = parse_asm.parse_txt(mn_mips32, 'l', self.TXT, loc_db=self.myjit.ir_arch.loc_db) # fix shellcode addr - loc_db.set_offset(loc_db.getby_name("main"), 0x0) + loc_db.set_location_offset(loc_db.get_name_location("main"), 0x0) s = StrPatchwork() patches = asmblock.asm_resolve_final(mn_mips32, blocks, loc_db) for offset, raw in patches.items(): diff --git a/test/arch/x86/sem.py b/test/arch/x86/sem.py index 23b22245..a2493d12 100755 --- a/test/arch/x86/sem.py +++ b/test/arch/x86/sem.py @@ -49,10 +49,10 @@ def compute(ir, mode, asm, inputstate={}, debug=False): def compute_txt(ir, mode, txt, inputstate={}, debug=False): asmcfg, loc_db = parse_asm.parse_txt(mn, mode, txt) - loc_db.set_offset(loc_db.getby_name("main"), 0x0) + loc_db.set_location_offset(loc_db.get_name_location("main"), 0x0) patches = asmblock.asm_resolve_final(mn, asmcfg, loc_db) interm = ir(loc_db) - lbl = loc_db.getby_name("main") + lbl = loc_db.get_name_location("main") for bbl in asmcfg.blocks: interm.add_block(bbl) return symb_exec(lbl, interm, inputstate, debug) diff --git a/test/arch/x86/unit/asm_test.py b/test/arch/x86/unit/asm_test.py index e626768d..91da1942 100644 --- a/test/arch/x86/unit/asm_test.py +++ b/test/arch/x86/unit/asm_test.py @@ -43,7 +43,7 @@ class Asm_Test(object): blocks, loc_db = parse_asm.parse_txt(mn_x86, self.arch_attrib, self.TXT, loc_db = self.myjit.ir_arch.loc_db) # fix shellcode addr - loc_db.set_offset(loc_db.getby_name("main"), 0x0) + loc_db.set_location_offset(loc_db.get_name_location("main"), 0x0) s = StrPatchwork() patches = asmblock.asm_resolve_final(mn_x86, blocks, loc_db) for offset, raw in patches.items(): diff --git a/test/arch/x86/unit/mn_strings.py b/test/arch/x86/unit/mn_strings.py index a6facd08..8ca148e5 100755 --- a/test/arch/x86/unit/mn_strings.py +++ b/test/arch/x86/unit/mn_strings.py @@ -21,8 +21,8 @@ class Test_SCAS(Asm_Test_32): def check(self): assert(self.myjit.cpu.ECX == len(self.MYSTRING)) - mystr = self.myjit.ir_arch.loc_db.getby_name('mystr') - assert(self.myjit.cpu.EDI == self.myjit.ir_arch.loc_db.loc_key_to_offset(mystr) + len(self.MYSTRING)+1) + mystr = self.myjit.ir_arch.loc_db.get_name_location('mystr') + assert(self.myjit.cpu.EDI == self.myjit.ir_arch.loc_db.get_location_offset(mystr) + len(self.MYSTRING)+1) class Test_MOVS(Asm_Test_32): @@ -43,10 +43,10 @@ class Test_MOVS(Asm_Test_32): def check(self): assert(self.myjit.cpu.ECX == 0) - buffer = self.myjit.ir_arch.loc_db.getby_name('buffer') - assert(self.myjit.cpu.EDI == self.myjit.ir_arch.loc_db.loc_key_to_offset(buffer) + len(self.MYSTRING)) - mystr = self.myjit.ir_arch.loc_db.getby_name('mystr') - assert(self.myjit.cpu.ESI == self.myjit.ir_arch.loc_db.loc_key_to_offset(mystr) + len(self.MYSTRING)) + buffer = self.myjit.ir_arch.loc_db.get_name_location('buffer') + assert(self.myjit.cpu.EDI == self.myjit.ir_arch.loc_db.get_location_offset(buffer) + len(self.MYSTRING)) + mystr = self.myjit.ir_arch.loc_db.get_name_location('mystr') + assert(self.myjit.cpu.ESI == self.myjit.ir_arch.loc_db.get_location_offset(mystr) + len(self.MYSTRING)) if __name__ == "__main__": |