def annotate_with_variables(expr: claripy.ast.Base, addr_and_variables: Iterable[Tuple[int,Union[SimVariable,SpOffset]]]) -> claripy.ast.Base: annotations_to_remove = [ ] for anno in expr.annotations: if isinstance(anno, VariableAnnotation): annotations_to_remove.append(anno) if annotations_to_remove: expr = expr.remove_annotations(annotations_to_remove) expr = expr.annotate(VariableAnnotation(list(addr_and_variables))) return expr
def annotate_with_variables( expr: claripy.ast.Base, addr_and_variables: Iterable[Tuple[int, Union[SimVariable, SpOffset]]] ) -> claripy.ast.Base: expr = expr.replace_annotations( (VariableAnnotation(list(addr_and_variables)), )) return expr
def annotate_with_def(symvar: claripy.ast.Base, definition: Definition): """ :param symvar: :param definition: :return: """ # strip existing definition annotations annotations_to_remove = [] for anno in symvar.annotations: if isinstance(anno, DefinitionAnnotation): annotations_to_remove.append(anno) if annotations_to_remove: symvar = symvar.remove_annotations(annotations_to_remove) # annotate with the new definition annotation return symvar.annotate(DefinitionAnnotation(definition))