def get_block_containing_inst(self, inst_addr): index = bisect.bisect_right(self.ordered_nodes, inst_addr) - 1 node = self.cfg.model.get_any_node(self.ordered_nodes[index], is_syscall=False) if inst_addr in node.instruction_addrs: return node.addr else: raise MissingBlockException( "Couldn't find a block containing address %#x" % inst_addr)
def check_if_thumb(self, inst_addr): index = bisect.bisect_right(self.ordered_nodes, inst_addr) - 1 node = self.cfg.model.get_any_node(self.ordered_nodes[index], is_syscall=False) if inst_addr in node.instruction_addrs: return node.thumb else: if inst_addr % 2 == 0: return self.check_if_thumb(inst_addr + 1) else: raise MissingBlockException( "Couldn't find a block containing address %#x" % inst_addr)