partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | SimSolver.reload_solver | Reloads the solver. Useful when changing solver options.
:param list constraints: A new list of constraints to use in the reloaded solver instead of the current one | angr/state_plugins/solver.py | def reload_solver(self, constraints=None):
"""
Reloads the solver. Useful when changing solver options.
:param list constraints: A new list of constraints to use in the reloaded solver instead of the current one
"""
if constraints is None:
constraints = self._sol... | def reload_solver(self, constraints=None):
"""
Reloads the solver. Useful when changing solver options.
:param list constraints: A new list of constraints to use in the reloaded solver instead of the current one
"""
if constraints is None:
constraints = self._sol... | [
"Reloads",
"the",
"solver",
".",
"Useful",
"when",
"changing",
"solver",
"options",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L189-L199 | [
"def",
"reload_solver",
"(",
"self",
",",
"constraints",
"=",
"None",
")",
":",
"if",
"constraints",
"is",
"None",
":",
"constraints",
"=",
"self",
".",
"_solver",
".",
"constraints",
"self",
".",
"_stored_solver",
"=",
"None",
"self",
".",
"_solver",
".",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSolver.get_variables | Iterate over all variables for which their tracking key is a prefix of the values provided.
Elements are a tuple, the first element is the full tracking key, the second is the symbol.
>>> list(s.solver.get_variables('mem'))
[(('mem', 0x1000), <BV64 mem_1000_4_64>), (('mem', 0x1008), <BV64 mem_... | angr/state_plugins/solver.py | def get_variables(self, *keys):
"""
Iterate over all variables for which their tracking key is a prefix of the values provided.
Elements are a tuple, the first element is the full tracking key, the second is the symbol.
>>> list(s.solver.get_variables('mem'))
[(('mem', 0x1000),... | def get_variables(self, *keys):
"""
Iterate over all variables for which their tracking key is a prefix of the values provided.
Elements are a tuple, the first element is the full tracking key, the second is the symbol.
>>> list(s.solver.get_variables('mem'))
[(('mem', 0x1000),... | [
"Iterate",
"over",
"all",
"variables",
"for",
"which",
"their",
"tracking",
"key",
"is",
"a",
"prefix",
"of",
"the",
"values",
"provided",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L201-L226 | [
"def",
"get_variables",
"(",
"self",
",",
"*",
"keys",
")",
":",
"for",
"k",
",",
"v",
"in",
"self",
".",
"eternal_tracked_variables",
".",
"items",
"(",
")",
":",
"if",
"len",
"(",
"k",
")",
">=",
"len",
"(",
"keys",
")",
"and",
"all",
"(",
"x",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSolver.register_variable | Register a value with the variable tracking system
:param v: The BVS to register
:param key: A tuple to register the variable under
:parma eternal: Whether this is an eternal variable, default True. If False, an incrementing counter will be
appended to the key. | angr/state_plugins/solver.py | def register_variable(self, v, key, eternal=True):
"""
Register a value with the variable tracking system
:param v: The BVS to register
:param key: A tuple to register the variable under
:parma eternal: Whether this is an eternal variable, default True. If False, an in... | def register_variable(self, v, key, eternal=True):
"""
Register a value with the variable tracking system
:param v: The BVS to register
:param key: A tuple to register the variable under
:parma eternal: Whether this is an eternal variable, default True. If False, an in... | [
"Register",
"a",
"value",
"with",
"the",
"variable",
"tracking",
"system"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L228-L247 | [
"def",
"register_variable",
"(",
"self",
",",
"v",
",",
"key",
",",
"eternal",
"=",
"True",
")",
":",
"if",
"type",
"(",
"key",
")",
"is",
"not",
"tuple",
":",
"raise",
"TypeError",
"(",
"\"Variable tracking key must be a tuple\"",
")",
"if",
"eternal",
":... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSolver.describe_variables | Given an AST, iterate over all the keys of all the BVS leaves in the tree which are registered. | angr/state_plugins/solver.py | def describe_variables(self, v):
"""
Given an AST, iterate over all the keys of all the BVS leaves in the tree which are registered.
"""
reverse_mapping = {next(iter(var.variables)): k for k, var in self.eternal_tracked_variables.items()}
reverse_mapping.update({next(iter(var.var... | def describe_variables(self, v):
"""
Given an AST, iterate over all the keys of all the BVS leaves in the tree which are registered.
"""
reverse_mapping = {next(iter(var.variables)): k for k, var in self.eternal_tracked_variables.items()}
reverse_mapping.update({next(iter(var.var... | [
"Given",
"an",
"AST",
"iterate",
"over",
"all",
"the",
"keys",
"of",
"all",
"the",
"BVS",
"leaves",
"in",
"the",
"tree",
"which",
"are",
"registered",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L249-L258 | [
"def",
"describe_variables",
"(",
"self",
",",
"v",
")",
":",
"reverse_mapping",
"=",
"{",
"next",
"(",
"iter",
"(",
"var",
".",
"variables",
")",
")",
":",
"k",
"for",
"k",
",",
"var",
"in",
"self",
".",
"eternal_tracked_variables",
".",
"items",
"(",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSolver._solver | Creates or gets a Claripy solver, based on the state options. | angr/state_plugins/solver.py | def _solver(self):
"""
Creates or gets a Claripy solver, based on the state options.
"""
if self._stored_solver is not None:
return self._stored_solver
track = o.CONSTRAINT_TRACKING_IN_SOLVER in self.state.options
approximate_first = o.APPROXIMATE_FIRST in se... | def _solver(self):
"""
Creates or gets a Claripy solver, based on the state options.
"""
if self._stored_solver is not None:
return self._stored_solver
track = o.CONSTRAINT_TRACKING_IN_SOLVER in self.state.options
approximate_first = o.APPROXIMATE_FIRST in se... | [
"Creates",
"or",
"gets",
"a",
"Claripy",
"solver",
"based",
"on",
"the",
"state",
"options",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L261-L301 | [
"def",
"_solver",
"(",
"self",
")",
":",
"if",
"self",
".",
"_stored_solver",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_stored_solver",
"track",
"=",
"o",
".",
"CONSTRAINT_TRACKING_IN_SOLVER",
"in",
"self",
".",
"state",
".",
"options",
"approximate... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSolver.Unconstrained | Creates an unconstrained symbol or a default concrete value (0), based on the state options.
:param name: The name of the symbol.
:param bits: The size (in bits) of the symbol.
:param uninitialized: Whether this value should be counted as an "uninitialized" value in the ... | angr/state_plugins/solver.py | def Unconstrained(self, name, bits, uninitialized=True, inspect=True, events=True, key=None, eternal=False, **kwargs):
"""
Creates an unconstrained symbol or a default concrete value (0), based on the state options.
:param name: The name of the symbol.
:param bits: ... | def Unconstrained(self, name, bits, uninitialized=True, inspect=True, events=True, key=None, eternal=False, **kwargs):
"""
Creates an unconstrained symbol or a default concrete value (0), based on the state options.
:param name: The name of the symbol.
:param bits: ... | [
"Creates",
"an",
"unconstrained",
"symbol",
"or",
"a",
"default",
"concrete",
"value",
"(",
"0",
")",
"based",
"on",
"the",
"state",
"options",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L306-L340 | [
"def",
"Unconstrained",
"(",
"self",
",",
"name",
",",
"bits",
",",
"uninitialized",
"=",
"True",
",",
"inspect",
"=",
"True",
",",
"events",
"=",
"True",
",",
"key",
"=",
"None",
",",
"eternal",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"if... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSolver.BVS | Creates a bit-vector symbol (i.e., a variable). Other keyword parameters are passed directly on to the
constructor of claripy.ast.BV.
:param name: The name of the symbol.
:param size: The size (in bits) of the bit-vector.
:param min: The minimum value o... | angr/state_plugins/solver.py | def BVS(self, name, size,
min=None, max=None, stride=None,
uninitialized=False,
explicit_name=None, key=None, eternal=False,
inspect=True, events=True,
**kwargs): #pylint:disable=redefined-builtin
"""
Creates a bit-vector symbol (i.e., a variab... | def BVS(self, name, size,
min=None, max=None, stride=None,
uninitialized=False,
explicit_name=None, key=None, eternal=False,
inspect=True, events=True,
**kwargs): #pylint:disable=redefined-builtin
"""
Creates a bit-vector symbol (i.e., a variab... | [
"Creates",
"a",
"bit",
"-",
"vector",
"symbol",
"(",
"i",
".",
"e",
".",
"a",
"variable",
")",
".",
"Other",
"keyword",
"parameters",
"are",
"passed",
"directly",
"on",
"to",
"the",
"constructor",
"of",
"claripy",
".",
"ast",
".",
"BV",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L342-L390 | [
"def",
"BVS",
"(",
"self",
",",
"name",
",",
"size",
",",
"min",
"=",
"None",
",",
"max",
"=",
"None",
",",
"stride",
"=",
"None",
",",
"uninitialized",
"=",
"False",
",",
"explicit_name",
"=",
"None",
",",
"key",
"=",
"None",
",",
"eternal",
"=",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSolver.eval_to_ast | Evaluate an expression, using the solver if necessary. Returns AST objects.
:param e: the expression
:param n: the number of desired solutions
:param extra_constraints: extra constraints to apply to the solver
:param exact: if False, returns approximate solutions
:return: a tupl... | angr/state_plugins/solver.py | def eval_to_ast(self, e, n, extra_constraints=(), exact=None):
"""
Evaluate an expression, using the solver if necessary. Returns AST objects.
:param e: the expression
:param n: the number of desired solutions
:param extra_constraints: extra constraints to apply to the solver
... | def eval_to_ast(self, e, n, extra_constraints=(), exact=None):
"""
Evaluate an expression, using the solver if necessary. Returns AST objects.
:param e: the expression
:param n: the number of desired solutions
:param extra_constraints: extra constraints to apply to the solver
... | [
"Evaluate",
"an",
"expression",
"using",
"the",
"solver",
"if",
"necessary",
".",
"Returns",
"AST",
"objects",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L471-L482 | [
"def",
"eval_to_ast",
"(",
"self",
",",
"e",
",",
"n",
",",
"extra_constraints",
"=",
"(",
")",
",",
"exact",
"=",
"None",
")",
":",
"return",
"self",
".",
"_solver",
".",
"eval_to_ast",
"(",
"e",
",",
"n",
",",
"extra_constraints",
"=",
"self",
".",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSolver._eval | Evaluate an expression, using the solver if necessary. Returns primitives.
:param e: the expression
:param n: the number of desired solutions
:param extra_constraints: extra constraints to apply to the solver
:param exact: if False, returns approximate solutions
:return: a tuple... | angr/state_plugins/solver.py | def _eval(self, e, n, extra_constraints=(), exact=None):
"""
Evaluate an expression, using the solver if necessary. Returns primitives.
:param e: the expression
:param n: the number of desired solutions
:param extra_constraints: extra constraints to apply to the solver
:... | def _eval(self, e, n, extra_constraints=(), exact=None):
"""
Evaluate an expression, using the solver if necessary. Returns primitives.
:param e: the expression
:param n: the number of desired solutions
:param extra_constraints: extra constraints to apply to the solver
:... | [
"Evaluate",
"an",
"expression",
"using",
"the",
"solver",
"if",
"necessary",
".",
"Returns",
"primitives",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L488-L499 | [
"def",
"_eval",
"(",
"self",
",",
"e",
",",
"n",
",",
"extra_constraints",
"=",
"(",
")",
",",
"exact",
"=",
"None",
")",
":",
"return",
"self",
".",
"_solver",
".",
"eval",
"(",
"e",
",",
"n",
",",
"extra_constraints",
"=",
"self",
".",
"_adjust_c... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSolver.max | Return the maximum value of expression `e`.
:param e : expression (an AST) to evaluate
:param extra_constraints: extra constraints (as ASTs) to add to the solver for this solve
:param exact : if False, return approximate solutions.
:return: the maximum possible... | angr/state_plugins/solver.py | def max(self, e, extra_constraints=(), exact=None):
"""
Return the maximum value of expression `e`.
:param e : expression (an AST) to evaluate
:param extra_constraints: extra constraints (as ASTs) to add to the solver for this solve
:param exact : if Fa... | def max(self, e, extra_constraints=(), exact=None):
"""
Return the maximum value of expression `e`.
:param e : expression (an AST) to evaluate
:param extra_constraints: extra constraints (as ASTs) to add to the solver for this solve
:param exact : if Fa... | [
"Return",
"the",
"maximum",
"value",
"of",
"expression",
"e",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L505-L519 | [
"def",
"max",
"(",
"self",
",",
"e",
",",
"extra_constraints",
"=",
"(",
")",
",",
"exact",
"=",
"None",
")",
":",
"if",
"exact",
"is",
"False",
"and",
"o",
".",
"VALIDATE_APPROXIMATIONS",
"in",
"self",
".",
"state",
".",
"options",
":",
"ar",
"=",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSolver.solution | Return True if `v` is a solution of `expr` with the extra constraints, False otherwise.
:param e: An expression (an AST) to evaluate
:param v: The proposed solution (an AST)
:param extra_constraints: Extra constraints (as ASTs) to add to the solver for this... | angr/state_plugins/solver.py | def solution(self, e, v, extra_constraints=(), exact=None):
"""
Return True if `v` is a solution of `expr` with the extra constraints, False otherwise.
:param e: An expression (an AST) to evaluate
:param v: The proposed solution (an AST)
:para... | def solution(self, e, v, extra_constraints=(), exact=None):
"""
Return True if `v` is a solution of `expr` with the extra constraints, False otherwise.
:param e: An expression (an AST) to evaluate
:param v: The proposed solution (an AST)
:para... | [
"Return",
"True",
"if",
"v",
"is",
"a",
"solution",
"of",
"expr",
"with",
"the",
"extra",
"constraints",
"False",
"otherwise",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L544-L560 | [
"def",
"solution",
"(",
"self",
",",
"e",
",",
"v",
",",
"extra_constraints",
"=",
"(",
")",
",",
"exact",
"=",
"None",
")",
":",
"if",
"exact",
"is",
"False",
"and",
"o",
".",
"VALIDATE_APPROXIMATIONS",
"in",
"self",
".",
"state",
".",
"options",
":... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSolver.unsat_core | This function returns the unsat core from the backend solver.
:param extra_constraints: Extra constraints (as ASTs) to add to the solver for this solve.
:return: The unsat core. | angr/state_plugins/solver.py | def unsat_core(self, extra_constraints=()):
"""
This function returns the unsat core from the backend solver.
:param extra_constraints: Extra constraints (as ASTs) to add to the solver for this solve.
:return: The unsat core.
"""
if o.CONSTRAINT_TRACKING_IN_SOLVER not ... | def unsat_core(self, extra_constraints=()):
"""
This function returns the unsat core from the backend solver.
:param extra_constraints: Extra constraints (as ASTs) to add to the solver for this solve.
:return: The unsat core.
"""
if o.CONSTRAINT_TRACKING_IN_SOLVER not ... | [
"This",
"function",
"returns",
"the",
"unsat",
"core",
"from",
"the",
"backend",
"solver",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L611-L620 | [
"def",
"unsat_core",
"(",
"self",
",",
"extra_constraints",
"=",
"(",
")",
")",
":",
"if",
"o",
".",
"CONSTRAINT_TRACKING_IN_SOLVER",
"not",
"in",
"self",
".",
"state",
".",
"options",
":",
"raise",
"SimSolverOptionError",
"(",
"'CONSTRAINT_TRACKING_IN_SOLVER must... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSolver.satisfiable | This function does a constraint check and checks if the solver is in a sat state.
:param extra_constraints: Extra constraints (as ASTs) to add to s for this solve
:param exact: If False, return approximate solutions.
:return: True if sat, otherwise false | angr/state_plugins/solver.py | def satisfiable(self, extra_constraints=(), exact=None):
"""
This function does a constraint check and checks if the solver is in a sat state.
:param extra_constraints: Extra constraints (as ASTs) to add to s for this solve
:param exact: If False, return approximate solu... | def satisfiable(self, extra_constraints=(), exact=None):
"""
This function does a constraint check and checks if the solver is in a sat state.
:param extra_constraints: Extra constraints (as ASTs) to add to s for this solve
:param exact: If False, return approximate solu... | [
"This",
"function",
"does",
"a",
"constraint",
"check",
"and",
"checks",
"if",
"the",
"solver",
"is",
"in",
"a",
"sat",
"state",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L625-L640 | [
"def",
"satisfiable",
"(",
"self",
",",
"extra_constraints",
"=",
"(",
")",
",",
"exact",
"=",
"None",
")",
":",
"if",
"exact",
"is",
"False",
"and",
"o",
".",
"VALIDATE_APPROXIMATIONS",
"in",
"self",
".",
"state",
".",
"options",
":",
"er",
"=",
"self... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSolver.add | Add some constraints to the solver.
:param constraints: Pass any constraints that you want to add (ASTs) as varargs. | angr/state_plugins/solver.py | def add(self, *constraints):
"""
Add some constraints to the solver.
:param constraints: Pass any constraints that you want to add (ASTs) as varargs.
"""
cc = self._adjust_constraint_list(constraints)
return self._solver.add(cc) | def add(self, *constraints):
"""
Add some constraints to the solver.
:param constraints: Pass any constraints that you want to add (ASTs) as varargs.
"""
cc = self._adjust_constraint_list(constraints)
return self._solver.add(cc) | [
"Add",
"some",
"constraints",
"to",
"the",
"solver",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L645-L652 | [
"def",
"add",
"(",
"self",
",",
"*",
"constraints",
")",
":",
"cc",
"=",
"self",
".",
"_adjust_constraint_list",
"(",
"constraints",
")",
"return",
"self",
".",
"_solver",
".",
"add",
"(",
"cc",
")"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSolver._cast_to | Casts a solution for the given expression to type `cast_to`.
:param e: The expression `value` is a solution for
:param value: The solution to be cast
:param cast_to: The type `value` should be cast to. Must be one of the currently supported types (bytes|int)
:raise ValueError: If cast_t... | angr/state_plugins/solver.py | def _cast_to(e, solution, cast_to):
"""
Casts a solution for the given expression to type `cast_to`.
:param e: The expression `value` is a solution for
:param value: The solution to be cast
:param cast_to: The type `value` should be cast to. Must be one of the currently supporte... | def _cast_to(e, solution, cast_to):
"""
Casts a solution for the given expression to type `cast_to`.
:param e: The expression `value` is a solution for
:param value: The solution to be cast
:param cast_to: The type `value` should be cast to. Must be one of the currently supporte... | [
"Casts",
"a",
"solution",
"for",
"the",
"given",
"expression",
"to",
"type",
"cast_to",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L659-L688 | [
"def",
"_cast_to",
"(",
"e",
",",
"solution",
",",
"cast_to",
")",
":",
"if",
"cast_to",
"is",
"None",
":",
"return",
"solution",
"if",
"type",
"(",
"solution",
")",
"is",
"bool",
":",
"if",
"cast_to",
"is",
"bytes",
":",
"return",
"bytes",
"(",
"[",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSolver.eval_upto | Evaluate an expression, using the solver if necessary. Returns primitives as specified by the `cast_to`
parameter. Only certain primitives are supported, check the implementation of `_cast_to` to see which ones.
:param e: the expression
:param n: the number of desired solutions
:param e... | angr/state_plugins/solver.py | def eval_upto(self, e, n, cast_to=None, **kwargs):
"""
Evaluate an expression, using the solver if necessary. Returns primitives as specified by the `cast_to`
parameter. Only certain primitives are supported, check the implementation of `_cast_to` to see which ones.
:param e: the expres... | def eval_upto(self, e, n, cast_to=None, **kwargs):
"""
Evaluate an expression, using the solver if necessary. Returns primitives as specified by the `cast_to`
parameter. Only certain primitives are supported, check the implementation of `_cast_to` to see which ones.
:param e: the expres... | [
"Evaluate",
"an",
"expression",
"using",
"the",
"solver",
"if",
"necessary",
".",
"Returns",
"primitives",
"as",
"specified",
"by",
"the",
"cast_to",
"parameter",
".",
"Only",
"certain",
"primitives",
"are",
"supported",
"check",
"the",
"implementation",
"of",
"... | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L690-L710 | [
"def",
"eval_upto",
"(",
"self",
",",
"e",
",",
"n",
",",
"cast_to",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"concrete_val",
"=",
"_concrete_value",
"(",
"e",
")",
"if",
"concrete_val",
"is",
"not",
"None",
":",
"return",
"[",
"self",
".",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSolver.eval_one | Evaluate an expression to get the only possible solution. Errors if either no or more than one solution is
returned. A kwarg parameter `default` can be specified to be returned instead of failure!
:param e: the expression to get a solution for
:param default: A value can be passed as a kwarg he... | angr/state_plugins/solver.py | def eval_one(self, e, **kwargs):
"""
Evaluate an expression to get the only possible solution. Errors if either no or more than one solution is
returned. A kwarg parameter `default` can be specified to be returned instead of failure!
:param e: the expression to get a solution for
... | def eval_one(self, e, **kwargs):
"""
Evaluate an expression to get the only possible solution. Errors if either no or more than one solution is
returned. A kwarg parameter `default` can be specified to be returned instead of failure!
:param e: the expression to get a solution for
... | [
"Evaluate",
"an",
"expression",
"to",
"get",
"the",
"only",
"possible",
"solution",
".",
"Errors",
"if",
"either",
"no",
"or",
"more",
"than",
"one",
"solution",
"is",
"returned",
".",
"A",
"kwarg",
"parameter",
"default",
"can",
"be",
"specified",
"to",
"... | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L726-L743 | [
"def",
"eval_one",
"(",
"self",
",",
"e",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"return",
"self",
".",
"eval_exact",
"(",
"e",
",",
"1",
",",
"*",
"*",
"{",
"k",
":",
"v",
"for",
"(",
"k",
",",
"v",
")",
"in",
"kwargs",
".",
"items... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSolver.eval_atmost | Evaluate an expression to get at most `n` possible solutions. Errors if either none or more than `n` solutions
are returned.
:param e: the expression to get a solution for
:param n: the inclusive upper limit on the number of solutions
:param kwargs: Any additional kwargs will be passed ... | angr/state_plugins/solver.py | def eval_atmost(self, e, n, **kwargs):
"""
Evaluate an expression to get at most `n` possible solutions. Errors if either none or more than `n` solutions
are returned.
:param e: the expression to get a solution for
:param n: the inclusive upper limit on the number of solutions
... | def eval_atmost(self, e, n, **kwargs):
"""
Evaluate an expression to get at most `n` possible solutions. Errors if either none or more than `n` solutions
are returned.
:param e: the expression to get a solution for
:param n: the inclusive upper limit on the number of solutions
... | [
"Evaluate",
"an",
"expression",
"to",
"get",
"at",
"most",
"n",
"possible",
"solutions",
".",
"Errors",
"if",
"either",
"none",
"or",
"more",
"than",
"n",
"solutions",
"are",
"returned",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L745-L760 | [
"def",
"eval_atmost",
"(",
"self",
",",
"e",
",",
"n",
",",
"*",
"*",
"kwargs",
")",
":",
"r",
"=",
"self",
".",
"eval_upto",
"(",
"e",
",",
"n",
"+",
"1",
",",
"*",
"*",
"kwargs",
")",
"if",
"len",
"(",
"r",
")",
">",
"n",
":",
"raise",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSolver.unique | Returns True if the expression `e` has only one solution by querying
the constraint solver. It does also add that unique solution to the
solver's constraints. | angr/state_plugins/solver.py | def unique(self, e, **kwargs):
"""
Returns True if the expression `e` has only one solution by querying
the constraint solver. It does also add that unique solution to the
solver's constraints.
"""
if not isinstance(e, claripy.ast.Base):
return True
#... | def unique(self, e, **kwargs):
"""
Returns True if the expression `e` has only one solution by querying
the constraint solver. It does also add that unique solution to the
solver's constraints.
"""
if not isinstance(e, claripy.ast.Base):
return True
#... | [
"Returns",
"True",
"if",
"the",
"expression",
"e",
"has",
"only",
"one",
"solution",
"by",
"querying",
"the",
"constraint",
"solver",
".",
"It",
"does",
"also",
"add",
"that",
"unique",
"solution",
"to",
"the",
"solver",
"s",
"constraints",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L804-L824 | [
"def",
"unique",
"(",
"self",
",",
"e",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"isinstance",
"(",
"e",
",",
"claripy",
".",
"ast",
".",
"Base",
")",
":",
"return",
"True",
"# if we don't want to do symbolic checks, assume symbolic variables are multival... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSolver.symbolic | Returns True if the expression `e` is symbolic. | angr/state_plugins/solver.py | def symbolic(self, e): # pylint:disable=R0201
"""
Returns True if the expression `e` is symbolic.
"""
if type(e) in (int, bytes, float, bool):
return False
return e.symbolic | def symbolic(self, e): # pylint:disable=R0201
"""
Returns True if the expression `e` is symbolic.
"""
if type(e) in (int, bytes, float, bool):
return False
return e.symbolic | [
"Returns",
"True",
"if",
"the",
"expression",
"e",
"is",
"symbolic",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L826-L832 | [
"def",
"symbolic",
"(",
"self",
",",
"e",
")",
":",
"# pylint:disable=R0201",
"if",
"type",
"(",
"e",
")",
"in",
"(",
"int",
",",
"bytes",
",",
"float",
",",
"bool",
")",
":",
"return",
"False",
"return",
"e",
".",
"symbolic"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSolver.single_valued | Returns True whether `e` is a concrete value or is a value set with
only 1 possible value. This differs from `unique` in that this *does*
not query the constraint solver. | angr/state_plugins/solver.py | def single_valued(self, e):
"""
Returns True whether `e` is a concrete value or is a value set with
only 1 possible value. This differs from `unique` in that this *does*
not query the constraint solver.
"""
if self.state.mode == 'static':
if type(e) in (int, b... | def single_valued(self, e):
"""
Returns True whether `e` is a concrete value or is a value set with
only 1 possible value. This differs from `unique` in that this *does*
not query the constraint solver.
"""
if self.state.mode == 'static':
if type(e) in (int, b... | [
"Returns",
"True",
"whether",
"e",
"is",
"a",
"concrete",
"value",
"or",
"is",
"a",
"value",
"set",
"with",
"only",
"1",
"possible",
"value",
".",
"This",
"differs",
"from",
"unique",
"in",
"that",
"this",
"*",
"does",
"*",
"not",
"query",
"the",
"cons... | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L834-L848 | [
"def",
"single_valued",
"(",
"self",
",",
"e",
")",
":",
"if",
"self",
".",
"state",
".",
"mode",
"==",
"'static'",
":",
"if",
"type",
"(",
"e",
")",
"in",
"(",
"int",
",",
"bytes",
",",
"float",
",",
"bool",
")",
":",
"return",
"True",
"else",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSolver.simplify | Simplifies `e`. If `e` is None, simplifies the constraints of this
state. | angr/state_plugins/solver.py | def simplify(self, e=None):
"""
Simplifies `e`. If `e` is None, simplifies the constraints of this
state.
"""
if e is None:
return self._solver.simplify()
elif isinstance(e, (int, float, bool)):
return e
elif isinstance(e, claripy.ast.Base)... | def simplify(self, e=None):
"""
Simplifies `e`. If `e` is None, simplifies the constraints of this
state.
"""
if e is None:
return self._solver.simplify()
elif isinstance(e, (int, float, bool)):
return e
elif isinstance(e, claripy.ast.Base)... | [
"Simplifies",
"e",
".",
"If",
"e",
"is",
"None",
"simplifies",
"the",
"constraints",
"of",
"this",
"state",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/solver.py#L850-L866 | [
"def",
"simplify",
"(",
"self",
",",
"e",
"=",
"None",
")",
":",
"if",
"e",
"is",
"None",
":",
"return",
"self",
".",
"_solver",
".",
"simplify",
"(",
")",
"elif",
"isinstance",
"(",
"e",
",",
"(",
"int",
",",
"float",
",",
"bool",
")",
")",
":... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimStatePreconstrainer.preconstrain | Add a preconstraint that ``variable == value`` to the state.
:param value: The concrete value. Can be a bitvector or a bytestring or an integer.
:param variable: The BVS to preconstrain. | angr/state_plugins/preconstrainer.py | def preconstrain(self, value, variable):
"""
Add a preconstraint that ``variable == value`` to the state.
:param value: The concrete value. Can be a bitvector or a bytestring or an integer.
:param variable: The BVS to preconstrain.
"""
if not isinstance(value, c... | def preconstrain(self, value, variable):
"""
Add a preconstraint that ``variable == value`` to the state.
:param value: The concrete value. Can be a bitvector or a bytestring or an integer.
:param variable: The BVS to preconstrain.
"""
if not isinstance(value, c... | [
"Add",
"a",
"preconstraint",
"that",
"variable",
"==",
"value",
"to",
"the",
"state",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/preconstrainer.py#L46-L74 | [
"def",
"preconstrain",
"(",
"self",
",",
"value",
",",
"variable",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"claripy",
".",
"ast",
".",
"Base",
")",
":",
"value",
"=",
"self",
".",
"state",
".",
"solver",
".",
"BVV",
"(",
"value",
",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimStatePreconstrainer.preconstrain_file | Preconstrain the contents of a file.
:param content: The content to preconstrain the file to. Can be a bytestring or a list thereof.
:param simfile: The actual simfile to preconstrain | angr/state_plugins/preconstrainer.py | def preconstrain_file(self, content, simfile, set_length=False):
"""
Preconstrain the contents of a file.
:param content: The content to preconstrain the file to. Can be a bytestring or a list thereof.
:param simfile: The actual simfile to preconstrain
"""
repair... | def preconstrain_file(self, content, simfile, set_length=False):
"""
Preconstrain the contents of a file.
:param content: The content to preconstrain the file to. Can be a bytestring or a list thereof.
:param simfile: The actual simfile to preconstrain
"""
repair... | [
"Preconstrain",
"the",
"contents",
"of",
"a",
"file",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/preconstrainer.py#L76-L108 | [
"def",
"preconstrain_file",
"(",
"self",
",",
"content",
",",
"simfile",
",",
"set_length",
"=",
"False",
")",
":",
"repair_entry_state_opts",
"=",
"False",
"if",
"o",
".",
"TRACK_ACTION_HISTORY",
"in",
"self",
".",
"state",
".",
"options",
":",
"repair_entry_... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimStatePreconstrainer.preconstrain_flag_page | Preconstrain the data in the flag page.
:param magic_content: The content of the magic page as a bytestring. | angr/state_plugins/preconstrainer.py | def preconstrain_flag_page(self, magic_content):
"""
Preconstrain the data in the flag page.
:param magic_content: The content of the magic page as a bytestring.
"""
for m, v in zip(magic_content, self.state.cgc.flag_bytes):
self.preconstrain(m, v) | def preconstrain_flag_page(self, magic_content):
"""
Preconstrain the data in the flag page.
:param magic_content: The content of the magic page as a bytestring.
"""
for m, v in zip(magic_content, self.state.cgc.flag_bytes):
self.preconstrain(m, v) | [
"Preconstrain",
"the",
"data",
"in",
"the",
"flag",
"page",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/preconstrainer.py#L110-L117 | [
"def",
"preconstrain_flag_page",
"(",
"self",
",",
"magic_content",
")",
":",
"for",
"m",
",",
"v",
"in",
"zip",
"(",
"magic_content",
",",
"self",
".",
"state",
".",
"cgc",
".",
"flag_bytes",
")",
":",
"self",
".",
"preconstrain",
"(",
"m",
",",
"v",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimStatePreconstrainer.remove_preconstraints | Remove the preconstraints from the state.
If you are using the zen plugin, this will also use that to filter the constraints.
:param to_composite_solver: Whether to convert the replacement solver to a composite solver. You probably
want this if you're switch... | angr/state_plugins/preconstrainer.py | def remove_preconstraints(self, to_composite_solver=True, simplify=True):
"""
Remove the preconstraints from the state.
If you are using the zen plugin, this will also use that to filter the constraints.
:param to_composite_solver: Whether to convert the replacement solver to a com... | def remove_preconstraints(self, to_composite_solver=True, simplify=True):
"""
Remove the preconstraints from the state.
If you are using the zen plugin, this will also use that to filter the constraints.
:param to_composite_solver: Whether to convert the replacement solver to a com... | [
"Remove",
"the",
"preconstraints",
"from",
"the",
"state",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/preconstrainer.py#L119-L158 | [
"def",
"remove_preconstraints",
"(",
"self",
",",
"to_composite_solver",
"=",
"True",
",",
"simplify",
"=",
"True",
")",
":",
"if",
"not",
"self",
".",
"preconstraints",
":",
"return",
"# cache key set creation",
"precon_cache_keys",
"=",
"set",
"(",
")",
"for",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimStatePreconstrainer.reconstrain | Split the solver. If any of the subsolvers time out after a short timeout (10 seconds), re-add the
preconstraints associated with each of its variables. Hopefully these constraints still allow us to do
meaningful things to the state. | angr/state_plugins/preconstrainer.py | def reconstrain(self):
"""
Split the solver. If any of the subsolvers time out after a short timeout (10 seconds), re-add the
preconstraints associated with each of its variables. Hopefully these constraints still allow us to do
meaningful things to the state.
"""
# test... | def reconstrain(self):
"""
Split the solver. If any of the subsolvers time out after a short timeout (10 seconds), re-add the
preconstraints associated with each of its variables. Hopefully these constraints still allow us to do
meaningful things to the state.
"""
# test... | [
"Split",
"the",
"solver",
".",
"If",
"any",
"of",
"the",
"subsolvers",
"time",
"out",
"after",
"a",
"short",
"timeout",
"(",
"10",
"seconds",
")",
"re",
"-",
"add",
"the",
"preconstraints",
"associated",
"with",
"each",
"of",
"its",
"variables",
".",
"Ho... | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/preconstrainer.py#L160-L177 | [
"def",
"reconstrain",
"(",
"self",
")",
":",
"# test all solver splits",
"subsolvers",
"=",
"self",
".",
"state",
".",
"solver",
".",
"_solver",
".",
"split",
"(",
")",
"for",
"solver",
"in",
"subsolvers",
":",
"solver",
".",
"timeout",
"=",
"1000",
"*",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | ReferenceManager.add_ref | Add a reference to a memory data object.
:param CodeReference ref: The reference.
:return: None | angr/knowledge_plugins/cfg/cfg_model.py | def add_ref(self, ref):
"""
Add a reference to a memory data object.
:param CodeReference ref: The reference.
:return: None
"""
self.refs[ref.insn_addr].append(ref)
self.data_addr_to_ref[ref.memory_data.addr].append(ref) | def add_ref(self, ref):
"""
Add a reference to a memory data object.
:param CodeReference ref: The reference.
:return: None
"""
self.refs[ref.insn_addr].append(ref)
self.data_addr_to_ref[ref.memory_data.addr].append(ref) | [
"Add",
"a",
"reference",
"to",
"a",
"memory",
"data",
"object",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/cfg/cfg_model.py#L25-L34 | [
"def",
"add_ref",
"(",
"self",
",",
"ref",
")",
":",
"self",
".",
"refs",
"[",
"ref",
".",
"insn_addr",
"]",
".",
"append",
"(",
"ref",
")",
"self",
".",
"data_addr_to_ref",
"[",
"ref",
".",
"memory_data",
".",
"addr",
"]",
".",
"append",
"(",
"ref... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGModel.get_any_node | Get an arbitrary CFGNode (without considering their contexts) from our graph.
:param int addr: Address of the beginning of the basic block. Set anyaddr to True to support arbitrary
address.
:param bool is_syscall: Whether you want to get the syscall node or any ot... | angr/knowledge_plugins/cfg/cfg_model.py | def get_any_node(self, addr, is_syscall=None, anyaddr=False, force_fastpath=False):
"""
Get an arbitrary CFGNode (without considering their contexts) from our graph.
:param int addr: Address of the beginning of the basic block. Set anyaddr to True to support arbitrary
... | def get_any_node(self, addr, is_syscall=None, anyaddr=False, force_fastpath=False):
"""
Get an arbitrary CFGNode (without considering their contexts) from our graph.
:param int addr: Address of the beginning of the basic block. Set anyaddr to True to support arbitrary
... | [
"Get",
"an",
"arbitrary",
"CFGNode",
"(",
"without",
"considering",
"their",
"contexts",
")",
"from",
"our",
"graph",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/cfg/cfg_model.py#L213-L271 | [
"def",
"get_any_node",
"(",
"self",
",",
"addr",
",",
"is_syscall",
"=",
"None",
",",
"anyaddr",
"=",
"False",
",",
"force_fastpath",
"=",
"False",
")",
":",
"# fastpath: directly look in the nodes list",
"if",
"not",
"anyaddr",
":",
"try",
":",
"return",
"sel... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGModel.get_all_nodes | Get all CFGNodes whose address is the specified one.
:param addr: Address of the node
:param is_syscall: True returns the syscall node, False returns the normal CFGNode, None returns both
:return: all CFGNodes | angr/knowledge_plugins/cfg/cfg_model.py | def get_all_nodes(self, addr, is_syscall=None, anyaddr=False):
"""
Get all CFGNodes whose address is the specified one.
:param addr: Address of the node
:param is_syscall: True returns the syscall node, False returns the normal CFGNode, None returns both
:return: ... | def get_all_nodes(self, addr, is_syscall=None, anyaddr=False):
"""
Get all CFGNodes whose address is the specified one.
:param addr: Address of the node
:param is_syscall: True returns the syscall node, False returns the normal CFGNode, None returns both
:return: ... | [
"Get",
"all",
"CFGNodes",
"whose",
"address",
"is",
"the",
"specified",
"one",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/cfg/cfg_model.py#L273-L295 | [
"def",
"get_all_nodes",
"(",
"self",
",",
"addr",
",",
"is_syscall",
"=",
"None",
",",
"anyaddr",
"=",
"False",
")",
":",
"results",
"=",
"[",
"]",
"for",
"cfg_node",
"in",
"self",
".",
"graph",
".",
"nodes",
"(",
")",
":",
"if",
"cfg_node",
".",
"... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGModel.get_predecessors | Get predecessors of a node in the control flow graph.
:param CFGNode cfgnode: The node.
:param bool excluding_fakeret: True if you want to exclude all predecessors that is connected to the node
with a fakeret edge.
:param str or None ... | angr/knowledge_plugins/cfg/cfg_model.py | def get_predecessors(self, cfgnode, excluding_fakeret=True, jumpkind=None):
"""
Get predecessors of a node in the control flow graph.
:param CFGNode cfgnode: The node.
:param bool excluding_fakeret: True if you want to exclude all predecessors that is connected to the n... | def get_predecessors(self, cfgnode, excluding_fakeret=True, jumpkind=None):
"""
Get predecessors of a node in the control flow graph.
:param CFGNode cfgnode: The node.
:param bool excluding_fakeret: True if you want to exclude all predecessors that is connected to the n... | [
"Get",
"predecessors",
"of",
"a",
"node",
"in",
"the",
"control",
"flow",
"graph",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/cfg/cfg_model.py#L307-L340 | [
"def",
"get_predecessors",
"(",
"self",
",",
"cfgnode",
",",
"excluding_fakeret",
"=",
"True",
",",
"jumpkind",
"=",
"None",
")",
":",
"if",
"excluding_fakeret",
"and",
"jumpkind",
"==",
"'Ijk_FakeRet'",
":",
"return",
"[",
"]",
"if",
"not",
"excluding_fakeret... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGModel.get_successors | Get successors of a node in the control flow graph.
:param CFGNode node: The node.
:param bool excluding_fakeret: True if you want to exclude all successors that is connected to the node
with a fakeret edge.
:param str or None jump... | angr/knowledge_plugins/cfg/cfg_model.py | def get_successors(self, node, excluding_fakeret=True, jumpkind=None):
"""
Get successors of a node in the control flow graph.
:param CFGNode node: The node.
:param bool excluding_fakeret: True if you want to exclude all successors that is connected to the node
... | def get_successors(self, node, excluding_fakeret=True, jumpkind=None):
"""
Get successors of a node in the control flow graph.
:param CFGNode node: The node.
:param bool excluding_fakeret: True if you want to exclude all successors that is connected to the node
... | [
"Get",
"successors",
"of",
"a",
"node",
"in",
"the",
"control",
"flow",
"graph",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/cfg/cfg_model.py#L342-L376 | [
"def",
"get_successors",
"(",
"self",
",",
"node",
",",
"excluding_fakeret",
"=",
"True",
",",
"jumpkind",
"=",
"None",
")",
":",
"if",
"jumpkind",
"is",
"not",
"None",
":",
"if",
"excluding_fakeret",
"and",
"jumpkind",
"==",
"'Ijk_FakeRet'",
":",
"return",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGModel.get_successors_and_jumpkind | Get a list of tuples where the first element is the successor of the CFG node and the second element is the
jumpkind of the successor.
:param CFGNode node: The node.
:param bool excluding_fakeret: True if you want to exclude all successors that are fall-through successors.
:... | angr/knowledge_plugins/cfg/cfg_model.py | def get_successors_and_jumpkind(self, node, excluding_fakeret=True):
"""
Get a list of tuples where the first element is the successor of the CFG node and the second element is the
jumpkind of the successor.
:param CFGNode node: The node.
:param bool excluding_fakeret... | def get_successors_and_jumpkind(self, node, excluding_fakeret=True):
"""
Get a list of tuples where the first element is the successor of the CFG node and the second element is the
jumpkind of the successor.
:param CFGNode node: The node.
:param bool excluding_fakeret... | [
"Get",
"a",
"list",
"of",
"tuples",
"where",
"the",
"first",
"element",
"is",
"the",
"successor",
"of",
"the",
"CFG",
"node",
"and",
"the",
"second",
"element",
"is",
"the",
"jumpkind",
"of",
"the",
"successor",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/cfg/cfg_model.py#L378-L393 | [
"def",
"get_successors_and_jumpkind",
"(",
"self",
",",
"node",
",",
"excluding_fakeret",
"=",
"True",
")",
":",
"successors",
"=",
"[",
"]",
"for",
"_",
",",
"suc",
",",
"data",
"in",
"self",
".",
"graph",
".",
"out_edges",
"(",
"[",
"node",
"]",
",",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGModel.get_all_predecessors | Get all predecessors of a specific node on the control flow graph.
:param CFGNode cfgnode: The CFGNode object
:return: A list of predecessors in the CFG
:rtype: list | angr/knowledge_plugins/cfg/cfg_model.py | def get_all_predecessors(self, cfgnode):
"""
Get all predecessors of a specific node on the control flow graph.
:param CFGNode cfgnode: The CFGNode object
:return: A list of predecessors in the CFG
:rtype: list
"""
s = set()
for child, parent in networkx.... | def get_all_predecessors(self, cfgnode):
"""
Get all predecessors of a specific node on the control flow graph.
:param CFGNode cfgnode: The CFGNode object
:return: A list of predecessors in the CFG
:rtype: list
"""
s = set()
for child, parent in networkx.... | [
"Get",
"all",
"predecessors",
"of",
"a",
"specific",
"node",
"on",
"the",
"control",
"flow",
"graph",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/cfg/cfg_model.py#L395-L407 | [
"def",
"get_all_predecessors",
"(",
"self",
",",
"cfgnode",
")",
":",
"s",
"=",
"set",
"(",
")",
"for",
"child",
",",
"parent",
"in",
"networkx",
".",
"dfs_predecessors",
"(",
"self",
".",
"graph",
",",
"cfgnode",
")",
".",
"items",
"(",
")",
":",
"s... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGModel.get_branching_nodes | Returns all nodes that has an out degree >= 2 | angr/knowledge_plugins/cfg/cfg_model.py | def get_branching_nodes(self):
"""
Returns all nodes that has an out degree >= 2
"""
nodes = set()
for n in self.graph.nodes():
if self.graph.out_degree(n) >= 2:
nodes.add(n)
return nodes | def get_branching_nodes(self):
"""
Returns all nodes that has an out degree >= 2
"""
nodes = set()
for n in self.graph.nodes():
if self.graph.out_degree(n) >= 2:
nodes.add(n)
return nodes | [
"Returns",
"all",
"nodes",
"that",
"has",
"an",
"out",
"degree",
">",
"=",
"2"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/cfg/cfg_model.py#L416-L424 | [
"def",
"get_branching_nodes",
"(",
"self",
")",
":",
"nodes",
"=",
"set",
"(",
")",
"for",
"n",
"in",
"self",
".",
"graph",
".",
"nodes",
"(",
")",
":",
"if",
"self",
".",
"graph",
".",
"out_degree",
"(",
"n",
")",
">=",
"2",
":",
"nodes",
".",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGModel.get_exit_stmt_idx | Get the corresponding exit statement ID for control flow to reach destination block from source block. The exit
statement ID was put on the edge when creating the CFG.
Note that there must be a direct edge between the two blocks, otherwise an exception will be raised.
:return: The exit statemen... | angr/knowledge_plugins/cfg/cfg_model.py | def get_exit_stmt_idx(self, src_block, dst_block):
"""
Get the corresponding exit statement ID for control flow to reach destination block from source block. The exit
statement ID was put on the edge when creating the CFG.
Note that there must be a direct edge between the two blocks, oth... | def get_exit_stmt_idx(self, src_block, dst_block):
"""
Get the corresponding exit statement ID for control flow to reach destination block from source block. The exit
statement ID was put on the edge when creating the CFG.
Note that there must be a direct edge between the two blocks, oth... | [
"Get",
"the",
"corresponding",
"exit",
"statement",
"ID",
"for",
"control",
"flow",
"to",
"reach",
"destination",
"block",
"from",
"source",
"block",
".",
"The",
"exit",
"statement",
"ID",
"was",
"put",
"on",
"the",
"edge",
"when",
"creating",
"the",
"CFG",
... | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/cfg/cfg_model.py#L426-L438 | [
"def",
"get_exit_stmt_idx",
"(",
"self",
",",
"src_block",
",",
"dst_block",
")",
":",
"if",
"not",
"self",
".",
"graph",
".",
"has_edge",
"(",
"src_block",
",",
"dst_block",
")",
":",
"raise",
"AngrCFGError",
"(",
"'Edge (%s, %s) does not exist in CFG'",
"%",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimEngineSoot.prepare_native_return_state | Hook target for native function call returns.
Recovers and stores the return value from native memory and toggles the
state, s.t. execution continues in the Soot engine. | angr/engines/soot/engine.py | def prepare_native_return_state(native_state):
"""
Hook target for native function call returns.
Recovers and stores the return value from native memory and toggles the
state, s.t. execution continues in the Soot engine.
"""
javavm_simos = native_state.project.simos
... | def prepare_native_return_state(native_state):
"""
Hook target for native function call returns.
Recovers and stores the return value from native memory and toggles the
state, s.t. execution continues in the Soot engine.
"""
javavm_simos = native_state.project.simos
... | [
"Hook",
"target",
"for",
"native",
"function",
"call",
"returns",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/soot/engine.py#L334-L378 | [
"def",
"prepare_native_return_state",
"(",
"native_state",
")",
":",
"javavm_simos",
"=",
"native_state",
".",
"project",
".",
"simos",
"ret_state",
"=",
"native_state",
".",
"copy",
"(",
")",
"# set successor flags",
"ret_state",
".",
"regs",
".",
"_ip",
"=",
"... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimFile.concretize | Return a concretization of the contents of the file, as a flat bytestring. | angr/storage/file.py | def concretize(self, **kwargs):
"""
Return a concretization of the contents of the file, as a flat bytestring.
"""
size = self.state.solver.min(self._size, **kwargs)
data = self.load(0, size)
kwargs['cast_to'] = kwargs.get('cast_to', bytes)
kwargs['extra_constrai... | def concretize(self, **kwargs):
"""
Return a concretization of the contents of the file, as a flat bytestring.
"""
size = self.state.solver.min(self._size, **kwargs)
data = self.load(0, size)
kwargs['cast_to'] = kwargs.get('cast_to', bytes)
kwargs['extra_constrai... | [
"Return",
"a",
"concretization",
"of",
"the",
"contents",
"of",
"the",
"file",
"as",
"a",
"flat",
"bytestring",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/storage/file.py#L215-L224 | [
"def",
"concretize",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"size",
"=",
"self",
".",
"state",
".",
"solver",
".",
"min",
"(",
"self",
".",
"_size",
",",
"*",
"*",
"kwargs",
")",
"data",
"=",
"self",
".",
"load",
"(",
"0",
",",
"size",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimPackets.concretize | Returns a list of the packets read or written as bytestrings. | angr/storage/file.py | def concretize(self, **kwargs):
"""
Returns a list of the packets read or written as bytestrings.
"""
lengths = [self.state.solver.eval(x[1], **kwargs) for x in self.content]
kwargs['cast_to'] = bytes
return [b'' if i == 0 else self.state.solver.eval(x[0][i*self.state.arc... | def concretize(self, **kwargs):
"""
Returns a list of the packets read or written as bytestrings.
"""
lengths = [self.state.solver.eval(x[1], **kwargs) for x in self.content]
kwargs['cast_to'] = bytes
return [b'' if i == 0 else self.state.solver.eval(x[0][i*self.state.arc... | [
"Returns",
"a",
"list",
"of",
"the",
"packets",
"read",
"or",
"written",
"as",
"bytestrings",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/storage/file.py#L405-L411 | [
"def",
"concretize",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"lengths",
"=",
"[",
"self",
".",
"state",
".",
"solver",
".",
"eval",
"(",
"x",
"[",
"1",
"]",
",",
"*",
"*",
"kwargs",
")",
"for",
"x",
"in",
"self",
".",
"content",
"]",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimPackets.read | Read a packet from the stream.
:param int pos: The packet number to read from the sequence of the stream. May be None to append to the stream.
:param size: The size to read. May be symbolic.
:param short_reads: Whether to replace the size with a symbolic value constrained to less tha... | angr/storage/file.py | def read(self, pos, size, **kwargs):
"""
Read a packet from the stream.
:param int pos: The packet number to read from the sequence of the stream. May be None to append to the stream.
:param size: The size to read. May be symbolic.
:param short_reads: Whether to repla... | def read(self, pos, size, **kwargs):
"""
Read a packet from the stream.
:param int pos: The packet number to read from the sequence of the stream. May be None to append to the stream.
:param size: The size to read. May be symbolic.
:param short_reads: Whether to repla... | [
"Read",
"a",
"packet",
"from",
"the",
"stream",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/storage/file.py#L413-L477 | [
"def",
"read",
"(",
"self",
",",
"pos",
",",
"size",
",",
"*",
"*",
"kwargs",
")",
":",
"short_reads",
"=",
"kwargs",
".",
"pop",
"(",
"'short_reads'",
",",
"None",
")",
"# sanity check on read/write modes",
"if",
"self",
".",
"write_mode",
"is",
"None",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimPackets.write | Write a packet to the stream.
:param int pos: The packet number to write in the sequence of the stream. May be None to append to the stream.
:param data: The data to write, as a string or bitvector.
:param size: The optional size to write. May be symbolic; must be constrained ... | angr/storage/file.py | def write(self, pos, data, size=None, events=True, **kwargs):
"""
Write a packet to the stream.
:param int pos: The packet number to write in the sequence of the stream. May be None to append to the stream.
:param data: The data to write, as a string or bitvector.
:pa... | def write(self, pos, data, size=None, events=True, **kwargs):
"""
Write a packet to the stream.
:param int pos: The packet number to write in the sequence of the stream. May be None to append to the stream.
:param data: The data to write, as a string or bitvector.
:pa... | [
"Write",
"a",
"packet",
"to",
"the",
"stream",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/storage/file.py#L479-L521 | [
"def",
"write",
"(",
"self",
",",
"pos",
",",
"data",
",",
"size",
"=",
"None",
",",
"events",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"events",
":",
"self",
".",
"state",
".",
"history",
".",
"add_event",
"(",
"'fs_write'",
",",
"f... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimFileDescriptorBase.read | Reads some data from the file, storing it into memory.
:param pos: The address to write the read data into memory
:param size: The requested length of the read
:return: The real length of the read | angr/storage/file.py | def read(self, pos, size, **kwargs):
"""
Reads some data from the file, storing it into memory.
:param pos: The address to write the read data into memory
:param size: The requested length of the read
:return: The real length of the read
"""
data, r... | def read(self, pos, size, **kwargs):
"""
Reads some data from the file, storing it into memory.
:param pos: The address to write the read data into memory
:param size: The requested length of the read
:return: The real length of the read
"""
data, r... | [
"Reads",
"some",
"data",
"from",
"the",
"file",
"storing",
"it",
"into",
"memory",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/storage/file.py#L605-L616 | [
"def",
"read",
"(",
"self",
",",
"pos",
",",
"size",
",",
"*",
"*",
"kwargs",
")",
":",
"data",
",",
"realsize",
"=",
"self",
".",
"read_data",
"(",
"size",
",",
"*",
"*",
"kwargs",
")",
"if",
"not",
"self",
".",
"state",
".",
"solver",
".",
"i... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimFileDescriptorBase.write | Writes some data, loaded from the state, into the file.
:param pos: The address to read the data to write from in memory
:param size: The requested size of the write
:return: The real length of the write | angr/storage/file.py | def write(self, pos, size, **kwargs):
"""
Writes some data, loaded from the state, into the file.
:param pos: The address to read the data to write from in memory
:param size: The requested size of the write
:return: The real length of the write
"""
... | def write(self, pos, size, **kwargs):
"""
Writes some data, loaded from the state, into the file.
:param pos: The address to read the data to write from in memory
:param size: The requested size of the write
:return: The real length of the write
"""
... | [
"Writes",
"some",
"data",
"loaded",
"from",
"the",
"state",
"into",
"the",
"file",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/storage/file.py#L618-L645 | [
"def",
"write",
"(",
"self",
",",
"pos",
",",
"size",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"type",
"(",
"pos",
")",
"is",
"str",
":",
"raise",
"TypeError",
"(",
"\"SimFileDescriptor.write takes an address and size. Did you mean write_data?\"",
")",
"# Find a... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimFileDescriptorDuplex.concretize | Return a concretization of the underlying files, as a tuple of (read file, write file). | angr/storage/file.py | def concretize(self, **kwargs):
"""
Return a concretization of the underlying files, as a tuple of (read file, write file).
"""
return (self._read_file.concretize(**kwargs), self._write_file.concretize(**kwargs)) | def concretize(self, **kwargs):
"""
Return a concretization of the underlying files, as a tuple of (read file, write file).
"""
return (self._read_file.concretize(**kwargs), self._write_file.concretize(**kwargs)) | [
"Return",
"a",
"concretization",
"of",
"the",
"underlying",
"files",
"as",
"a",
"tuple",
"of",
"(",
"read",
"file",
"write",
"file",
")",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/storage/file.py#L933-L937 | [
"def",
"concretize",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"(",
"self",
".",
"_read_file",
".",
"concretize",
"(",
"*",
"*",
"kwargs",
")",
",",
"self",
".",
"_write_file",
".",
"concretize",
"(",
"*",
"*",
"kwargs",
")",
")"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimStateCGC.get_max_sinkhole | Find a sinkhole which is large enough to support `length` bytes.
This uses first-fit. The first sinkhole (ordered in descending order by their address)
which can hold `length` bytes is chosen. If there are more than `length` bytes in the
sinkhole, a new sinkhole is created representing the rema... | angr/state_plugins/cgc.py | def get_max_sinkhole(self, length):
"""
Find a sinkhole which is large enough to support `length` bytes.
This uses first-fit. The first sinkhole (ordered in descending order by their address)
which can hold `length` bytes is chosen. If there are more than `length` bytes in the
s... | def get_max_sinkhole(self, length):
"""
Find a sinkhole which is large enough to support `length` bytes.
This uses first-fit. The first sinkhole (ordered in descending order by their address)
which can hold `length` bytes is chosen. If there are more than `length` bytes in the
s... | [
"Find",
"a",
"sinkhole",
"which",
"is",
"large",
"enough",
"to",
"support",
"length",
"bytes",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/cgc.py#L101-L130 | [
"def",
"get_max_sinkhole",
"(",
"self",
",",
"length",
")",
":",
"ordered_sinks",
"=",
"sorted",
"(",
"list",
"(",
"self",
".",
"sinkholes",
")",
",",
"key",
"=",
"operator",
".",
"itemgetter",
"(",
"0",
")",
",",
"reverse",
"=",
"True",
")",
"max_pair... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimStatePlugin.memo | A decorator function you should apply to ``copy`` | angr/state_plugins/plugin.py | def memo(f):
"""
A decorator function you should apply to ``copy``
"""
def inner(self, memo=None, **kwargs):
if memo is None:
memo = {}
if id(self) in memo:
return memo[id(self)]
else:
c = f(self, memo, *... | def memo(f):
"""
A decorator function you should apply to ``copy``
"""
def inner(self, memo=None, **kwargs):
if memo is None:
memo = {}
if id(self) in memo:
return memo[id(self)]
else:
c = f(self, memo, *... | [
"A",
"decorator",
"function",
"you",
"should",
"apply",
"to",
"copy"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/plugin.py#L48-L61 | [
"def",
"memo",
"(",
"f",
")",
":",
"def",
"inner",
"(",
"self",
",",
"memo",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"memo",
"is",
"None",
":",
"memo",
"=",
"{",
"}",
"if",
"id",
"(",
"self",
")",
"in",
"memo",
":",
"return",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFGNode.append_state | Appended a new state to this VFGNode.
:param s: The new state to append
:param is_widened_state: Whether it is a widened state or not. | angr/analyses/vfg.py | def append_state(self, s, is_widened_state=False):
"""
Appended a new state to this VFGNode.
:param s: The new state to append
:param is_widened_state: Whether it is a widened state or not.
"""
if not is_widened_state:
self.all_states.append(s)
se... | def append_state(self, s, is_widened_state=False):
"""
Appended a new state to this VFGNode.
:param s: The new state to append
:param is_widened_state: Whether it is a widened state or not.
"""
if not is_widened_state:
self.all_states.append(s)
se... | [
"Appended",
"a",
"new",
"state",
"to",
"this",
"VFGNode",
".",
":",
"param",
"s",
":",
"The",
"new",
"state",
"to",
"append",
":",
"param",
"is_widened_state",
":",
"Whether",
"it",
"is",
"a",
"widened",
"state",
"or",
"not",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L222-L234 | [
"def",
"append_state",
"(",
"self",
",",
"s",
",",
"is_widened_state",
"=",
"False",
")",
":",
"if",
"not",
"is_widened_state",
":",
"self",
".",
"all_states",
".",
"append",
"(",
"s",
")",
"self",
".",
"state",
"=",
"s",
"else",
":",
"self",
".",
"w... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._top_function_analysis_task | Get the first FunctionAnalysis task in the stack.
:return: The top function analysis task in the stack, or None if there isn't any.
:rtype: FunctionAnalysis | angr/analyses/vfg.py | def _top_function_analysis_task(self):
"""
Get the first FunctionAnalysis task in the stack.
:return: The top function analysis task in the stack, or None if there isn't any.
:rtype: FunctionAnalysis
"""
for r in reversed(self._task_stack):
if isinstance(r, ... | def _top_function_analysis_task(self):
"""
Get the first FunctionAnalysis task in the stack.
:return: The top function analysis task in the stack, or None if there isn't any.
:rtype: FunctionAnalysis
"""
for r in reversed(self._task_stack):
if isinstance(r, ... | [
"Get",
"the",
"first",
"FunctionAnalysis",
"task",
"in",
"the",
"stack",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L384-L395 | [
"def",
"_top_function_analysis_task",
"(",
"self",
")",
":",
"for",
"r",
"in",
"reversed",
"(",
"self",
".",
"_task_stack",
")",
":",
"if",
"isinstance",
"(",
"r",
",",
"FunctionAnalysis",
")",
":",
"return",
"r",
"return",
"None"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG.get_any_node | Get any VFG node corresponding to the basic block at @addr.
Note that depending on the context sensitivity level, there might be
multiple nodes corresponding to different contexts. This function will
return the first one it encounters, which might not be what you want. | angr/analyses/vfg.py | def get_any_node(self, addr):
"""
Get any VFG node corresponding to the basic block at @addr.
Note that depending on the context sensitivity level, there might be
multiple nodes corresponding to different contexts. This function will
return the first one it encounters, which migh... | def get_any_node(self, addr):
"""
Get any VFG node corresponding to the basic block at @addr.
Note that depending on the context sensitivity level, there might be
multiple nodes corresponding to different contexts. This function will
return the first one it encounters, which migh... | [
"Get",
"any",
"VFG",
"node",
"corresponding",
"to",
"the",
"basic",
"block",
"at"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L409-L418 | [
"def",
"get_any_node",
"(",
"self",
",",
"addr",
")",
":",
"for",
"n",
"in",
"self",
".",
"graph",
".",
"nodes",
"(",
")",
":",
"if",
"n",
".",
"addr",
"==",
"addr",
":",
"return",
"n"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._pre_analysis | Executed before analysis starts. Necessary initializations are performed here.
:return: None | angr/analyses/vfg.py | def _pre_analysis(self):
"""
Executed before analysis starts. Necessary initializations are performed here.
:return: None
"""
l.debug("Starting from %#x", self._start)
# initialize the task stack
self._task_stack = [ ]
# initialize the execution counte... | def _pre_analysis(self):
"""
Executed before analysis starts. Necessary initializations are performed here.
:return: None
"""
l.debug("Starting from %#x", self._start)
# initialize the task stack
self._task_stack = [ ]
# initialize the execution counte... | [
"Executed",
"before",
"analysis",
"starts",
".",
"Necessary",
"initializations",
"are",
"performed",
"here",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L446-L511 | [
"def",
"_pre_analysis",
"(",
"self",
")",
":",
"l",
".",
"debug",
"(",
"\"Starting from %#x\"",
",",
"self",
".",
"_start",
")",
"# initialize the task stack",
"self",
".",
"_task_stack",
"=",
"[",
"]",
"# initialize the execution counter dict",
"self",
".",
"_exe... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._job_sorting_key | Get the sorting key of a VFGJob instance.
:param VFGJob job: the VFGJob object.
:return: An integer that determines the order of this job in the queue.
:rtype: int | angr/analyses/vfg.py | def _job_sorting_key(self, job):
"""
Get the sorting key of a VFGJob instance.
:param VFGJob job: the VFGJob object.
:return: An integer that determines the order of this job in the queue.
:rtype: int
"""
MAX_BLOCKS_PER_FUNCTION = 1000000
task_functions... | def _job_sorting_key(self, job):
"""
Get the sorting key of a VFGJob instance.
:param VFGJob job: the VFGJob object.
:return: An integer that determines the order of this job in the queue.
:rtype: int
"""
MAX_BLOCKS_PER_FUNCTION = 1000000
task_functions... | [
"Get",
"the",
"sorting",
"key",
"of",
"a",
"VFGJob",
"instance",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L513-L542 | [
"def",
"_job_sorting_key",
"(",
"self",
",",
"job",
")",
":",
"MAX_BLOCKS_PER_FUNCTION",
"=",
"1000000",
"task_functions",
"=",
"list",
"(",
"reversed",
"(",
"list",
"(",
"task",
".",
"function_address",
"for",
"task",
"in",
"self",
".",
"_task_stack",
"if",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._pre_job_handling | Some code executed before actually processing the job.
:param VFGJob job: the VFGJob object.
:return: None | angr/analyses/vfg.py | def _pre_job_handling(self, job):
"""
Some code executed before actually processing the job.
:param VFGJob job: the VFGJob object.
:return: None
"""
# did we reach the final address?
if self._final_address is not None and job.addr == self._final_address:
... | def _pre_job_handling(self, job):
"""
Some code executed before actually processing the job.
:param VFGJob job: the VFGJob object.
:return: None
"""
# did we reach the final address?
if self._final_address is not None and job.addr == self._final_address:
... | [
"Some",
"code",
"executed",
"before",
"actually",
"processing",
"the",
"job",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L557-L671 | [
"def",
"_pre_job_handling",
"(",
"self",
",",
"job",
")",
":",
"# did we reach the final address?",
"if",
"self",
".",
"_final_address",
"is",
"not",
"None",
"and",
"job",
".",
"addr",
"==",
"self",
".",
"_final_address",
":",
"# our analysis should be termianted he... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._handle_successor | Process each successor generated by the job, and return a new list of succeeding jobs.
:param VFGJob job: The VFGJob instance.
:param SimState successor: The succeeding state.
:param list all_successors: A list of all successors.
:return: A list of newly created jobs from the successor... | angr/analyses/vfg.py | def _handle_successor(self, job, successor, all_successors):
"""
Process each successor generated by the job, and return a new list of succeeding jobs.
:param VFGJob job: The VFGJob instance.
:param SimState successor: The succeeding state.
:param list all_successors: A list of... | def _handle_successor(self, job, successor, all_successors):
"""
Process each successor generated by the job, and return a new list of succeeding jobs.
:param VFGJob job: The VFGJob instance.
:param SimState successor: The succeeding state.
:param list all_successors: A list of... | [
"Process",
"each",
"successor",
"generated",
"by",
"the",
"job",
"and",
"return",
"a",
"new",
"list",
"of",
"succeeding",
"jobs",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L729-L864 | [
"def",
"_handle_successor",
"(",
"self",
",",
"job",
",",
"successor",
",",
"all_successors",
")",
":",
"# Initialize parameters",
"addr",
"=",
"job",
".",
"addr",
"jumpkind",
"=",
"successor",
".",
"history",
".",
"jumpkind",
"#",
"# Get instruction pointer",
"... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._handle_successor_multitargets | Generate new jobs for all possible successor targets when there are more than one possible concrete value for
successor.ip
:param VFGJob job: The VFGJob instance.
:param SimState successor: The succeeding state.
:param list all_successors: All succeeding states from the same VFGJob.
... | angr/analyses/vfg.py | def _handle_successor_multitargets(self, job, successor, all_successors):
"""
Generate new jobs for all possible successor targets when there are more than one possible concrete value for
successor.ip
:param VFGJob job: The VFGJob instance.
:param SimState successor: The succeed... | def _handle_successor_multitargets(self, job, successor, all_successors):
"""
Generate new jobs for all possible successor targets when there are more than one possible concrete value for
successor.ip
:param VFGJob job: The VFGJob instance.
:param SimState successor: The succeed... | [
"Generate",
"new",
"jobs",
"for",
"all",
"possible",
"successor",
"targets",
"when",
"there",
"are",
"more",
"than",
"one",
"possible",
"concrete",
"value",
"for",
"successor",
".",
"ip"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L866-L912 | [
"def",
"_handle_successor_multitargets",
"(",
"self",
",",
"job",
",",
"successor",
",",
"all_successors",
")",
":",
"new_jobs",
"=",
"[",
"]",
"# Currently we assume a legit jumping target cannot have more than 256 concrete values",
"# TODO: make it a setting on VFG",
"MAX_NUMBE... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._merge_states | Merge two given states, and return a new one.
:param old_state:
:param new_state:
:returns: The merged state, and whether a merging has occurred | angr/analyses/vfg.py | def _merge_states(self, old_state, new_state):
"""
Merge two given states, and return a new one.
:param old_state:
:param new_state:
:returns: The merged state, and whether a merging has occurred
"""
# print old_state.dbg_print_stack()
# print new_state.... | def _merge_states(self, old_state, new_state):
"""
Merge two given states, and return a new one.
:param old_state:
:param new_state:
:returns: The merged state, and whether a merging has occurred
"""
# print old_state.dbg_print_stack()
# print new_state.... | [
"Merge",
"two",
"given",
"states",
"and",
"return",
"a",
"new",
"one",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L1088-L1105 | [
"def",
"_merge_states",
"(",
"self",
",",
"old_state",
",",
"new_state",
")",
":",
"# print old_state.dbg_print_stack()",
"# print new_state.dbg_print_stack()",
"merged_state",
",",
"_",
",",
"merging_occurred",
"=",
"old_state",
".",
"merge",
"(",
"new_state",
",",
"... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._widen_states | Perform widen operation on the given states, and return a new one.
:param old_state:
:param new_state:
:returns: The widened state, and whether widening has occurred | angr/analyses/vfg.py | def _widen_states(old_state, new_state):
"""
Perform widen operation on the given states, and return a new one.
:param old_state:
:param new_state:
:returns: The widened state, and whether widening has occurred
"""
# print old_state.dbg_print_stack()
# p... | def _widen_states(old_state, new_state):
"""
Perform widen operation on the given states, and return a new one.
:param old_state:
:param new_state:
:returns: The widened state, and whether widening has occurred
"""
# print old_state.dbg_print_stack()
# p... | [
"Perform",
"widen",
"operation",
"on",
"the",
"given",
"states",
"and",
"return",
"a",
"new",
"one",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L1108-L1127 | [
"def",
"_widen_states",
"(",
"old_state",
",",
"new_state",
")",
":",
"# print old_state.dbg_print_stack()",
"# print new_state.dbg_print_stack()",
"l",
".",
"debug",
"(",
"'Widening state at IP %s'",
",",
"old_state",
".",
"ip",
")",
"widened_state",
",",
"widening_occur... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._narrow_states | Try to narrow the state!
:param old_state:
:param new_state:
:param previously_widened_state:
:returns: The narrowed state, and whether a narrowing has occurred | angr/analyses/vfg.py | def _narrow_states(node, old_state, new_state, previously_widened_state): # pylint:disable=unused-argument,no-self-use
"""
Try to narrow the state!
:param old_state:
:param new_state:
:param previously_widened_state:
:returns: The narrowed state, and whether a narrowing... | def _narrow_states(node, old_state, new_state, previously_widened_state): # pylint:disable=unused-argument,no-self-use
"""
Try to narrow the state!
:param old_state:
:param new_state:
:param previously_widened_state:
:returns: The narrowed state, and whether a narrowing... | [
"Try",
"to",
"narrow",
"the",
"state!"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L1130-L1148 | [
"def",
"_narrow_states",
"(",
"node",
",",
"old_state",
",",
"new_state",
",",
"previously_widened_state",
")",
":",
"# pylint:disable=unused-argument,no-self-use",
"l",
".",
"debug",
"(",
"'Narrowing state at IP %s'",
",",
"previously_widened_state",
".",
"ip",
")",
"s... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._prepare_initial_state | Get the state to start the analysis for function.
:param int function_start: Address of the function
:param SimState state: The program state to base on. | angr/analyses/vfg.py | def _prepare_initial_state(self, function_start, state):
"""
Get the state to start the analysis for function.
:param int function_start: Address of the function
:param SimState state: The program state to base on.
"""
if state is None:
state = self.project.... | def _prepare_initial_state(self, function_start, state):
"""
Get the state to start the analysis for function.
:param int function_start: Address of the function
:param SimState state: The program state to base on.
"""
if state is None:
state = self.project.... | [
"Get",
"the",
"state",
"to",
"start",
"the",
"analysis",
"for",
"function",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L1154-L1185 | [
"def",
"_prepare_initial_state",
"(",
"self",
",",
"function_start",
",",
"state",
")",
":",
"if",
"state",
"is",
"None",
":",
"state",
"=",
"self",
".",
"project",
".",
"factory",
".",
"blank_state",
"(",
"mode",
"=",
"\"static\"",
",",
"remove_options",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._set_return_address | Set the return address of the current state to a specific address. We assume we are at the beginning of a
function, or in other words, we are about to execute the very first instruction of the function.
:param SimState state: The program state
:param int ret_addr: The return address
:re... | angr/analyses/vfg.py | def _set_return_address(self, state, ret_addr):
"""
Set the return address of the current state to a specific address. We assume we are at the beginning of a
function, or in other words, we are about to execute the very first instruction of the function.
:param SimState state: The progr... | def _set_return_address(self, state, ret_addr):
"""
Set the return address of the current state to a specific address. We assume we are at the beginning of a
function, or in other words, we are about to execute the very first instruction of the function.
:param SimState state: The progr... | [
"Set",
"the",
"return",
"address",
"of",
"the",
"current",
"state",
"to",
"a",
"specific",
"address",
".",
"We",
"assume",
"we",
"are",
"at",
"the",
"beginning",
"of",
"a",
"function",
"or",
"in",
"other",
"words",
"we",
"are",
"about",
"to",
"execute",
... | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L1187-L1213 | [
"def",
"_set_return_address",
"(",
"self",
",",
"state",
",",
"ret_addr",
")",
":",
"# TODO: the following code is totally untested other than X86 and AMD64. Don't freak out if you find bugs :)",
"# TODO: Test it",
"ret_bvv",
"=",
"state",
".",
"solver",
".",
"BVV",
"(",
"ret... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._create_graph | Create a DiGraph out of the existing edge map.
:param return_target_sources: Used for making up those missing returns
:returns: A networkx.DiGraph() object | angr/analyses/vfg.py | def _create_graph(self, return_target_sources=None):
"""
Create a DiGraph out of the existing edge map.
:param return_target_sources: Used for making up those missing returns
:returns: A networkx.DiGraph() object
"""
if return_target_sources is None:
# We set ... | def _create_graph(self, return_target_sources=None):
"""
Create a DiGraph out of the existing edge map.
:param return_target_sources: Used for making up those missing returns
:returns: A networkx.DiGraph() object
"""
if return_target_sources is None:
# We set ... | [
"Create",
"a",
"DiGraph",
"out",
"of",
"the",
"existing",
"edge",
"map",
".",
":",
"param",
"return_target_sources",
":",
"Used",
"for",
"making",
"up",
"those",
"missing",
"returns",
":",
"returns",
":",
"A",
"networkx",
".",
"DiGraph",
"()",
"object"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L1215-L1259 | [
"def",
"_create_graph",
"(",
"self",
",",
"return_target_sources",
"=",
"None",
")",
":",
"if",
"return_target_sources",
"is",
"None",
":",
"# We set it to a defaultdict in order to be consistent with the",
"# actual parameter.",
"return_target_sources",
"=",
"defaultdict",
"... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._graph_get_node | Get an existing VFGNode instance from the graph.
:param BlockID block_id: The block ID for the node to get.
:param bool terminator_for_nonexistent_node: True if a Terminator (which is a SimProcedure stub) should be
created when th... | angr/analyses/vfg.py | def _graph_get_node(self, block_id, terminator_for_nonexistent_node=False):
"""
Get an existing VFGNode instance from the graph.
:param BlockID block_id: The block ID for the node to get.
:param bool terminator_for_nonexistent_node: True if a Terminator (which is a S... | def _graph_get_node(self, block_id, terminator_for_nonexistent_node=False):
"""
Get an existing VFGNode instance from the graph.
:param BlockID block_id: The block ID for the node to get.
:param bool terminator_for_nonexistent_node: True if a Terminator (which is a S... | [
"Get",
"an",
"existing",
"VFGNode",
"instance",
"from",
"the",
"graph",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L1265-L1301 | [
"def",
"_graph_get_node",
"(",
"self",
",",
"block_id",
",",
"terminator_for_nonexistent_node",
"=",
"False",
")",
":",
"if",
"block_id",
"not",
"in",
"self",
".",
"_nodes",
":",
"l",
".",
"error",
"(",
"\"Trying to look up a node that we don't have yet. Is this okay?... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._graph_add_edge | Add an edge onto the graph.
:param BlockID src_block_id: The block ID for source node.
:param BlockID dst_block_id: The block Id for destination node.
:param str jumpkind: The jumpkind of the edge.
:param exit_stmt_idx: ID of the statement in the source IRSB where this ed... | angr/analyses/vfg.py | def _graph_add_edge(self, src_block_id, dst_block_id, **kwargs):
"""
Add an edge onto the graph.
:param BlockID src_block_id: The block ID for source node.
:param BlockID dst_block_id: The block Id for destination node.
:param str jumpkind: The jumpkind of the edge.
... | def _graph_add_edge(self, src_block_id, dst_block_id, **kwargs):
"""
Add an edge onto the graph.
:param BlockID src_block_id: The block ID for source node.
:param BlockID dst_block_id: The block Id for destination node.
:param str jumpkind: The jumpkind of the edge.
... | [
"Add",
"an",
"edge",
"onto",
"the",
"graph",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L1303-L1322 | [
"def",
"_graph_add_edge",
"(",
"self",
",",
"src_block_id",
",",
"dst_block_id",
",",
"*",
"*",
"kwargs",
")",
":",
"dst_node",
"=",
"self",
".",
"_graph_get_node",
"(",
"dst_block_id",
",",
"terminator_for_nonexistent_node",
"=",
"True",
")",
"if",
"src_block_i... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._create_new_jobs | Create a list of new VFG jobs for the successor state.
:param VFGJob job: The VFGJob instance.
:param SimState successor: The succeeding state.
:param BlockID new_block_id: Block ID for the new VFGJob
:param new_call_stack: The new callstack.
:r... | angr/analyses/vfg.py | def _create_new_jobs(self, job, successor, new_block_id, new_call_stack):
"""
Create a list of new VFG jobs for the successor state.
:param VFGJob job: The VFGJob instance.
:param SimState successor: The succeeding state.
:param BlockID new_block_id: Block ... | def _create_new_jobs(self, job, successor, new_block_id, new_call_stack):
"""
Create a list of new VFG jobs for the successor state.
:param VFGJob job: The VFGJob instance.
:param SimState successor: The succeeding state.
:param BlockID new_block_id: Block ... | [
"Create",
"a",
"list",
"of",
"new",
"VFG",
"jobs",
"for",
"the",
"successor",
"state",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L1375-L1535 | [
"def",
"_create_new_jobs",
"(",
"self",
",",
"job",
",",
"successor",
",",
"new_block_id",
",",
"new_call_stack",
")",
":",
"# TODO: basic block stack is probably useless",
"jumpkind",
"=",
"successor",
".",
"history",
".",
"jumpkind",
"stmt_idx",
"=",
"successor",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._remove_pending_return | Remove all pending returns that are related to the current job. | angr/analyses/vfg.py | def _remove_pending_return(self, job, pending_returns):
"""
Remove all pending returns that are related to the current job.
"""
# Build the tuples that we want to remove from the dict fake_func_retn_exits
tpls_to_remove = [ ]
call_stack_copy = job.call_stack_copy()
... | def _remove_pending_return(self, job, pending_returns):
"""
Remove all pending returns that are related to the current job.
"""
# Build the tuples that we want to remove from the dict fake_func_retn_exits
tpls_to_remove = [ ]
call_stack_copy = job.call_stack_copy()
... | [
"Remove",
"all",
"pending",
"returns",
"that",
"are",
"related",
"to",
"the",
"current",
"job",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L1537-L1558 | [
"def",
"_remove_pending_return",
"(",
"self",
",",
"job",
",",
"pending_returns",
")",
":",
"# Build the tuples that we want to remove from the dict fake_func_retn_exits",
"tpls_to_remove",
"=",
"[",
"]",
"call_stack_copy",
"=",
"job",
".",
"call_stack_copy",
"(",
")",
"w... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._post_job_handling_debug | Print out debugging information after handling a VFGJob and generating the succeeding jobs.
:param VFGJob job: The VFGJob instance.
:param list successors: A list of succeeding states.
:return: None | angr/analyses/vfg.py | def _post_job_handling_debug(self, job, successors):
"""
Print out debugging information after handling a VFGJob and generating the succeeding jobs.
:param VFGJob job: The VFGJob instance.
:param list successors: A list of succeeding states.
:return: None
"""
fu... | def _post_job_handling_debug(self, job, successors):
"""
Print out debugging information after handling a VFGJob and generating the succeeding jobs.
:param VFGJob job: The VFGJob instance.
:param list successors: A list of succeeding states.
:return: None
"""
fu... | [
"Print",
"out",
"debugging",
"information",
"after",
"handling",
"a",
"VFGJob",
"and",
"generating",
"the",
"succeeding",
"jobs",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L1560-L1590 | [
"def",
"_post_job_handling_debug",
"(",
"self",
",",
"job",
",",
"successors",
")",
":",
"func",
"=",
"self",
".",
"project",
".",
"loader",
".",
"find_symbol",
"(",
"job",
".",
"addr",
")",
"function_name",
"=",
"func",
".",
"name",
"if",
"func",
"is",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._save_function_initial_state | Save the initial state of a function, and merge it with existing ones if there are any.
:param FunctionKey function_key: The key to this function.
:param int function_address: Address of the function.
:param SimState state: Initial state of the function.
:return: None | angr/analyses/vfg.py | def _save_function_initial_state(self, function_key, function_address, state):
"""
Save the initial state of a function, and merge it with existing ones if there are any.
:param FunctionKey function_key: The key to this function.
:param int function_address: Address of the function.
... | def _save_function_initial_state(self, function_key, function_address, state):
"""
Save the initial state of a function, and merge it with existing ones if there are any.
:param FunctionKey function_key: The key to this function.
:param int function_address: Address of the function.
... | [
"Save",
"the",
"initial",
"state",
"of",
"a",
"function",
"and",
"merge",
"it",
"with",
"existing",
"ones",
"if",
"there",
"are",
"any",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L1660-L1680 | [
"def",
"_save_function_initial_state",
"(",
"self",
",",
"function_key",
",",
"function_address",
",",
"state",
")",
":",
"l",
".",
"debug",
"(",
"'Saving the initial state for function %#08x with function key %s'",
",",
"function_address",
",",
"function_key",
")",
"if",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._save_function_final_state | Save the final state of a function, and merge it with existing ones if there are any.
:param FunctionKey function_key: The key to this function.
:param int function_address: Address of the function.
:param SimState state: Initial state of the function.
:return: None | angr/analyses/vfg.py | def _save_function_final_state(self, function_key, function_address, state):
"""
Save the final state of a function, and merge it with existing ones if there are any.
:param FunctionKey function_key: The key to this function.
:param int function_address: Address of the function.
... | def _save_function_final_state(self, function_key, function_address, state):
"""
Save the final state of a function, and merge it with existing ones if there are any.
:param FunctionKey function_key: The key to this function.
:param int function_address: Address of the function.
... | [
"Save",
"the",
"final",
"state",
"of",
"a",
"function",
"and",
"merge",
"it",
"with",
"existing",
"ones",
"if",
"there",
"are",
"any",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L1682-L1703 | [
"def",
"_save_function_final_state",
"(",
"self",
",",
"function_key",
",",
"function_address",
",",
"state",
")",
":",
"l",
".",
"debug",
"(",
"'Saving the final state for function %#08x with function key %s'",
",",
"function_address",
",",
"function_key",
")",
"if",
"... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._get_nx_paths | Get the possible (networkx) simple paths between two nodes or addresses
corresponding to nodes.
Input: addresses or node instances
Return: a list of lists of nodes representing paths. | angr/analyses/vfg.py | def _get_nx_paths(self, begin, end):
"""
Get the possible (networkx) simple paths between two nodes or addresses
corresponding to nodes.
Input: addresses or node instances
Return: a list of lists of nodes representing paths.
"""
if type(begin) is int and type(end)... | def _get_nx_paths(self, begin, end):
"""
Get the possible (networkx) simple paths between two nodes or addresses
corresponding to nodes.
Input: addresses or node instances
Return: a list of lists of nodes representing paths.
"""
if type(begin) is int and type(end)... | [
"Get",
"the",
"possible",
"(",
"networkx",
")",
"simple",
"paths",
"between",
"two",
"nodes",
"or",
"addresses",
"corresponding",
"to",
"nodes",
".",
"Input",
":",
"addresses",
"or",
"node",
"instances",
"Return",
":",
"a",
"list",
"of",
"lists",
"of",
"no... | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L1746-L1763 | [
"def",
"_get_nx_paths",
"(",
"self",
",",
"begin",
",",
"end",
")",
":",
"if",
"type",
"(",
"begin",
")",
"is",
"int",
"and",
"type",
"(",
"end",
")",
"is",
"int",
":",
"# pylint:disable=unidiomatic-typecheck",
"n_begin",
"=",
"self",
".",
"get_any_node",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._merge_points | Return the ordered merge points for a specific function.
:param int function_address: Address of the querying function.
:return: A list of sorted merge points (addresses).
:rtype: list | angr/analyses/vfg.py | def _merge_points(self, function_address):
"""
Return the ordered merge points for a specific function.
:param int function_address: Address of the querying function.
:return: A list of sorted merge points (addresses).
:rtype: list
"""
# we are entering a new fu... | def _merge_points(self, function_address):
"""
Return the ordered merge points for a specific function.
:param int function_address: Address of the querying function.
:return: A list of sorted merge points (addresses).
:rtype: list
"""
# we are entering a new fu... | [
"Return",
"the",
"ordered",
"merge",
"points",
"for",
"a",
"specific",
"function",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L1765-L1787 | [
"def",
"_merge_points",
"(",
"self",
",",
"function_address",
")",
":",
"# we are entering a new function. now it's time to figure out how to optimally traverse the control flow",
"# graph by generating the sorted merge points",
"try",
":",
"new_function",
"=",
"self",
".",
"kb",
"... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._widening_points | Return the ordered widening points for a specific function.
:param int function_address: Address of the querying function.
:return: A list of sorted merge points (addresses).
:rtype: list | angr/analyses/vfg.py | def _widening_points(self, function_address):
"""
Return the ordered widening points for a specific function.
:param int function_address: Address of the querying function.
:return: A list of sorted merge points (addresses).
:rtype: list
"""
# we are entering a ... | def _widening_points(self, function_address):
"""
Return the ordered widening points for a specific function.
:param int function_address: Address of the querying function.
:return: A list of sorted merge points (addresses).
:rtype: list
"""
# we are entering a ... | [
"Return",
"the",
"ordered",
"widening",
"points",
"for",
"a",
"specific",
"function",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L1789-L1813 | [
"def",
"_widening_points",
"(",
"self",
",",
"function_address",
")",
":",
"# we are entering a new function. now it's time to figure out how to optimally traverse the control flow",
"# graph by generating the sorted merge points",
"try",
":",
"new_function",
"=",
"self",
".",
"kb",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VFG._ordered_node_addrs | For a given function, return all nodes in an optimal traversal order. If the function does not exist, return an
empty list.
:param int function_address: Address of the function.
:return: A ordered list of the nodes.
:rtype: list | angr/analyses/vfg.py | def _ordered_node_addrs(self, function_address):
"""
For a given function, return all nodes in an optimal traversal order. If the function does not exist, return an
empty list.
:param int function_address: Address of the function.
:return: A ordered list of the nodes.
:r... | def _ordered_node_addrs(self, function_address):
"""
For a given function, return all nodes in an optimal traversal order. If the function does not exist, return an
empty list.
:param int function_address: Address of the function.
:return: A ordered list of the nodes.
:r... | [
"For",
"a",
"given",
"function",
"return",
"all",
"nodes",
"in",
"an",
"optimal",
"traversal",
"order",
".",
"If",
"the",
"function",
"does",
"not",
"exist",
"return",
"an",
"empty",
"list",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vfg.py#L1815-L1835 | [
"def",
"_ordered_node_addrs",
"(",
"self",
",",
"function_address",
")",
":",
"try",
":",
"function",
"=",
"self",
".",
"kb",
".",
"functions",
"[",
"function_address",
"]",
"except",
"KeyError",
":",
"# the function does not exist",
"return",
"[",
"]",
"if",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimUCManager.assign | Assign a new region for under-constrained symbolic execution.
:param dst_addr_ast: the symbolic AST which address of the new allocated region will be assigned to.
:return: as ast of memory address that points to a new region | angr/state_plugins/uc_manager.py | def assign(self, dst_addr_ast):
"""
Assign a new region for under-constrained symbolic execution.
:param dst_addr_ast: the symbolic AST which address of the new allocated region will be assigned to.
:return: as ast of memory address that points to a new region
"""
if ds... | def assign(self, dst_addr_ast):
"""
Assign a new region for under-constrained symbolic execution.
:param dst_addr_ast: the symbolic AST which address of the new allocated region will be assigned to.
:return: as ast of memory address that points to a new region
"""
if ds... | [
"Assign",
"a",
"new",
"region",
"for",
"under",
"-",
"constrained",
"symbolic",
"execution",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/uc_manager.py#L33-L52 | [
"def",
"assign",
"(",
"self",
",",
"dst_addr_ast",
")",
":",
"if",
"dst_addr_ast",
".",
"uc_alloc_depth",
">",
"self",
".",
"_max_alloc_depth",
":",
"raise",
"SimUCManagerAllocationError",
"(",
"'Current allocation depth %d is greater than the cap (%d)'",
"%",
"(",
"dst... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimUCManager.is_bounded | Test whether an AST is bounded by any existing constraint in the related solver.
:param ast: an claripy.AST object
:return: True if there is at least one related constraint, False otherwise | angr/state_plugins/uc_manager.py | def is_bounded(self, ast):
"""
Test whether an AST is bounded by any existing constraint in the related solver.
:param ast: an claripy.AST object
:return: True if there is at least one related constraint, False otherwise
"""
return len(ast.variables.intersection(self.st... | def is_bounded(self, ast):
"""
Test whether an AST is bounded by any existing constraint in the related solver.
:param ast: an claripy.AST object
:return: True if there is at least one related constraint, False otherwise
"""
return len(ast.variables.intersection(self.st... | [
"Test",
"whether",
"an",
"AST",
"is",
"bounded",
"by",
"any",
"existing",
"constraint",
"in",
"the",
"related",
"solver",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/uc_manager.py#L66-L74 | [
"def",
"is_bounded",
"(",
"self",
",",
"ast",
")",
":",
"return",
"len",
"(",
"ast",
".",
"variables",
".",
"intersection",
"(",
"self",
".",
"state",
".",
"solver",
".",
"_solver",
".",
"variables",
")",
")",
"!=",
"0"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | MipsElfFastResolver.resolve | Resolves the indirect jump in MIPS ELF binaries where all external function calls are indexed using gp.
:param cfg: A CFG instance.
:param int addr: IRSB address.
:param int func_addr: The function address.
:param pyvex.IRSB block: The IRSB.
:param str jumpkind: The jumpkind.
... | angr/analyses/cfg/indirect_jump_resolvers/mips_elf_fast.py | def resolve(self, cfg, addr, func_addr, block, jumpkind):
"""
Resolves the indirect jump in MIPS ELF binaries where all external function calls are indexed using gp.
:param cfg: A CFG instance.
:param int addr: IRSB address.
:param int func_addr: The function address.
:p... | def resolve(self, cfg, addr, func_addr, block, jumpkind):
"""
Resolves the indirect jump in MIPS ELF binaries where all external function calls are indexed using gp.
:param cfg: A CFG instance.
:param int addr: IRSB address.
:param int func_addr: The function address.
:p... | [
"Resolves",
"the",
"indirect",
"jump",
"in",
"MIPS",
"ELF",
"binaries",
"where",
"all",
"external",
"function",
"calls",
"are",
"indexed",
"using",
"gp",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/indirect_jump_resolvers/mips_elf_fast.py#L28-L110 | [
"def",
"resolve",
"(",
"self",
",",
"cfg",
",",
"addr",
",",
"func_addr",
",",
"block",
",",
"jumpkind",
")",
":",
"project",
"=",
"self",
".",
"project",
"b",
"=",
"Blade",
"(",
"cfg",
".",
"graph",
",",
"addr",
",",
"-",
"1",
",",
"cfg",
"=",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimEngineHook.process | Perform execution with a state.
:param state: The state with which to execute
:param procedure: An instance of a SimProcedure to run, optional
:param ret_to: The address to return to when this procedure is finished
:param inline: This is an inline execution. Do not bot... | angr/engines/hook.py | def process(self, state, procedure=None, force_addr=None, **kwargs):
"""
Perform execution with a state.
:param state: The state with which to execute
:param procedure: An instance of a SimProcedure to run, optional
:param ret_to: The address to return to when this ... | def process(self, state, procedure=None, force_addr=None, **kwargs):
"""
Perform execution with a state.
:param state: The state with which to execute
:param procedure: An instance of a SimProcedure to run, optional
:param ret_to: The address to return to when this ... | [
"Perform",
"execution",
"with",
"a",
"state",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/hook.py#L29-L55 | [
"def",
"process",
"(",
"self",
",",
"state",
",",
"procedure",
"=",
"None",
",",
"force_addr",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"addr",
"=",
"state",
".",
"addr",
"if",
"force_addr",
"is",
"None",
"else",
"force_addr",
"if",
"procedure",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimStateOptions.difference | [COMPATIBILITY]
Make a copy of the current instance, and then discard all options that are in boolean_switches.
:param set boolean_switches: A collection of Boolean switches to disable.
:return: A new SimStateOptions instance. | angr/sim_state_options.py | def difference(self, boolean_switches):
"""
[COMPATIBILITY]
Make a copy of the current instance, and then discard all options that are in boolean_switches.
:param set boolean_switches: A collection of Boolean switches to disable.
:return: A new SimState... | def difference(self, boolean_switches):
"""
[COMPATIBILITY]
Make a copy of the current instance, and then discard all options that are in boolean_switches.
:param set boolean_switches: A collection of Boolean switches to disable.
:return: A new SimState... | [
"[",
"COMPATIBILITY",
"]",
"Make",
"a",
"copy",
"of",
"the",
"current",
"instance",
"and",
"then",
"discard",
"all",
"options",
"that",
"are",
"in",
"boolean_switches",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/sim_state_options.py#L317-L329 | [
"def",
"difference",
"(",
"self",
",",
"boolean_switches",
")",
":",
"ops",
"=",
"SimStateOptions",
"(",
"self",
")",
"for",
"key",
"in",
"boolean_switches",
":",
"ops",
".",
"discard",
"(",
"key",
")",
"return",
"ops"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimStateOptions.tally | Return a string representation of all state options.
:param bool exclude_false: Whether to exclude Boolean switches that are disabled.
:param bool description: Whether to display the description of each option.
:return: A string representation.
:rtype: ... | angr/sim_state_options.py | def tally(self, exclude_false=True, description=False):
"""
Return a string representation of all state options.
:param bool exclude_false: Whether to exclude Boolean switches that are disabled.
:param bool description: Whether to display the description of each option.
:ret... | def tally(self, exclude_false=True, description=False):
"""
Return a string representation of all state options.
:param bool exclude_false: Whether to exclude Boolean switches that are disabled.
:param bool description: Whether to display the description of each option.
:ret... | [
"Return",
"a",
"string",
"representation",
"of",
"all",
"state",
"options",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/sim_state_options.py#L341-L369 | [
"def",
"tally",
"(",
"self",
",",
"exclude_false",
"=",
"True",
",",
"description",
"=",
"False",
")",
":",
"total",
"=",
"[",
"]",
"for",
"o",
"in",
"sorted",
"(",
"self",
".",
"OPTIONS",
".",
"values",
"(",
")",
",",
"key",
"=",
"lambda",
"x",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimStateOptions.register_option | Register a state option.
:param str name: Name of the state option.
:param types: A collection of allowed types of this state option.
:param default: The default value of this state option.
:param str description: The description of this state option.
:r... | angr/sim_state_options.py | def register_option(cls, name, types, default=None, description=None):
"""
Register a state option.
:param str name: Name of the state option.
:param types: A collection of allowed types of this state option.
:param default: The default value of this sta... | def register_option(cls, name, types, default=None, description=None):
"""
Register a state option.
:param str name: Name of the state option.
:param types: A collection of allowed types of this state option.
:param default: The default value of this sta... | [
"Register",
"a",
"state",
"option",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/sim_state_options.py#L372-L390 | [
"def",
"register_option",
"(",
"cls",
",",
"name",
",",
"types",
",",
"default",
"=",
"None",
",",
"description",
"=",
"None",
")",
":",
"if",
"name",
"in",
"cls",
".",
"OPTIONS",
":",
"raise",
"SimStateOptionsError",
"(",
"\"A state option with the same name ... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimStateOptions.register_bool_option | Register a Boolean switch as state option.
This is equivalent to cls.register_option(name, set([bool]), description=description)
:param str name: Name of the state option.
:param str description: The description of this state option.
:return: None | angr/sim_state_options.py | def register_bool_option(cls, name, description=None):
"""
Register a Boolean switch as state option.
This is equivalent to cls.register_option(name, set([bool]), description=description)
:param str name: Name of the state option.
:param str description: The description o... | def register_bool_option(cls, name, description=None):
"""
Register a Boolean switch as state option.
This is equivalent to cls.register_option(name, set([bool]), description=description)
:param str name: Name of the state option.
:param str description: The description o... | [
"Register",
"a",
"Boolean",
"switch",
"as",
"state",
"option",
".",
"This",
"is",
"equivalent",
"to",
"cls",
".",
"register_option",
"(",
"name",
"set",
"(",
"[",
"bool",
"]",
")",
"description",
"=",
"description",
")"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/sim_state_options.py#L393-L403 | [
"def",
"register_bool_option",
"(",
"cls",
",",
"name",
",",
"description",
"=",
"None",
")",
":",
"cls",
".",
"register_option",
"(",
"name",
",",
"{",
"bool",
"}",
",",
"default",
"=",
"False",
",",
"description",
"=",
"description",
")"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | concretize | For now a lot of naive concretization is done when handling heap metadata to keep things manageable. This idiom
showed up a lot as a result, so to reduce code repetition this function uses a callback to handle the one or two
operations that varied across invocations.
:param x: the item to be concretized
... | angr/state_plugins/heap/utils.py | def concretize(x, solver, sym_handler):
"""
For now a lot of naive concretization is done when handling heap metadata to keep things manageable. This idiom
showed up a lot as a result, so to reduce code repetition this function uses a callback to handle the one or two
operations that varied across invoc... | def concretize(x, solver, sym_handler):
"""
For now a lot of naive concretization is done when handling heap metadata to keep things manageable. This idiom
showed up a lot as a result, so to reduce code repetition this function uses a callback to handle the one or two
operations that varied across invoc... | [
"For",
"now",
"a",
"lot",
"of",
"naive",
"concretization",
"is",
"done",
"when",
"handling",
"heap",
"metadata",
"to",
"keep",
"things",
"manageable",
".",
"This",
"idiom",
"showed",
"up",
"a",
"lot",
"as",
"a",
"result",
"so",
"to",
"reduce",
"code",
"r... | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/heap/utils.py#L3-L20 | [
"def",
"concretize",
"(",
"x",
",",
"solver",
",",
"sym_handler",
")",
":",
"if",
"solver",
".",
"symbolic",
"(",
"x",
")",
":",
"try",
":",
"return",
"solver",
".",
"eval_one",
"(",
"x",
")",
"except",
"SimSolverError",
":",
"return",
"sym_handler",
"... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimProcedure._describe_me | return a 5-tuple of strings sufficient for formatting with ``%s%s%s%s%s`` to verbosely describe the procedure | angr/sim_procedure.py | def _describe_me(self):
"""
return a 5-tuple of strings sufficient for formatting with ``%s%s%s%s%s`` to verbosely describe the procedure
"""
return (
self.display_name,
' (cont: %s)' % self.run_func if self.is_continuation else '',
' (syscall)' if sel... | def _describe_me(self):
"""
return a 5-tuple of strings sufficient for formatting with ``%s%s%s%s%s`` to verbosely describe the procedure
"""
return (
self.display_name,
' (cont: %s)' % self.run_func if self.is_continuation else '',
' (syscall)' if sel... | [
"return",
"a",
"5",
"-",
"tuple",
"of",
"strings",
"sufficient",
"for",
"formatting",
"with",
"%s%s%s%s%s",
"to",
"verbosely",
"describe",
"the",
"procedure"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/sim_procedure.py#L90-L100 | [
"def",
"_describe_me",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"display_name",
",",
"' (cont: %s)'",
"%",
"self",
".",
"run_func",
"if",
"self",
".",
"is_continuation",
"else",
"''",
",",
"' (syscall)'",
"if",
"self",
".",
"is_syscall",
"else",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimProcedure.execute | Call this method with a SimState and a SimSuccessors to execute the procedure.
Alternately, successors may be none if this is an inline call. In that case, you should
provide arguments to the function. | angr/sim_procedure.py | def execute(self, state, successors=None, arguments=None, ret_to=None):
"""
Call this method with a SimState and a SimSuccessors to execute the procedure.
Alternately, successors may be none if this is an inline call. In that case, you should
provide arguments to the function.
"... | def execute(self, state, successors=None, arguments=None, ret_to=None):
"""
Call this method with a SimState and a SimSuccessors to execute the procedure.
Alternately, successors may be none if this is an inline call. In that case, you should
provide arguments to the function.
"... | [
"Call",
"this",
"method",
"with",
"a",
"SimState",
"and",
"a",
"SimSuccessors",
"to",
"execute",
"the",
"procedure",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/sim_procedure.py#L102-L187 | [
"def",
"execute",
"(",
"self",
",",
"state",
",",
"successors",
"=",
"None",
",",
"arguments",
"=",
"None",
",",
"ret_to",
"=",
"None",
")",
":",
"# fill out all the fun stuff we don't want to frontload",
"if",
"self",
".",
"addr",
"is",
"None",
"and",
"not",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimProcedure.arg | Returns the ith argument. Raise a SimProcedureArgumentError if we don't have such an argument available.
:param int i: The index of the argument to get
:return: The argument
:rtype: object | angr/sim_procedure.py | def arg(self, i):
"""
Returns the ith argument. Raise a SimProcedureArgumentError if we don't have such an argument available.
:param int i: The index of the argument to get
:return: The argument
:rtype: object
"""
if self.use_state_arguments:
r = sel... | def arg(self, i):
"""
Returns the ith argument. Raise a SimProcedureArgumentError if we don't have such an argument available.
:param int i: The index of the argument to get
:return: The argument
:rtype: object
"""
if self.use_state_arguments:
r = sel... | [
"Returns",
"the",
"ith",
"argument",
".",
"Raise",
"a",
"SimProcedureArgumentError",
"if",
"we",
"don",
"t",
"have",
"such",
"an",
"argument",
"available",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/sim_procedure.py#L262-L278 | [
"def",
"arg",
"(",
"self",
",",
"i",
")",
":",
"if",
"self",
".",
"use_state_arguments",
":",
"r",
"=",
"self",
".",
"cc",
".",
"arg",
"(",
"self",
".",
"state",
",",
"i",
")",
"else",
":",
"if",
"i",
">=",
"len",
"(",
"self",
".",
"arguments",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimProcedure.inline_call | Call another SimProcedure in-line to retrieve its return value.
Returns an instance of the procedure with the ret_expr property set.
:param procedure: The class of the procedure to execute
:param arguments: Any additional positional args will be used as arguments to the
... | angr/sim_procedure.py | def inline_call(self, procedure, *arguments, **kwargs):
"""
Call another SimProcedure in-line to retrieve its return value.
Returns an instance of the procedure with the ret_expr property set.
:param procedure: The class of the procedure to execute
:param arguments: ... | def inline_call(self, procedure, *arguments, **kwargs):
"""
Call another SimProcedure in-line to retrieve its return value.
Returns an instance of the procedure with the ret_expr property set.
:param procedure: The class of the procedure to execute
:param arguments: ... | [
"Call",
"another",
"SimProcedure",
"in",
"-",
"line",
"to",
"retrieve",
"its",
"return",
"value",
".",
"Returns",
"an",
"instance",
"of",
"the",
"procedure",
"with",
"the",
"ret_expr",
"property",
"set",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/sim_procedure.py#L284-L297 | [
"def",
"inline_call",
"(",
"self",
",",
"procedure",
",",
"*",
"arguments",
",",
"*",
"*",
"kwargs",
")",
":",
"e_args",
"=",
"[",
"self",
".",
"state",
".",
"solver",
".",
"BVV",
"(",
"a",
",",
"self",
".",
"state",
".",
"arch",
".",
"bits",
")"... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimProcedure.ret | Add an exit representing a return from this function.
If this is not an inline call, grab a return address from the state and jump to it.
If this is not an inline call, set a return expression with the calling convention. | angr/sim_procedure.py | def ret(self, expr=None):
"""
Add an exit representing a return from this function.
If this is not an inline call, grab a return address from the state and jump to it.
If this is not an inline call, set a return expression with the calling convention.
"""
self.inhibit_aut... | def ret(self, expr=None):
"""
Add an exit representing a return from this function.
If this is not an inline call, grab a return address from the state and jump to it.
If this is not an inline call, set a return expression with the calling convention.
"""
self.inhibit_aut... | [
"Add",
"an",
"exit",
"representing",
"a",
"return",
"from",
"this",
"function",
".",
"If",
"this",
"is",
"not",
"an",
"inline",
"call",
"grab",
"a",
"return",
"address",
"from",
"the",
"state",
"and",
"jump",
"to",
"it",
".",
"If",
"this",
"is",
"not",... | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/sim_procedure.py#L299-L349 | [
"def",
"ret",
"(",
"self",
",",
"expr",
"=",
"None",
")",
":",
"self",
".",
"inhibit_autoret",
"=",
"True",
"if",
"expr",
"is",
"not",
"None",
":",
"if",
"o",
".",
"SIMPLIFY_RETS",
"in",
"self",
".",
"state",
".",
"options",
":",
"l",
".",
"debug",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimProcedure.call | Add an exit representing calling another function via pointer.
:param addr: The address of the function to call
:param args: The list of arguments to call the function with
:param continue_at: Later, when the called function returns, execution of the current
... | angr/sim_procedure.py | def call(self, addr, args, continue_at, cc=None):
"""
Add an exit representing calling another function via pointer.
:param addr: The address of the function to call
:param args: The list of arguments to call the function with
:param continue_at: Later, when the ca... | def call(self, addr, args, continue_at, cc=None):
"""
Add an exit representing calling another function via pointer.
:param addr: The address of the function to call
:param args: The list of arguments to call the function with
:param continue_at: Later, when the ca... | [
"Add",
"an",
"exit",
"representing",
"calling",
"another",
"function",
"via",
"pointer",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/sim_procedure.py#L352-L396 | [
"def",
"call",
"(",
"self",
",",
"addr",
",",
"args",
",",
"continue_at",
",",
"cc",
"=",
"None",
")",
":",
"self",
".",
"inhibit_autoret",
"=",
"True",
"if",
"cc",
"is",
"None",
":",
"cc",
"=",
"self",
".",
"cc",
"call_state",
"=",
"self",
".",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimProcedure.jump | Add an exit representing jumping to an address. | angr/sim_procedure.py | def jump(self, addr):
"""
Add an exit representing jumping to an address.
"""
self.inhibit_autoret = True
self._exit_action(self.state, addr)
self.successors.add_successor(self.state, addr, self.state.solver.true, 'Ijk_Boring') | def jump(self, addr):
"""
Add an exit representing jumping to an address.
"""
self.inhibit_autoret = True
self._exit_action(self.state, addr)
self.successors.add_successor(self.state, addr, self.state.solver.true, 'Ijk_Boring') | [
"Add",
"an",
"exit",
"representing",
"jumping",
"to",
"an",
"address",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/sim_procedure.py#L398-L404 | [
"def",
"jump",
"(",
"self",
",",
"addr",
")",
":",
"self",
".",
"inhibit_autoret",
"=",
"True",
"self",
".",
"_exit_action",
"(",
"self",
".",
"state",
",",
"addr",
")",
"self",
".",
"successors",
".",
"add_successor",
"(",
"self",
".",
"state",
",",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimProcedure.exit | Add an exit representing terminating the program. | angr/sim_procedure.py | def exit(self, exit_code):
"""
Add an exit representing terminating the program.
"""
self.inhibit_autoret = True
self.state.options.discard(o.AST_DEPS)
self.state.options.discard(o.AUTO_REFS)
if isinstance(exit_code, int):
exit_code = self.state.solve... | def exit(self, exit_code):
"""
Add an exit representing terminating the program.
"""
self.inhibit_autoret = True
self.state.options.discard(o.AST_DEPS)
self.state.options.discard(o.AUTO_REFS)
if isinstance(exit_code, int):
exit_code = self.state.solve... | [
"Add",
"an",
"exit",
"representing",
"terminating",
"the",
"program",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/sim_procedure.py#L406-L417 | [
"def",
"exit",
"(",
"self",
",",
"exit_code",
")",
":",
"self",
".",
"inhibit_autoret",
"=",
"True",
"self",
".",
"state",
".",
"options",
".",
"discard",
"(",
"o",
".",
"AST_DEPS",
")",
"self",
".",
"state",
".",
"options",
".",
"discard",
"(",
"o",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VSA_DDG._explore | Starting from the start_node, explore the entire VFG, and perform the following:
- Generate def-use chains for all registers and memory addresses using a worklist | angr/analyses/vsa_ddg.py | def _explore(self):
"""
Starting from the start_node, explore the entire VFG, and perform the following:
- Generate def-use chains for all registers and memory addresses using a worklist
"""
# TODO: The worklist algorithm can definitely use some optimizations. It is a future wor... | def _explore(self):
"""
Starting from the start_node, explore the entire VFG, and perform the following:
- Generate def-use chains for all registers and memory addresses using a worklist
"""
# TODO: The worklist algorithm can definitely use some optimizations. It is a future wor... | [
"Starting",
"from",
"the",
"start_node",
"explore",
"the",
"entire",
"VFG",
"and",
"perform",
"the",
"following",
":",
"-",
"Generate",
"def",
"-",
"use",
"chains",
"for",
"all",
"registers",
"and",
"memory",
"addresses",
"using",
"a",
"worklist"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vsa_ddg.py#L108-L185 | [
"def",
"_explore",
"(",
"self",
")",
":",
"# TODO: The worklist algorithm can definitely use some optimizations. It is a future work.",
"# The worklist holds individual VFGNodes that comes from the VFG",
"# Initialize the worklist with all nodes in VFG",
"worklist",
"=",
"list",
"(",
"self... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VSA_DDG._track | Given all live definitions prior to this program point, track the changes, and return a new list of live
definitions. We scan through the action list of the new state to track the changes.
:param state: The input state at that program point.
:param live_defs: A list of all live definiti... | angr/analyses/vsa_ddg.py | def _track(self, state, live_defs):
"""
Given all live definitions prior to this program point, track the changes, and return a new list of live
definitions. We scan through the action list of the new state to track the changes.
:param state: The input state at that program point.... | def _track(self, state, live_defs):
"""
Given all live definitions prior to this program point, track the changes, and return a new list of live
definitions. We scan through the action list of the new state to track the changes.
:param state: The input state at that program point.... | [
"Given",
"all",
"live",
"definitions",
"prior",
"to",
"this",
"program",
"point",
"track",
"the",
"changes",
"and",
"return",
"a",
"new",
"list",
"of",
"live",
"definitions",
".",
"We",
"scan",
"through",
"the",
"action",
"list",
"of",
"the",
"new",
"state... | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vsa_ddg.py#L187-L342 | [
"def",
"_track",
"(",
"self",
",",
"state",
",",
"live_defs",
")",
":",
"# Make a copy of live_defs",
"live_defs",
"=",
"live_defs",
".",
"copy",
"(",
")",
"action_list",
"=",
"list",
"(",
"state",
".",
"history",
".",
"recent_actions",
")",
"# Since all tempo... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VSA_DDG._def_lookup | This is a backward lookup in the previous defs.
:param addr_list: a list of normalized addresses.
Note that, as we are using VSA, it is possible that @a is affected by several definitions.
:returns: a dict {stmt:labels} where label is the number of individual addresses of... | angr/analyses/vsa_ddg.py | def _def_lookup(self, live_defs, variable):
"""
This is a backward lookup in the previous defs.
:param addr_list: a list of normalized addresses.
Note that, as we are using VSA, it is possible that @a is affected by several definitions.
:returns: a dict {s... | def _def_lookup(self, live_defs, variable):
"""
This is a backward lookup in the previous defs.
:param addr_list: a list of normalized addresses.
Note that, as we are using VSA, it is possible that @a is affected by several definitions.
:returns: a dict {s... | [
"This",
"is",
"a",
"backward",
"lookup",
"in",
"the",
"previous",
"defs",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vsa_ddg.py#L345-L385 | [
"def",
"_def_lookup",
"(",
"self",
",",
"live_defs",
",",
"variable",
")",
":",
"prevdefs",
"=",
"{",
"}",
"if",
"variable",
"in",
"live_defs",
":",
"code_loc_set",
"=",
"live_defs",
"[",
"variable",
"]",
"for",
"code_loc",
"in",
"code_loc_set",
":",
"# La... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VSA_DDG._kill | Kill previous defs. `addr_list` is a list of normalized addresses. | angr/analyses/vsa_ddg.py | def _kill(self, live_defs, variable, code_loc):
"""
Kill previous defs. `addr_list` is a list of normalized addresses.
"""
# Case 1: address perfectly match, we kill
# Case 2: a is a subset of the original address
# Case 3: a is a superset of the original address
... | def _kill(self, live_defs, variable, code_loc):
"""
Kill previous defs. `addr_list` is a list of normalized addresses.
"""
# Case 1: address perfectly match, we kill
# Case 2: a is a subset of the original address
# Case 3: a is a superset of the original address
... | [
"Kill",
"previous",
"defs",
".",
"addr_list",
"is",
"a",
"list",
"of",
"normalized",
"addresses",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vsa_ddg.py#L387-L397 | [
"def",
"_kill",
"(",
"self",
",",
"live_defs",
",",
"variable",
",",
"code_loc",
")",
":",
"# Case 1: address perfectly match, we kill",
"# Case 2: a is a subset of the original address",
"# Case 3: a is a superset of the original address",
"live_defs",
"[",
"variable",
"]",
"=... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VSA_DDG._add_edge | Add an edge in the graph from `s_a` to statement `s_b`, where `s_a` and `s_b` are tuples of statements of the
form (irsb_addr, stmt_idx). | angr/analyses/vsa_ddg.py | def _add_edge(self, s_a, s_b, **edge_labels):
"""
Add an edge in the graph from `s_a` to statement `s_b`, where `s_a` and `s_b` are tuples of statements of the
form (irsb_addr, stmt_idx).
"""
# Is that edge already in the graph ?
# If at least one is new, then we are not ... | def _add_edge(self, s_a, s_b, **edge_labels):
"""
Add an edge in the graph from `s_a` to statement `s_b`, where `s_a` and `s_b` are tuples of statements of the
form (irsb_addr, stmt_idx).
"""
# Is that edge already in the graph ?
# If at least one is new, then we are not ... | [
"Add",
"an",
"edge",
"in",
"the",
"graph",
"from",
"s_a",
"to",
"statement",
"s_b",
"where",
"s_a",
"and",
"s_b",
"are",
"tuples",
"of",
"statements",
"of",
"the",
"form",
"(",
"irsb_addr",
"stmt_idx",
")",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vsa_ddg.py#L399-L409 | [
"def",
"_add_edge",
"(",
"self",
",",
"s_a",
",",
"s_b",
",",
"*",
"*",
"edge_labels",
")",
":",
"# Is that edge already in the graph ?",
"# If at least one is new, then we are not redoing the same path again",
"if",
"(",
"s_a",
",",
"s_b",
")",
"not",
"in",
"self",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VSA_DDG.get_all_nodes | Get all DDG nodes matching the given basic block address and statement index. | angr/analyses/vsa_ddg.py | def get_all_nodes(self, simrun_addr, stmt_idx):
"""
Get all DDG nodes matching the given basic block address and statement index.
"""
nodes=[]
for n in self.graph.nodes():
if n.simrun_addr == simrun_addr and n.stmt_idx == stmt_idx:
nodes.add(n)
... | def get_all_nodes(self, simrun_addr, stmt_idx):
"""
Get all DDG nodes matching the given basic block address and statement index.
"""
nodes=[]
for n in self.graph.nodes():
if n.simrun_addr == simrun_addr and n.stmt_idx == stmt_idx:
nodes.add(n)
... | [
"Get",
"all",
"DDG",
"nodes",
"matching",
"the",
"given",
"basic",
"block",
"address",
"and",
"statement",
"index",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/vsa_ddg.py#L411-L419 | [
"def",
"get_all_nodes",
"(",
"self",
",",
"simrun_addr",
",",
"stmt_idx",
")",
":",
"nodes",
"=",
"[",
"]",
"for",
"n",
"in",
"self",
".",
"graph",
".",
"nodes",
"(",
")",
":",
"if",
"n",
".",
"simrun_addr",
"==",
"simrun_addr",
"and",
"n",
".",
"s... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimIROp.vector_args | Yields each of the individual lane pairs from the arguments, in
order from most significan to least significant | angr/engines/vex/irop.py | def vector_args(self, args):
"""
Yields each of the individual lane pairs from the arguments, in
order from most significan to least significant
"""
for i in reversed(range(self._vector_count)):
pieces = []
for vec in args:
pieces.append(... | def vector_args(self, args):
"""
Yields each of the individual lane pairs from the arguments, in
order from most significan to least significant
"""
for i in reversed(range(self._vector_count)):
pieces = []
for vec in args:
pieces.append(... | [
"Yields",
"each",
"of",
"the",
"individual",
"lane",
"pairs",
"from",
"the",
"arguments",
"in",
"order",
"from",
"most",
"significan",
"to",
"least",
"significant"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/vex/irop.py#L491-L500 | [
"def",
"vector_args",
"(",
"self",
",",
"args",
")",
":",
"for",
"i",
"in",
"reversed",
"(",
"range",
"(",
"self",
".",
"_vector_count",
")",
")",
":",
"pieces",
"=",
"[",
"]",
"for",
"vec",
"in",
"args",
":",
"pieces",
".",
"append",
"(",
"vec",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimIROp._op_generic_Clz | Count the leading zeroes | angr/engines/vex/irop.py | def _op_generic_Clz(self, args):
"""Count the leading zeroes"""
wtf_expr = claripy.BVV(self._from_size, self._from_size)
for a in range(self._from_size):
bit = claripy.Extract(a, a, args[0])
wtf_expr = claripy.If(bit==1, claripy.BVV(self._from_size-a-1, self._from_size), ... | def _op_generic_Clz(self, args):
"""Count the leading zeroes"""
wtf_expr = claripy.BVV(self._from_size, self._from_size)
for a in range(self._from_size):
bit = claripy.Extract(a, a, args[0])
wtf_expr = claripy.If(bit==1, claripy.BVV(self._from_size-a-1, self._from_size), ... | [
"Count",
"the",
"leading",
"zeroes"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/vex/irop.py#L508-L514 | [
"def",
"_op_generic_Clz",
"(",
"self",
",",
"args",
")",
":",
"wtf_expr",
"=",
"claripy",
".",
"BVV",
"(",
"self",
".",
"_from_size",
",",
"self",
".",
"_from_size",
")",
"for",
"a",
"in",
"range",
"(",
"self",
".",
"_from_size",
")",
":",
"bit",
"="... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimIROp._op_generic_Ctz | Count the trailing zeroes | angr/engines/vex/irop.py | def _op_generic_Ctz(self, args):
"""Count the trailing zeroes"""
wtf_expr = claripy.BVV(self._from_size, self._from_size)
for a in reversed(range(self._from_size)):
bit = claripy.Extract(a, a, args[0])
wtf_expr = claripy.If(bit == 1, claripy.BVV(a, self._from_size), wtf_e... | def _op_generic_Ctz(self, args):
"""Count the trailing zeroes"""
wtf_expr = claripy.BVV(self._from_size, self._from_size)
for a in reversed(range(self._from_size)):
bit = claripy.Extract(a, a, args[0])
wtf_expr = claripy.If(bit == 1, claripy.BVV(a, self._from_size), wtf_e... | [
"Count",
"the",
"trailing",
"zeroes"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/vex/irop.py#L516-L522 | [
"def",
"_op_generic_Ctz",
"(",
"self",
",",
"args",
")",
":",
"wtf_expr",
"=",
"claripy",
".",
"BVV",
"(",
"self",
".",
"_from_size",
",",
"self",
".",
"_from_size",
")",
"for",
"a",
"in",
"reversed",
"(",
"range",
"(",
"self",
".",
"_from_size",
")",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimIROp._op_generic_HAdd | Halving add, for some ARM NEON instructions. | angr/engines/vex/irop.py | def _op_generic_HAdd(self, args):
"""
Halving add, for some ARM NEON instructions.
"""
components = []
for a, b in self.vector_args(args):
if self.is_signed:
a = a.sign_extend(self._vector_size)
b = b.sign_extend(self._vector_size)
... | def _op_generic_HAdd(self, args):
"""
Halving add, for some ARM NEON instructions.
"""
components = []
for a, b in self.vector_args(args):
if self.is_signed:
a = a.sign_extend(self._vector_size)
b = b.sign_extend(self._vector_size)
... | [
"Halving",
"add",
"for",
"some",
"ARM",
"NEON",
"instructions",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/vex/irop.py#L656-L669 | [
"def",
"_op_generic_HAdd",
"(",
"self",
",",
"args",
")",
":",
"components",
"=",
"[",
"]",
"for",
"a",
",",
"b",
"in",
"self",
".",
"vector_args",
"(",
"args",
")",
":",
"if",
"self",
".",
"is_signed",
":",
"a",
"=",
"a",
".",
"sign_extend",
"(",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimIROp._op_generic_QAdd | Saturating add. | angr/engines/vex/irop.py | def _op_generic_QAdd(self, args):
"""
Saturating add.
"""
components = []
for a, b in self.vector_args(args):
top_a = a[self._vector_size-1]
top_b = b[self._vector_size-1]
res = a + b
top_r = res[self._vector_size-1]
if ... | def _op_generic_QAdd(self, args):
"""
Saturating add.
"""
components = []
for a, b in self.vector_args(args):
top_a = a[self._vector_size-1]
top_b = b[self._vector_size-1]
res = a + b
top_r = res[self._vector_size-1]
if ... | [
"Saturating",
"add",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/vex/irop.py#L688-L706 | [
"def",
"_op_generic_QAdd",
"(",
"self",
",",
"args",
")",
":",
"components",
"=",
"[",
"]",
"for",
"a",
",",
"b",
"in",
"self",
".",
"vector_args",
"(",
"args",
")",
":",
"top_a",
"=",
"a",
"[",
"self",
".",
"_vector_size",
"-",
"1",
"]",
"top_b",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimIROp._op_generic_pack_StoU_saturation | Generic pack with unsigned saturation.
Split args in chunks of src_size signed bits and in pack them into unsigned saturated chunks of dst_size bits.
Then chunks are concatenated resulting in a BV of len(args)*dst_size//src_size*len(args[0]) bits. | angr/engines/vex/irop.py | def _op_generic_pack_StoU_saturation(self, args, src_size, dst_size):
"""
Generic pack with unsigned saturation.
Split args in chunks of src_size signed bits and in pack them into unsigned saturated chunks of dst_size bits.
Then chunks are concatenated resulting in a BV of len(args)*dst_... | def _op_generic_pack_StoU_saturation(self, args, src_size, dst_size):
"""
Generic pack with unsigned saturation.
Split args in chunks of src_size signed bits and in pack them into unsigned saturated chunks of dst_size bits.
Then chunks are concatenated resulting in a BV of len(args)*dst_... | [
"Generic",
"pack",
"with",
"unsigned",
"saturation",
".",
"Split",
"args",
"in",
"chunks",
"of",
"src_size",
"signed",
"bits",
"and",
"in",
"pack",
"them",
"into",
"unsigned",
"saturated",
"chunks",
"of",
"dst_size",
"bits",
".",
"Then",
"chunks",
"are",
"co... | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/vex/irop.py#L816-L835 | [
"def",
"_op_generic_pack_StoU_saturation",
"(",
"self",
",",
"args",
",",
"src_size",
",",
"dst_size",
")",
":",
"if",
"src_size",
"<=",
"0",
"or",
"dst_size",
"<=",
"0",
":",
"raise",
"SimOperationError",
"(",
"\"Can't pack from or to zero or negative size\"",
"%",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.