def annotation(self, xdata: InstrXData) -> str: """xdata format: a:x . xprs[0]: true condition xprs[1]: false condition xprs[2]: true condition (simplified) xprs[3]: false condition (simplified) xprs[4]: target address (absolute) or, if no conditions xprs[0]: target address (absolute) """ if self.is_call_instruction(xdata): tgt = xdata.call_target(self.ixd) args = ", ".join(str(x) for x in self.arguments(xdata)) return "call " + str(tgt) + "(" + args + ")" elif xdata.has_branch_conditions(): return "if " + str(xdata.xprs[0]) + " then goto " + str( xdata.xprs[2]) elif self.tags[1] in ["a", "unc"]: return "goto " + str(xdata.xprs[0]) else: return "if ? goto " + str(xdata.xprs[0])
def ft_conditions(self, xdata: InstrXData) -> Sequence[XXpr]: if xdata.has_branch_conditions(): return [xdata.xprs[1], xdata.xprs[0]] else: return []