def trace_handle(self, addr, operand): """ 处理回溯事件 """ next_addr = idaapi.prev_head(addr, 0) next_operand = self.get_next_reg(addr, operand) return (next_addr, next_operand)
def iterate(ea, start, next): ea = ea if (idaapi.getFlags(ea)&idaapi.FF_DATA) else idaapi.prev_head(ea,0) addr = start(ea) while addr != idaapi.BADADDR: yield addr addr = next(ea, addr) return
def trace_next(self, blk, node, operand): """ 下一轮回溯 """ for blk_t in blk.preds(): addr = idaapi.prev_head(blk_t.end_ea, 1) FELogger.info("基本块跳转\t[0x%x]\t[%s]" % (addr, operand.name)) node_t = self.create_tree_node(addr, node) operand_t = copy.copy(operand) self.dfs(node_t, operand_t, blk_t) FELogger.info("回溯完成\t[0x%x]\t[%s]" % (addr, operand_t.name))
def prev(ea): return idaapi.prev_head(ea, 0)
def prev(cls, ea=None, count=1): ea = ui.current.address() if ea is None else ea res = idaapi.prev_head(ea, 0) return cls.prev(res, count - 1) if count > 1 else res