Exemplo n.º 1
0
    def dladdr(self, uc, addr, info):
        infos = memory_helpers.read_uints(uc, info, 4)
        Dl_info = {}

        nm = self._emu.native_memory
        isfind = False
        for mod in self._module_mgr.modules:
            if mod.base <= addr < mod.base + mod.size:
                dli_fname = nm.allocate(len(mod.filename) + 1)
                memory_helpers.write_utf8(uc, dli_fname, mod.filename + '\x00')
                memory_helpers.write_uints(uc, addr, [dli_fname, mod.base, 0, 0])
                return 1
Exemplo n.º 2
0
    def dladdr(self, uc, addr, info):
        infos = memory_helpers.read_uints(uc, info, 4)

        nm = self._emu.native_memory

        if addr == 0:
            addr = uc.reg_read(arm_const.UC_ARM_REG_PC)

        # isfind = False
        for mod in self._module_mgr.modules:
            if mod.base <= addr < mod.base + mod.size:
                dli_fname = nm.allocate(len(mod.filename) + 1)
                memory_helpers.write_utf8(uc, dli_fname, mod.filename + '\x00')
                memory_helpers.write_uints(uc, info,
                                           [dli_fname, mod.base, 0, 0])
                return 1