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 | KeyedRegion.merge | Merge another KeyedRegion into this KeyedRegion.
:param KeyedRegion other: The other instance to merge with.
:return: None | angr/keyed_region.py | def merge(self, other, replacements=None):
"""
Merge another KeyedRegion into this KeyedRegion.
:param KeyedRegion other: The other instance to merge with.
:return: None
"""
# TODO: is the current solution not optimal enough?
for _, item in other._storage.items(... | def merge(self, other, replacements=None):
"""
Merge another KeyedRegion into this KeyedRegion.
:param KeyedRegion other: The other instance to merge with.
:return: None
"""
# TODO: is the current solution not optimal enough?
for _, item in other._storage.items(... | [
"Merge",
"another",
"KeyedRegion",
"into",
"this",
"KeyedRegion",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/keyed_region.py#L172-L188 | [
"def",
"merge",
"(",
"self",
",",
"other",
",",
"replacements",
"=",
"None",
")",
":",
"# TODO: is the current solution not optimal enough?",
"for",
"_",
",",
"item",
"in",
"other",
".",
"_storage",
".",
"items",
"(",
")",
":",
"# type: RegionObject",
"for",
"... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | KeyedRegion.replace | Replace variables with other variables.
:param dict replacements: A dict of variable replacements.
:return: self | angr/keyed_region.py | def replace(self, replacements):
"""
Replace variables with other variables.
:param dict replacements: A dict of variable replacements.
:return: self
"""
for old_var, new_var in replacements.items():
old_var_id = id(old_var)
... | def replace(self, replacements):
"""
Replace variables with other variables.
:param dict replacements: A dict of variable replacements.
:return: self
"""
for old_var, new_var in replacements.items():
old_var_id = id(old_var)
... | [
"Replace",
"variables",
"with",
"other",
"variables",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/keyed_region.py#L190-L205 | [
"def",
"replace",
"(",
"self",
",",
"replacements",
")",
":",
"for",
"old_var",
",",
"new_var",
"in",
"replacements",
".",
"items",
"(",
")",
":",
"old_var_id",
"=",
"id",
"(",
"old_var",
")",
"if",
"old_var_id",
"in",
"self",
".",
"_object_mapping",
":"... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | KeyedRegion.dbg_repr | Get a debugging representation of this keyed region.
:return: A string of debugging output. | angr/keyed_region.py | def dbg_repr(self):
"""
Get a debugging representation of this keyed region.
:return: A string of debugging output.
"""
keys = self._storage.keys()
offset_to_vars = { }
for key in sorted(keys):
ro = self._storage[key]
variables = [ obj.obj... | def dbg_repr(self):
"""
Get a debugging representation of this keyed region.
:return: A string of debugging output.
"""
keys = self._storage.keys()
offset_to_vars = { }
for key in sorted(keys):
ro = self._storage[key]
variables = [ obj.obj... | [
"Get",
"a",
"debugging",
"representation",
"of",
"this",
"keyed",
"region",
".",
":",
"return",
":",
"A",
"string",
"of",
"debugging",
"output",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/keyed_region.py#L207-L223 | [
"def",
"dbg_repr",
"(",
"self",
")",
":",
"keys",
"=",
"self",
".",
"_storage",
".",
"keys",
"(",
")",
"offset_to_vars",
"=",
"{",
"}",
"for",
"key",
"in",
"sorted",
"(",
"keys",
")",
":",
"ro",
"=",
"self",
".",
"_storage",
"[",
"key",
"]",
"var... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | KeyedRegion.add_variable | Add a variable to this region at the given offset.
:param int start:
:param SimVariable variable:
:return: None | angr/keyed_region.py | def add_variable(self, start, variable):
"""
Add a variable to this region at the given offset.
:param int start:
:param SimVariable variable:
:return: None
"""
size = variable.size if variable.size is not None else 1
self.add_object(start, variable, si... | def add_variable(self, start, variable):
"""
Add a variable to this region at the given offset.
:param int start:
:param SimVariable variable:
:return: None
"""
size = variable.size if variable.size is not None else 1
self.add_object(start, variable, si... | [
"Add",
"a",
"variable",
"to",
"this",
"region",
"at",
"the",
"given",
"offset",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/keyed_region.py#L225-L236 | [
"def",
"add_variable",
"(",
"self",
",",
"start",
",",
"variable",
")",
":",
"size",
"=",
"variable",
".",
"size",
"if",
"variable",
".",
"size",
"is",
"not",
"None",
"else",
"1",
"self",
".",
"add_object",
"(",
"start",
",",
"variable",
",",
"size",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | KeyedRegion.add_object | Add/Store an object to this region at the given offset.
:param start:
:param obj:
:param int object_size: Size of the object
:return: | angr/keyed_region.py | def add_object(self, start, obj, object_size):
"""
Add/Store an object to this region at the given offset.
:param start:
:param obj:
:param int object_size: Size of the object
:return:
"""
self._store(start, obj, object_size, overwrite=False) | def add_object(self, start, obj, object_size):
"""
Add/Store an object to this region at the given offset.
:param start:
:param obj:
:param int object_size: Size of the object
:return:
"""
self._store(start, obj, object_size, overwrite=False) | [
"Add",
"/",
"Store",
"an",
"object",
"to",
"this",
"region",
"at",
"the",
"given",
"offset",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/keyed_region.py#L238-L248 | [
"def",
"add_object",
"(",
"self",
",",
"start",
",",
"obj",
",",
"object_size",
")",
":",
"self",
".",
"_store",
"(",
"start",
",",
"obj",
",",
"object_size",
",",
"overwrite",
"=",
"False",
")"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | KeyedRegion.set_variable | Add a variable to this region at the given offset, and remove all other variables that are fully covered by
this variable.
:param int start:
:param SimVariable variable:
:return: None | angr/keyed_region.py | def set_variable(self, start, variable):
"""
Add a variable to this region at the given offset, and remove all other variables that are fully covered by
this variable.
:param int start:
:param SimVariable variable:
:return: None
"""
size = variable.size ... | def set_variable(self, start, variable):
"""
Add a variable to this region at the given offset, and remove all other variables that are fully covered by
this variable.
:param int start:
:param SimVariable variable:
:return: None
"""
size = variable.size ... | [
"Add",
"a",
"variable",
"to",
"this",
"region",
"at",
"the",
"given",
"offset",
"and",
"remove",
"all",
"other",
"variables",
"that",
"are",
"fully",
"covered",
"by",
"this",
"variable",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/keyed_region.py#L250-L262 | [
"def",
"set_variable",
"(",
"self",
",",
"start",
",",
"variable",
")",
":",
"size",
"=",
"variable",
".",
"size",
"if",
"variable",
".",
"size",
"is",
"not",
"None",
"else",
"1",
"self",
".",
"set_object",
"(",
"start",
",",
"variable",
",",
"size",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | KeyedRegion.set_object | Add an object to this region at the given offset, and remove all other objects that are fully covered by this
object.
:param start:
:param obj:
:param object_size:
:return: | angr/keyed_region.py | def set_object(self, start, obj, object_size):
"""
Add an object to this region at the given offset, and remove all other objects that are fully covered by this
object.
:param start:
:param obj:
:param object_size:
:return:
"""
self._store(start,... | def set_object(self, start, obj, object_size):
"""
Add an object to this region at the given offset, and remove all other objects that are fully covered by this
object.
:param start:
:param obj:
:param object_size:
:return:
"""
self._store(start,... | [
"Add",
"an",
"object",
"to",
"this",
"region",
"at",
"the",
"given",
"offset",
"and",
"remove",
"all",
"other",
"objects",
"that",
"are",
"fully",
"covered",
"by",
"this",
"object",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/keyed_region.py#L264-L275 | [
"def",
"set_object",
"(",
"self",
",",
"start",
",",
"obj",
",",
"object_size",
")",
":",
"self",
".",
"_store",
"(",
"start",
",",
"obj",
",",
"object_size",
",",
"overwrite",
"=",
"True",
")"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | KeyedRegion.get_base_addr | Get the base offset (the key we are using to index objects covering the given offset) of a specific offset.
:param int addr:
:return:
:rtype: int or None | angr/keyed_region.py | def get_base_addr(self, addr):
"""
Get the base offset (the key we are using to index objects covering the given offset) of a specific offset.
:param int addr:
:return:
:rtype: int or None
"""
base_addr, container = self._get_container(addr)
if containe... | def get_base_addr(self, addr):
"""
Get the base offset (the key we are using to index objects covering the given offset) of a specific offset.
:param int addr:
:return:
:rtype: int or None
"""
base_addr, container = self._get_container(addr)
if containe... | [
"Get",
"the",
"base",
"offset",
"(",
"the",
"key",
"we",
"are",
"using",
"to",
"index",
"objects",
"covering",
"the",
"given",
"offset",
")",
"of",
"a",
"specific",
"offset",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/keyed_region.py#L277-L290 | [
"def",
"get_base_addr",
"(",
"self",
",",
"addr",
")",
":",
"base_addr",
",",
"container",
"=",
"self",
".",
"_get_container",
"(",
"addr",
")",
"if",
"container",
"is",
"None",
":",
"return",
"None",
"else",
":",
"return",
"base_addr"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | KeyedRegion.get_variables_by_offset | Find variables covering the given region offset.
:param int start:
:return: A list of stack variables.
:rtype: set | angr/keyed_region.py | def get_variables_by_offset(self, start):
"""
Find variables covering the given region offset.
:param int start:
:return: A list of stack variables.
:rtype: set
"""
_, container = self._get_container(start)
if container is None:
return []
... | def get_variables_by_offset(self, start):
"""
Find variables covering the given region offset.
:param int start:
:return: A list of stack variables.
:rtype: set
"""
_, container = self._get_container(start)
if container is None:
return []
... | [
"Find",
"variables",
"covering",
"the",
"given",
"region",
"offset",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/keyed_region.py#L292-L305 | [
"def",
"get_variables_by_offset",
"(",
"self",
",",
"start",
")",
":",
"_",
",",
"container",
"=",
"self",
".",
"_get_container",
"(",
"start",
")",
"if",
"container",
"is",
"None",
":",
"return",
"[",
"]",
"else",
":",
"return",
"container",
".",
"inter... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | KeyedRegion.get_objects_by_offset | Find objects covering the given region offset.
:param start:
:return: | angr/keyed_region.py | def get_objects_by_offset(self, start):
"""
Find objects covering the given region offset.
:param start:
:return:
"""
_, container = self._get_container(start)
if container is None:
return set()
else:
return container.internal_obj... | def get_objects_by_offset(self, start):
"""
Find objects covering the given region offset.
:param start:
:return:
"""
_, container = self._get_container(start)
if container is None:
return set()
else:
return container.internal_obj... | [
"Find",
"objects",
"covering",
"the",
"given",
"region",
"offset",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/keyed_region.py#L307-L319 | [
"def",
"get_objects_by_offset",
"(",
"self",
",",
"start",
")",
":",
"_",
",",
"container",
"=",
"self",
".",
"_get_container",
"(",
"start",
")",
"if",
"container",
"is",
"None",
":",
"return",
"set",
"(",
")",
"else",
":",
"return",
"container",
".",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | KeyedRegion._store | Store a variable into the storage.
:param int start: The beginning address of the variable.
:param obj: The object to store.
:param int size: Size of the object to store.
:param bool overwrite: Whether existing objects should be overwritten or not.
:return: None | angr/keyed_region.py | def _store(self, start, obj, size, overwrite=False):
"""
Store a variable into the storage.
:param int start: The beginning address of the variable.
:param obj: The object to store.
:param int size: Size of the object to store.
:param bool overwrite: Whether existing obj... | def _store(self, start, obj, size, overwrite=False):
"""
Store a variable into the storage.
:param int start: The beginning address of the variable.
:param obj: The object to store.
:param int size: Size of the object to store.
:param bool overwrite: Whether existing obj... | [
"Store",
"a",
"variable",
"into",
"the",
"storage",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/keyed_region.py#L325-L338 | [
"def",
"_store",
"(",
"self",
",",
"start",
",",
"obj",
",",
"size",
",",
"overwrite",
"=",
"False",
")",
":",
"stored_object",
"=",
"StoredObject",
"(",
"start",
",",
"obj",
",",
"size",
")",
"self",
".",
"_object_mapping",
"[",
"stored_object",
".",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | KeyedRegion.__store | Store a variable into the storage.
:param StoredObject stored_object: The descriptor describing start address and the variable.
:param bool overwrite: Whether existing objects should be overwritten or not. True to make a strong update,
False to make a weak update.
... | angr/keyed_region.py | def __store(self, stored_object, overwrite=False):
"""
Store a variable into the storage.
:param StoredObject stored_object: The descriptor describing start address and the variable.
:param bool overwrite: Whether existing objects should be overwritten or not. True to make a strong upd... | def __store(self, stored_object, overwrite=False):
"""
Store a variable into the storage.
:param StoredObject stored_object: The descriptor describing start address and the variable.
:param bool overwrite: Whether existing objects should be overwritten or not. True to make a strong upd... | [
"Store",
"a",
"variable",
"into",
"the",
"storage",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/keyed_region.py#L340-L402 | [
"def",
"__store",
"(",
"self",
",",
"stored_object",
",",
"overwrite",
"=",
"False",
")",
":",
"start",
"=",
"stored_object",
".",
"start",
"object_size",
"=",
"stored_object",
".",
"size",
"end",
"=",
"start",
"+",
"object_size",
"# region items in the middle",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | Analysis._initialize_progressbar | Initialize the progressbar.
:return: None | angr/analyses/analysis.py | def _initialize_progressbar(self):
"""
Initialize the progressbar.
:return: None
"""
self._progressbar = progressbar.ProgressBar(widgets=Analysis._PROGRESS_WIDGETS, maxval=10000 * 100).start() | def _initialize_progressbar(self):
"""
Initialize the progressbar.
:return: None
"""
self._progressbar = progressbar.ProgressBar(widgets=Analysis._PROGRESS_WIDGETS, maxval=10000 * 100).start() | [
"Initialize",
"the",
"progressbar",
".",
":",
"return",
":",
"None"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/analysis.py#L163-L169 | [
"def",
"_initialize_progressbar",
"(",
"self",
")",
":",
"self",
".",
"_progressbar",
"=",
"progressbar",
".",
"ProgressBar",
"(",
"widgets",
"=",
"Analysis",
".",
"_PROGRESS_WIDGETS",
",",
"maxval",
"=",
"10000",
"*",
"100",
")",
".",
"start",
"(",
")"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | Analysis._update_progress | Update the progress with a percentage, including updating the progressbar as well as calling the progress
callback.
:param float percentage: Percentage of the progressbar. from 0.0 to 100.0.
:param kwargs: Other parameters that will be passed to the progress_callback handler.
... | angr/analyses/analysis.py | def _update_progress(self, percentage, **kwargs):
"""
Update the progress with a percentage, including updating the progressbar as well as calling the progress
callback.
:param float percentage: Percentage of the progressbar. from 0.0 to 100.0.
:param kwargs: Oth... | def _update_progress(self, percentage, **kwargs):
"""
Update the progress with a percentage, including updating the progressbar as well as calling the progress
callback.
:param float percentage: Percentage of the progressbar. from 0.0 to 100.0.
:param kwargs: Oth... | [
"Update",
"the",
"progress",
"with",
"a",
"percentage",
"including",
"updating",
"the",
"progressbar",
"as",
"well",
"as",
"calling",
"the",
"progress",
"callback",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/analysis.py#L171-L188 | [
"def",
"_update_progress",
"(",
"self",
",",
"percentage",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"_show_progressbar",
":",
"if",
"self",
".",
"_progressbar",
"is",
"None",
":",
"self",
".",
"_initialize_progressbar",
"(",
")",
"self",
".",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | Analysis._finish_progress | Mark the progressbar as finished.
:return: None | angr/analyses/analysis.py | def _finish_progress(self):
"""
Mark the progressbar as finished.
:return: None
"""
if self._show_progressbar:
if self._progressbar is None:
self._initialize_progressbar()
if self._progressbar is not None:
self._progressbar... | def _finish_progress(self):
"""
Mark the progressbar as finished.
:return: None
"""
if self._show_progressbar:
if self._progressbar is None:
self._initialize_progressbar()
if self._progressbar is not None:
self._progressbar... | [
"Mark",
"the",
"progressbar",
"as",
"finished",
".",
":",
"return",
":",
"None"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/analysis.py#L190-L203 | [
"def",
"_finish_progress",
"(",
"self",
")",
":",
"if",
"self",
".",
"_show_progressbar",
":",
"if",
"self",
".",
"_progressbar",
"is",
"None",
":",
"self",
".",
"_initialize_progressbar",
"(",
")",
"if",
"self",
".",
"_progressbar",
"is",
"not",
"None",
"... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VariableRecoveryState.merge | Merge two abstract states.
:param VariableRecoveryState other: The other abstract state to merge.
:return: The merged abstract state.
:rtype: VariableRecoveryState | angr/analyses/variable_recovery/variable_recovery.py | def merge(self, other, successor=None):
"""
Merge two abstract states.
:param VariableRecoveryState other: The other abstract state to merge.
:return: The merged abstract state.
:rtype: VariableRecoveryState
"""
... | def merge(self, other, successor=None):
"""
Merge two abstract states.
:param VariableRecoveryState other: The other abstract state to merge.
:return: The merged abstract state.
:rtype: VariableRecoveryState
"""
... | [
"Merge",
"two",
"abstract",
"states",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/variable_recovery/variable_recovery.py#L94-L118 | [
"def",
"merge",
"(",
"self",
",",
"other",
",",
"successor",
"=",
"None",
")",
":",
"replacements",
"=",
"{",
"}",
"if",
"successor",
"in",
"self",
".",
"dominance_frontiers",
":",
"replacements",
"=",
"self",
".",
"_make_phi_variables",
"(",
"successor",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VariableRecoveryState._addr_to_stack_offset | Convert an address to a stack offset.
:param claripy.ast.Base addr: The address to convert from.
:return: A stack offset if the addr comes from the stack pointer, or None if the address
does not come from the stack pointer. | angr/analyses/variable_recovery/variable_recovery.py | def _addr_to_stack_offset(self, addr):
"""
Convert an address to a stack offset.
:param claripy.ast.Base addr: The address to convert from.
:return: A stack offset if the addr comes from the stack pointer, or None if the address
... | def _addr_to_stack_offset(self, addr):
"""
Convert an address to a stack offset.
:param claripy.ast.Base addr: The address to convert from.
:return: A stack offset if the addr comes from the stack pointer, or None if the address
... | [
"Convert",
"an",
"address",
"to",
"a",
"stack",
"offset",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/variable_recovery/variable_recovery.py#L325-L372 | [
"def",
"_addr_to_stack_offset",
"(",
"self",
",",
"addr",
")",
":",
"def",
"_parse",
"(",
"addr",
")",
":",
"if",
"addr",
".",
"op",
"==",
"'__add__'",
":",
"# __add__ might have multiple arguments",
"parsed",
"=",
"[",
"_parse",
"(",
"arg",
")",
"for",
"a... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | VariableRecovery._run_on_node | Take an input abstract state, execute the node, and derive an output state.
:param angr.Block node: The node to work on.
:param VariableRecoveryState state: The input state.
:return: A tuple of (changed, new output state).
:rtype: ... | angr/analyses/variable_recovery/variable_recovery.py | def _run_on_node(self, node, state):
"""
Take an input abstract state, execute the node, and derive an output state.
:param angr.Block node: The node to work on.
:param VariableRecoveryState state: The input state.
:return: A tuple of (chan... | def _run_on_node(self, node, state):
"""
Take an input abstract state, execute the node, and derive an output state.
:param angr.Block node: The node to work on.
:param VariableRecoveryState state: The input state.
:return: A tuple of (chan... | [
"Take",
"an",
"input",
"abstract",
"state",
"execute",
"the",
"node",
"and",
"derive",
"an",
"output",
"state",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/variable_recovery/variable_recovery.py#L451-L493 | [
"def",
"_run_on_node",
"(",
"self",
",",
"node",
",",
"state",
")",
":",
"l",
".",
"debug",
"(",
"'Analyzing block %#x, iteration %d.'",
",",
"node",
".",
"addr",
",",
"self",
".",
"_node_iterations",
"[",
"node",
"]",
")",
"concrete_state",
"=",
"state",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._initialize_cfg | Re-create the DiGraph | angr/analyses/cfg/cfg_base.py | def _initialize_cfg(self):
"""
Re-create the DiGraph
"""
self.kb.functions = FunctionManager(self.kb)
self._jobs_to_analyze_per_function = defaultdict(set)
self._completed_functions = set() | def _initialize_cfg(self):
"""
Re-create the DiGraph
"""
self.kb.functions = FunctionManager(self.kb)
self._jobs_to_analyze_per_function = defaultdict(set)
self._completed_functions = set() | [
"Re",
"-",
"create",
"the",
"DiGraph"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L207-L215 | [
"def",
"_initialize_cfg",
"(",
"self",
")",
":",
"self",
".",
"kb",
".",
"functions",
"=",
"FunctionManager",
"(",
"self",
".",
"kb",
")",
"self",
".",
"_jobs_to_analyze_per_function",
"=",
"defaultdict",
"(",
"set",
")",
"self",
".",
"_completed_functions",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase.make_copy | Copy self attributes to the new object.
:param CFGBase copy_to: The target to copy to.
:return: None | angr/analyses/cfg/cfg_base.py | def make_copy(self, copy_to):
"""
Copy self attributes to the new object.
:param CFGBase copy_to: The target to copy to.
:return: None
"""
for attr, value in self.__dict__.items():
if attr.startswith('__') and attr.endswith('__'):
continue
... | def make_copy(self, copy_to):
"""
Copy self attributes to the new object.
:param CFGBase copy_to: The target to copy to.
:return: None
"""
for attr, value in self.__dict__.items():
if attr.startswith('__') and attr.endswith('__'):
continue
... | [
"Copy",
"self",
"attributes",
"to",
"the",
"new",
"object",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L229-L240 | [
"def",
"make_copy",
"(",
"self",
",",
"copy_to",
")",
":",
"for",
"attr",
",",
"value",
"in",
"self",
".",
"__dict__",
".",
"items",
"(",
")",
":",
"if",
"attr",
".",
"startswith",
"(",
"'__'",
")",
"and",
"attr",
".",
"endswith",
"(",
"'__'",
")",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._merge_cfgnodes | Merge two adjacent CFGNodes into one.
:param CFGNode cfgnode_0: The first CFGNode.
:param CFGNode cfgnode_1: The second CFGNode.
:return: None | angr/analyses/cfg/cfg_base.py | def _merge_cfgnodes(self, cfgnode_0, cfgnode_1):
"""
Merge two adjacent CFGNodes into one.
:param CFGNode cfgnode_0: The first CFGNode.
:param CFGNode cfgnode_1: The second CFGNode.
:return: None
"""
assert cfgnode_0.addr + cfgnode_0.size ... | def _merge_cfgnodes(self, cfgnode_0, cfgnode_1):
"""
Merge two adjacent CFGNodes into one.
:param CFGNode cfgnode_0: The first CFGNode.
:param CFGNode cfgnode_1: The second CFGNode.
:return: None
"""
assert cfgnode_0.addr + cfgnode_0.size ... | [
"Merge",
"two",
"adjacent",
"CFGNodes",
"into",
"one",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L326-L365 | [
"def",
"_merge_cfgnodes",
"(",
"self",
",",
"cfgnode_0",
",",
"cfgnode_1",
")",
":",
"assert",
"cfgnode_0",
".",
"addr",
"+",
"cfgnode_0",
".",
"size",
"==",
"cfgnode_1",
".",
"addr",
"addr0",
",",
"addr1",
"=",
"cfgnode_0",
".",
"addr",
",",
"cfgnode_1",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._to_snippet | Convert a CFGNode instance to a CodeNode object.
:param angr.analyses.CFGNode cfg_node: The CFGNode instance.
:param int addr: Address of the node. Only used when `cfg_node` is None.
:param bool thumb: Whether this is in THUMB mode or not. Only used for ARM code and when `cfg_node` is None.
... | angr/analyses/cfg/cfg_base.py | def _to_snippet(self, cfg_node=None, addr=None, size=None, thumb=False, jumpkind=None, base_state=None):
"""
Convert a CFGNode instance to a CodeNode object.
:param angr.analyses.CFGNode cfg_node: The CFGNode instance.
:param int addr: Address of the node. Only used when `cfg_node` is N... | def _to_snippet(self, cfg_node=None, addr=None, size=None, thumb=False, jumpkind=None, base_state=None):
"""
Convert a CFGNode instance to a CodeNode object.
:param angr.analyses.CFGNode cfg_node: The CFGNode instance.
:param int addr: Address of the node. Only used when `cfg_node` is N... | [
"Convert",
"a",
"CFGNode",
"instance",
"to",
"a",
"CodeNode",
"object",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L367-L401 | [
"def",
"_to_snippet",
"(",
"self",
",",
"cfg_node",
"=",
"None",
",",
"addr",
"=",
"None",
",",
"size",
"=",
"None",
",",
"thumb",
"=",
"False",
",",
"jumpkind",
"=",
"None",
",",
"base_state",
"=",
"None",
")",
":",
"if",
"cfg_node",
"is",
"not",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._arm_thumb_filter_jump_successors | Filter successors for THUMB mode basic blocks, and remove those successors that won't be taken normally.
:param int addr: Address of the basic block / SimIRSB.
:param int size: Size of the basic block.
:param list successors: A list of successors.
:param func get_ins_addr: A callable th... | angr/analyses/cfg/cfg_base.py | def _arm_thumb_filter_jump_successors(self, addr, size, successors, get_ins_addr, get_exit_stmt_idx):
"""
Filter successors for THUMB mode basic blocks, and remove those successors that won't be taken normally.
:param int addr: Address of the basic block / SimIRSB.
:param int size: Size... | def _arm_thumb_filter_jump_successors(self, addr, size, successors, get_ins_addr, get_exit_stmt_idx):
"""
Filter successors for THUMB mode basic blocks, and remove those successors that won't be taken normally.
:param int addr: Address of the basic block / SimIRSB.
:param int size: Size... | [
"Filter",
"successors",
"for",
"THUMB",
"mode",
"basic",
"blocks",
"and",
"remove",
"those",
"successors",
"that",
"won",
"t",
"be",
"taken",
"normally",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L406-L461 | [
"def",
"_arm_thumb_filter_jump_successors",
"(",
"self",
",",
"addr",
",",
"size",
",",
"successors",
",",
"get_ins_addr",
",",
"get_exit_stmt_idx",
")",
":",
"if",
"not",
"successors",
":",
"return",
"[",
"]",
"it_counter",
"=",
"0",
"conc_temps",
"=",
"{",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._is_region_extremely_sparse | Check whether the given memory region is extremely sparse, i.e., all bytes are the same value.
:param int start: The beginning of the region.
:param int end: The end of the region.
:param base_state: The base state (optional).
:return: True if the region is extremely sparse,... | angr/analyses/cfg/cfg_base.py | def _is_region_extremely_sparse(self, start, end, base_state=None):
"""
Check whether the given memory region is extremely sparse, i.e., all bytes are the same value.
:param int start: The beginning of the region.
:param int end: The end of the region.
:param base_state: The b... | def _is_region_extremely_sparse(self, start, end, base_state=None):
"""
Check whether the given memory region is extremely sparse, i.e., all bytes are the same value.
:param int start: The beginning of the region.
:param int end: The end of the region.
:param base_state: The b... | [
"Check",
"whether",
"the",
"given",
"memory",
"region",
"is",
"extremely",
"sparse",
"i",
".",
"e",
".",
"all",
"bytes",
"are",
"the",
"same",
"value",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L463-L505 | [
"def",
"_is_region_extremely_sparse",
"(",
"self",
",",
"start",
",",
"end",
",",
"base_state",
"=",
"None",
")",
":",
"all_bytes",
"=",
"None",
"if",
"base_state",
"is",
"not",
"None",
":",
"all_bytes",
"=",
"base_state",
".",
"memory",
".",
"load",
"(",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._should_skip_region | Some regions usually do not contain any executable code, but are still marked as executable. We should skip
those regions by default.
:param int region_start: Address of the beginning of the region.
:return: True/False
:rtype: bool | angr/analyses/cfg/cfg_base.py | def _should_skip_region(self, region_start):
"""
Some regions usually do not contain any executable code, but are still marked as executable. We should skip
those regions by default.
:param int region_start: Address of the beginning of the region.
:return: True/F... | def _should_skip_region(self, region_start):
"""
Some regions usually do not contain any executable code, but are still marked as executable. We should skip
those regions by default.
:param int region_start: Address of the beginning of the region.
:return: True/F... | [
"Some",
"regions",
"usually",
"do",
"not",
"contain",
"any",
"executable",
"code",
"but",
"are",
"still",
"marked",
"as",
"executable",
".",
"We",
"should",
"skip",
"those",
"regions",
"by",
"default",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L507-L527 | [
"def",
"_should_skip_region",
"(",
"self",
",",
"region_start",
")",
":",
"obj",
"=",
"self",
".",
"project",
".",
"loader",
".",
"find_object_containing",
"(",
"region_start",
",",
"membership_check",
"=",
"False",
")",
"if",
"obj",
"is",
"None",
":",
"retu... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._executable_memory_regions | Get all executable memory regions from the binaries
:param objects: A collection of binary objects to collect regions from. If None, regions from all project
binary objects are used.
:param bool force_segment: Rely on binary segments instead of sections.
:return: A sorte... | angr/analyses/cfg/cfg_base.py | def _executable_memory_regions(self, objects=None, force_segment=False):
"""
Get all executable memory regions from the binaries
:param objects: A collection of binary objects to collect regions from. If None, regions from all project
binary objects are used.
:pa... | def _executable_memory_regions(self, objects=None, force_segment=False):
"""
Get all executable memory regions from the binaries
:param objects: A collection of binary objects to collect regions from. If None, regions from all project
binary objects are used.
:pa... | [
"Get",
"all",
"executable",
"memory",
"regions",
"from",
"the",
"binaries"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L529-L598 | [
"def",
"_executable_memory_regions",
"(",
"self",
",",
"objects",
"=",
"None",
",",
"force_segment",
"=",
"False",
")",
":",
"if",
"objects",
"is",
"None",
":",
"binaries",
"=",
"self",
".",
"project",
".",
"loader",
".",
"all_objects",
"else",
":",
"binar... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._addr_in_exec_memory_regions | Test if the address belongs to an executable memory region.
:param int addr: The address to test
:return: True if the address belongs to an exectubale memory region, False otherwise
:rtype: bool | angr/analyses/cfg/cfg_base.py | def _addr_in_exec_memory_regions(self, addr):
"""
Test if the address belongs to an executable memory region.
:param int addr: The address to test
:return: True if the address belongs to an exectubale memory region, False otherwise
:rtype: bool
"""
for start, en... | def _addr_in_exec_memory_regions(self, addr):
"""
Test if the address belongs to an executable memory region.
:param int addr: The address to test
:return: True if the address belongs to an exectubale memory region, False otherwise
:rtype: bool
"""
for start, en... | [
"Test",
"if",
"the",
"address",
"belongs",
"to",
"an",
"executable",
"memory",
"region",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L600-L612 | [
"def",
"_addr_in_exec_memory_regions",
"(",
"self",
",",
"addr",
")",
":",
"for",
"start",
",",
"end",
"in",
"self",
".",
"_exec_mem_regions",
":",
"if",
"start",
"<=",
"addr",
"<",
"end",
":",
"return",
"True",
"return",
"False"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._addrs_belong_to_same_section | Test if two addresses belong to the same section.
:param int addr_a: The first address to test.
:param int addr_b: The second address to test.
:return: True if the two addresses belong to the same section or both of them do not belong to any
section, Fal... | angr/analyses/cfg/cfg_base.py | def _addrs_belong_to_same_section(self, addr_a, addr_b):
"""
Test if two addresses belong to the same section.
:param int addr_a: The first address to test.
:param int addr_b: The second address to test.
:return: True if the two addresses belong to the same section ... | def _addrs_belong_to_same_section(self, addr_a, addr_b):
"""
Test if two addresses belong to the same section.
:param int addr_a: The first address to test.
:param int addr_b: The second address to test.
:return: True if the two addresses belong to the same section ... | [
"Test",
"if",
"two",
"addresses",
"belong",
"to",
"the",
"same",
"section",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L614-L642 | [
"def",
"_addrs_belong_to_same_section",
"(",
"self",
",",
"addr_a",
",",
"addr_b",
")",
":",
"obj",
"=",
"self",
".",
"project",
".",
"loader",
".",
"find_object_containing",
"(",
"addr_a",
",",
"membership_check",
"=",
"False",
")",
"if",
"obj",
"is",
"None... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._addr_hooked_or_syscall | Check whether the address belongs to a hook or a syscall.
:param int addr: The address to check.
:return: True if the address is hooked or belongs to a syscall. False otherwise.
:rtype: bool | angr/analyses/cfg/cfg_base.py | def _addr_hooked_or_syscall(self, addr):
"""
Check whether the address belongs to a hook or a syscall.
:param int addr: The address to check.
:return: True if the address is hooked or belongs to a syscall. False otherwise.
:rtype: bool
"""
... | def _addr_hooked_or_syscall(self, addr):
"""
Check whether the address belongs to a hook or a syscall.
:param int addr: The address to check.
:return: True if the address is hooked or belongs to a syscall. False otherwise.
:rtype: bool
"""
... | [
"Check",
"whether",
"the",
"address",
"belongs",
"to",
"a",
"hook",
"or",
"a",
"syscall",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L644-L653 | [
"def",
"_addr_hooked_or_syscall",
"(",
"self",
",",
"addr",
")",
":",
"return",
"self",
".",
"project",
".",
"is_hooked",
"(",
"addr",
")",
"or",
"self",
".",
"project",
".",
"simos",
".",
"is_syscall_addr",
"(",
"addr",
")"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._fast_memory_load_bytes | Perform a fast memory loading of some data.
:param int addr: Address to read from.
:param int length: Size of the string to load.
:return: A string or None if the address does not exist.
:rtype: bytes or None | angr/analyses/cfg/cfg_base.py | def _fast_memory_load_bytes(self, addr, length):
"""
Perform a fast memory loading of some data.
:param int addr: Address to read from.
:param int length: Size of the string to load.
:return: A string or None if the address does not exist.
:rtype: bytes ... | def _fast_memory_load_bytes(self, addr, length):
"""
Perform a fast memory loading of some data.
:param int addr: Address to read from.
:param int length: Size of the string to load.
:return: A string or None if the address does not exist.
:rtype: bytes ... | [
"Perform",
"a",
"fast",
"memory",
"loading",
"of",
"some",
"data",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L669-L682 | [
"def",
"_fast_memory_load_bytes",
"(",
"self",
",",
"addr",
",",
"length",
")",
":",
"try",
":",
"return",
"self",
".",
"project",
".",
"loader",
".",
"memory",
".",
"load",
"(",
"addr",
",",
"length",
")",
"except",
"KeyError",
":",
"return",
"None"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._fast_memory_load_pointer | Perform a fast memory loading of a pointer.
:param int addr: Address to read from.
:param int size: Size of the pointer. Default to machine-word size.
:return: A pointer or None if the address does not exist.
:rtype: int | angr/analyses/cfg/cfg_base.py | def _fast_memory_load_pointer(self, addr, size=None):
"""
Perform a fast memory loading of a pointer.
:param int addr: Address to read from.
:param int size: Size of the pointer. Default to machine-word size.
:return: A pointer or None if the address does not exist.
... | def _fast_memory_load_pointer(self, addr, size=None):
"""
Perform a fast memory loading of a pointer.
:param int addr: Address to read from.
:param int size: Size of the pointer. Default to machine-word size.
:return: A pointer or None if the address does not exist.
... | [
"Perform",
"a",
"fast",
"memory",
"loading",
"of",
"a",
"pointer",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L684-L697 | [
"def",
"_fast_memory_load_pointer",
"(",
"self",
",",
"addr",
",",
"size",
"=",
"None",
")",
":",
"try",
":",
"return",
"self",
".",
"project",
".",
"loader",
".",
"memory",
".",
"unpack_word",
"(",
"addr",
",",
"size",
"=",
"size",
")",
"except",
"Key... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._determine_function_returning | Determine if a function returns or not.
A function does not return if
a) it is a SimProcedure that has NO_RET being True,
or
b) it is completely recovered (i.e. every block of this function has been recovered, and no future block will
be added to it), and it does not have a r... | angr/analyses/cfg/cfg_base.py | def _determine_function_returning(self, func, all_funcs_completed=False):
"""
Determine if a function returns or not.
A function does not return if
a) it is a SimProcedure that has NO_RET being True,
or
b) it is completely recovered (i.e. every block of this function has... | def _determine_function_returning(self, func, all_funcs_completed=False):
"""
Determine if a function returns or not.
A function does not return if
a) it is a SimProcedure that has NO_RET being True,
or
b) it is completely recovered (i.e. every block of this function has... | [
"Determine",
"if",
"a",
"function",
"returns",
"or",
"not",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L703-L797 | [
"def",
"_determine_function_returning",
"(",
"self",
",",
"func",
",",
"all_funcs_completed",
"=",
"False",
")",
":",
"# If there is at least one return site, then this function is definitely returning",
"if",
"func",
".",
"has_return",
":",
"return",
"True",
"# Let's first s... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._analyze_function_features | For each function in the function_manager, try to determine if it returns or not. A function does not return if
it calls another function that is known to be not returning, and this function does not have other exits.
We might as well analyze other features of functions in the future.
:param b... | angr/analyses/cfg/cfg_base.py | def _analyze_function_features(self, all_funcs_completed=False):
"""
For each function in the function_manager, try to determine if it returns or not. A function does not return if
it calls another function that is known to be not returning, and this function does not have other exits.
... | def _analyze_function_features(self, all_funcs_completed=False):
"""
For each function in the function_manager, try to determine if it returns or not. A function does not return if
it calls another function that is known to be not returning, and this function does not have other exits.
... | [
"For",
"each",
"function",
"in",
"the",
"function_manager",
"try",
"to",
"determine",
"if",
"it",
"returns",
"or",
"not",
".",
"A",
"function",
"does",
"not",
"return",
"if",
"it",
"calls",
"another",
"function",
"that",
"is",
"known",
"to",
"be",
"not",
... | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L799-L857 | [
"def",
"_analyze_function_features",
"(",
"self",
",",
"all_funcs_completed",
"=",
"False",
")",
":",
"changes",
"=",
"{",
"'functions_return'",
":",
"[",
"]",
",",
"'functions_do_not_return'",
":",
"[",
"]",
"}",
"if",
"self",
".",
"_updated_nonreturning_function... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._iteratively_analyze_function_features | Iteratively analyze function features until a fixed point is reached.
:return: the "changes" dict
:rtype: dict | angr/analyses/cfg/cfg_base.py | def _iteratively_analyze_function_features(self, all_funcs_completed=False):
"""
Iteratively analyze function features until a fixed point is reached.
:return: the "changes" dict
:rtype: dict
"""
changes = {
'functions_do_not_return': set(),
'fu... | def _iteratively_analyze_function_features(self, all_funcs_completed=False):
"""
Iteratively analyze function features until a fixed point is reached.
:return: the "changes" dict
:rtype: dict
"""
changes = {
'functions_do_not_return': set(),
'fu... | [
"Iteratively",
"analyze",
"function",
"features",
"until",
"a",
"fixed",
"point",
"is",
"reached",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L859-L882 | [
"def",
"_iteratively_analyze_function_features",
"(",
"self",
",",
"all_funcs_completed",
"=",
"False",
")",
":",
"changes",
"=",
"{",
"'functions_do_not_return'",
":",
"set",
"(",
")",
",",
"'functions_return'",
":",
"set",
"(",
")",
"}",
"while",
"True",
":",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase.normalize | Normalize the CFG, making sure that there are no overlapping basic blocks.
Note that this method will not alter transition graphs of each function in self.kb.functions. You may call
normalize() on each Function object to normalize their transition graphs.
:return: None | angr/analyses/cfg/cfg_base.py | def normalize(self):
"""
Normalize the CFG, making sure that there are no overlapping basic blocks.
Note that this method will not alter transition graphs of each function in self.kb.functions. You may call
normalize() on each Function object to normalize their transition graphs.
... | def normalize(self):
"""
Normalize the CFG, making sure that there are no overlapping basic blocks.
Note that this method will not alter transition graphs of each function in self.kb.functions. You may call
normalize() on each Function object to normalize their transition graphs.
... | [
"Normalize",
"the",
"CFG",
"making",
"sure",
"that",
"there",
"are",
"no",
"overlapping",
"basic",
"blocks",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L884-L973 | [
"def",
"normalize",
"(",
"self",
")",
":",
"graph",
"=",
"self",
".",
"graph",
"smallest_nodes",
"=",
"{",
"}",
"# indexed by end address of the node",
"end_addresses_to_nodes",
"=",
"defaultdict",
"(",
"set",
")",
"for",
"n",
"in",
"graph",
".",
"nodes",
"(",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._get_finished_functions | Obtain all functions of which we have finished analyzing. As _jobs_to_analyze_per_function is a defaultdict(),
if a function address shows up in it with an empty job list, we consider we have exhausted all jobs of this
function (both current jobs and pending jobs), thus the analysis of this function is ... | angr/analyses/cfg/cfg_base.py | def _get_finished_functions(self):
"""
Obtain all functions of which we have finished analyzing. As _jobs_to_analyze_per_function is a defaultdict(),
if a function address shows up in it with an empty job list, we consider we have exhausted all jobs of this
function (both current jobs an... | def _get_finished_functions(self):
"""
Obtain all functions of which we have finished analyzing. As _jobs_to_analyze_per_function is a defaultdict(),
if a function address shows up in it with an empty job list, we consider we have exhausted all jobs of this
function (both current jobs an... | [
"Obtain",
"all",
"functions",
"of",
"which",
"we",
"have",
"finished",
"analyzing",
".",
"As",
"_jobs_to_analyze_per_function",
"is",
"a",
"defaultdict",
"()",
"if",
"a",
"function",
"address",
"shows",
"up",
"in",
"it",
"with",
"an",
"empty",
"job",
"list",
... | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L1110-L1126 | [
"def",
"_get_finished_functions",
"(",
"self",
")",
":",
"finished_func_addrs",
"=",
"[",
"]",
"for",
"func_addr",
",",
"all_jobs",
"in",
"self",
".",
"_jobs_to_analyze_per_function",
".",
"items",
"(",
")",
":",
"if",
"not",
"all_jobs",
":",
"# great! we have f... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._cleanup_analysis_jobs | From job manager, remove all functions of which we have finished analysis.
:param list or None finished_func_addrs: A list of addresses of functions of which we have finished analysis.
A new list of function addresses will be obtained by calling
... | angr/analyses/cfg/cfg_base.py | def _cleanup_analysis_jobs(self, finished_func_addrs=None):
"""
From job manager, remove all functions of which we have finished analysis.
:param list or None finished_func_addrs: A list of addresses of functions of which we have finished analysis.
... | def _cleanup_analysis_jobs(self, finished_func_addrs=None):
"""
From job manager, remove all functions of which we have finished analysis.
:param list or None finished_func_addrs: A list of addresses of functions of which we have finished analysis.
... | [
"From",
"job",
"manager",
"remove",
"all",
"functions",
"of",
"which",
"we",
"have",
"finished",
"analysis",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L1128-L1143 | [
"def",
"_cleanup_analysis_jobs",
"(",
"self",
",",
"finished_func_addrs",
"=",
"None",
")",
":",
"if",
"finished_func_addrs",
"is",
"None",
":",
"finished_func_addrs",
"=",
"self",
".",
"_get_finished_functions",
"(",
")",
"for",
"func_addr",
"in",
"finished_func_ad... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._make_completed_functions | Fill in self._completed_functions list and clean up job manager.
:return: None | angr/analyses/cfg/cfg_base.py | def _make_completed_functions(self):
"""
Fill in self._completed_functions list and clean up job manager.
:return: None
"""
finished = self._get_finished_functions()
for func_addr in finished:
self._completed_functions.add(func_addr)
self._cleanup_an... | def _make_completed_functions(self):
"""
Fill in self._completed_functions list and clean up job manager.
:return: None
"""
finished = self._get_finished_functions()
for func_addr in finished:
self._completed_functions.add(func_addr)
self._cleanup_an... | [
"Fill",
"in",
"self",
".",
"_completed_functions",
"list",
"and",
"clean",
"up",
"job",
"manager",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L1145-L1155 | [
"def",
"_make_completed_functions",
"(",
"self",
")",
":",
"finished",
"=",
"self",
".",
"_get_finished_functions",
"(",
")",
"for",
"func_addr",
"in",
"finished",
":",
"self",
".",
"_completed_functions",
".",
"add",
"(",
"func_addr",
")",
"self",
".",
"_clea... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase.remove_function_alignments | Remove all function alignments.
:return: None | angr/analyses/cfg/cfg_base.py | def remove_function_alignments(self):
"""
Remove all function alignments.
:return: None
"""
# This function requires Capstone engine support
if not self.project.arch.capstone_support:
return
for func_addr in self.kb.functions.keys():
fun... | def remove_function_alignments(self):
"""
Remove all function alignments.
:return: None
"""
# This function requires Capstone engine support
if not self.project.arch.capstone_support:
return
for func_addr in self.kb.functions.keys():
fun... | [
"Remove",
"all",
"function",
"alignments",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L1161-L1183 | [
"def",
"remove_function_alignments",
"(",
"self",
")",
":",
"# This function requires Capstone engine support",
"if",
"not",
"self",
".",
"project",
".",
"arch",
".",
"capstone_support",
":",
"return",
"for",
"func_addr",
"in",
"self",
".",
"kb",
".",
"functions",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase.make_functions | Revisit the entire control flow graph, create Function instances accordingly, and correctly put blocks into
each function.
Although Function objects are crated during the CFG recovery, they are neither sound nor accurate. With a
pre-constructed CFG, this method rebuilds all functions bearing th... | angr/analyses/cfg/cfg_base.py | def make_functions(self):
"""
Revisit the entire control flow graph, create Function instances accordingly, and correctly put blocks into
each function.
Although Function objects are crated during the CFG recovery, they are neither sound nor accurate. With a
pre-constructed CFG,... | def make_functions(self):
"""
Revisit the entire control flow graph, create Function instances accordingly, and correctly put blocks into
each function.
Although Function objects are crated during the CFG recovery, they are neither sound nor accurate. With a
pre-constructed CFG,... | [
"Revisit",
"the",
"entire",
"control",
"flow",
"graph",
"create",
"Function",
"instances",
"accordingly",
"and",
"correctly",
"put",
"blocks",
"into",
"each",
"function",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L1185-L1320 | [
"def",
"make_functions",
"(",
"self",
")",
":",
"# TODO: Is it required that PLT stubs are always aligned by 16? If so, on what architectures and platforms is it",
"# TODO: enforced?",
"tmp_functions",
"=",
"self",
".",
"kb",
".",
"functions",
".",
"copy",
"(",
")",
"for",
"... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._process_irrational_functions | For unresolveable indirect jumps, angr marks those jump targets as individual functions. For example, usually
the following pattern is seen:
sub_0x400010:
push ebp
mov esp, ebp
...
cmp eax, 10
ja end
mov eax, jumptable[eax]
... | angr/analyses/cfg/cfg_base.py | def _process_irrational_functions(self, functions, predetermined_function_addrs, blockaddr_to_function):
"""
For unresolveable indirect jumps, angr marks those jump targets as individual functions. For example, usually
the following pattern is seen:
sub_0x400010:
push ebp
... | def _process_irrational_functions(self, functions, predetermined_function_addrs, blockaddr_to_function):
"""
For unresolveable indirect jumps, angr marks those jump targets as individual functions. For example, usually
the following pattern is seen:
sub_0x400010:
push ebp
... | [
"For",
"unresolveable",
"indirect",
"jumps",
"angr",
"marks",
"those",
"jump",
"targets",
"as",
"individual",
"functions",
".",
"For",
"example",
"usually",
"the",
"following",
"pattern",
"is",
"seen",
":"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L1322-L1473 | [
"def",
"_process_irrational_functions",
"(",
"self",
",",
"functions",
",",
"predetermined_function_addrs",
",",
"blockaddr_to_function",
")",
":",
"functions_to_remove",
"=",
"{",
"}",
"functions_can_be_removed",
"=",
"set",
"(",
"functions",
".",
"keys",
"(",
")",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._process_irrational_function_starts | Functions that are identified via function prologues can be starting after the actual beginning of the function.
For example, the following function (with an incorrect start) might exist after a CFG recovery:
sub_8049f70:
push esi
sub_8049f71:
sub esp, 0A8h
... | angr/analyses/cfg/cfg_base.py | def _process_irrational_function_starts(self, functions, predetermined_function_addrs, blockaddr_to_function):
"""
Functions that are identified via function prologues can be starting after the actual beginning of the function.
For example, the following function (with an incorrect start) might ... | def _process_irrational_function_starts(self, functions, predetermined_function_addrs, blockaddr_to_function):
"""
Functions that are identified via function prologues can be starting after the actual beginning of the function.
For example, the following function (with an incorrect start) might ... | [
"Functions",
"that",
"are",
"identified",
"via",
"function",
"prologues",
"can",
"be",
"starting",
"after",
"the",
"actual",
"beginning",
"of",
"the",
"function",
".",
"For",
"example",
"the",
"following",
"function",
"(",
"with",
"an",
"incorrect",
"start",
"... | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L1475-L1557 | [
"def",
"_process_irrational_function_starts",
"(",
"self",
",",
"functions",
",",
"predetermined_function_addrs",
",",
"blockaddr_to_function",
")",
":",
"addrs",
"=",
"sorted",
"(",
"k",
"for",
"k",
"in",
"functions",
".",
"keys",
"(",
")",
"if",
"not",
"self",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._addr_to_function | Convert an address to a Function object, and store the mapping in a dict. If the block is known to be part of a
function, just return that function.
:param int addr: Address to convert
:param dict blockaddr_to_function: A mapping between block addresses to Function instances.
:param ang... | angr/analyses/cfg/cfg_base.py | def _addr_to_function(self, addr, blockaddr_to_function, known_functions):
"""
Convert an address to a Function object, and store the mapping in a dict. If the block is known to be part of a
function, just return that function.
:param int addr: Address to convert
:param dict blo... | def _addr_to_function(self, addr, blockaddr_to_function, known_functions):
"""
Convert an address to a Function object, and store the mapping in a dict. If the block is known to be part of a
function, just return that function.
:param int addr: Address to convert
:param dict blo... | [
"Convert",
"an",
"address",
"to",
"a",
"Function",
"object",
"and",
"store",
"the",
"mapping",
"in",
"a",
"dict",
".",
"If",
"the",
"block",
"is",
"known",
"to",
"be",
"part",
"of",
"a",
"function",
"just",
"return",
"that",
"function",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L1559-L1600 | [
"def",
"_addr_to_function",
"(",
"self",
",",
"addr",
",",
"blockaddr_to_function",
",",
"known_functions",
")",
":",
"if",
"addr",
"in",
"blockaddr_to_function",
":",
"f",
"=",
"blockaddr_to_function",
"[",
"addr",
"]",
"else",
":",
"is_syscall",
"=",
"self",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._is_tail_call_optimization | If source and destination belong to the same function, and the following criteria apply:
- source node has only one default exit
- destination is not one of the known functions
- destination does not belong to another function, or destination belongs to the same function that
source be... | angr/analyses/cfg/cfg_base.py | def _is_tail_call_optimization(self, g : networkx.DiGraph, src_addr, dst_addr, src_function, all_edges,
known_functions, blockaddr_to_function):
"""
If source and destination belong to the same function, and the following criteria apply:
- source node has only ... | def _is_tail_call_optimization(self, g : networkx.DiGraph, src_addr, dst_addr, src_function, all_edges,
known_functions, blockaddr_to_function):
"""
If source and destination belong to the same function, and the following criteria apply:
- source node has only ... | [
"If",
"source",
"and",
"destination",
"belong",
"to",
"the",
"same",
"function",
"and",
"the",
"following",
"criteria",
"apply",
":",
"-",
"source",
"node",
"has",
"only",
"one",
"default",
"exit",
"-",
"destination",
"is",
"not",
"one",
"of",
"the",
"know... | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L1602-L1663 | [
"def",
"_is_tail_call_optimization",
"(",
"self",
",",
"g",
":",
"networkx",
".",
"DiGraph",
",",
"src_addr",
",",
"dst_addr",
",",
"src_function",
",",
"all_edges",
",",
"known_functions",
",",
"blockaddr_to_function",
")",
":",
"def",
"_has_more_than_one_exit",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._graph_bfs_custom | A customized control flow graph BFS implementation with the following rules:
- Call edges are not followed.
- Syscall edges are not followed.
:param networkx.DiGraph g: The graph.
:param list starts: A collection of beginning nodes to start graph traversal.
:param func callback:... | angr/analyses/cfg/cfg_base.py | def _graph_bfs_custom(self, g, starts, callback, blockaddr_to_function, known_functions, traversed_cfg_nodes=None):
"""
A customized control flow graph BFS implementation with the following rules:
- Call edges are not followed.
- Syscall edges are not followed.
:param networkx.D... | def _graph_bfs_custom(self, g, starts, callback, blockaddr_to_function, known_functions, traversed_cfg_nodes=None):
"""
A customized control flow graph BFS implementation with the following rules:
- Call edges are not followed.
- Syscall edges are not followed.
:param networkx.D... | [
"A",
"customized",
"control",
"flow",
"graph",
"BFS",
"implementation",
"with",
"the",
"following",
"rules",
":",
"-",
"Call",
"edges",
"are",
"not",
"followed",
".",
"-",
"Syscall",
"edges",
"are",
"not",
"followed",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L1665-L1709 | [
"def",
"_graph_bfs_custom",
"(",
"self",
",",
"g",
",",
"starts",
",",
"callback",
",",
"blockaddr_to_function",
",",
"known_functions",
",",
"traversed_cfg_nodes",
"=",
"None",
")",
":",
"stack",
"=",
"OrderedSet",
"(",
"starts",
")",
"traversed",
"=",
"set",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._graph_traversal_handler | Graph traversal handler. It takes in a node or an edge, and create new functions or add nodes to existing
functions accordingly. Oh, it also create edges on the transition map of functions.
:param g: The control flow graph that is currently being traversed.
:param CFGNode src: Beginni... | angr/analyses/cfg/cfg_base.py | def _graph_traversal_handler(self, g, src, dst, data, blockaddr_to_function, known_functions, all_edges):
"""
Graph traversal handler. It takes in a node or an edge, and create new functions or add nodes to existing
functions accordingly. Oh, it also create edges on the transition map of functio... | def _graph_traversal_handler(self, g, src, dst, data, blockaddr_to_function, known_functions, all_edges):
"""
Graph traversal handler. It takes in a node or an edge, and create new functions or add nodes to existing
functions accordingly. Oh, it also create edges on the transition map of functio... | [
"Graph",
"traversal",
"handler",
".",
"It",
"takes",
"in",
"a",
"node",
"or",
"an",
"edge",
"and",
"create",
"new",
"functions",
"or",
"add",
"nodes",
"to",
"existing",
"functions",
"accordingly",
".",
"Oh",
"it",
"also",
"create",
"edges",
"on",
"the",
... | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L1711-L1922 | [
"def",
"_graph_traversal_handler",
"(",
"self",
",",
"g",
",",
"src",
",",
"dst",
",",
"data",
",",
"blockaddr_to_function",
",",
"known_functions",
",",
"all_edges",
")",
":",
"src_addr",
"=",
"src",
".",
"addr",
"src_function",
"=",
"self",
".",
"_addr_to_... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._is_noop_block | Check if the block is a no-op block by checking VEX statements.
:param block: The VEX block instance.
:return: True if the entire block is a single-byte or multi-byte nop instruction, False otherwise.
:rtype: bool | angr/analyses/cfg/cfg_base.py | def _is_noop_block(arch, block):
"""
Check if the block is a no-op block by checking VEX statements.
:param block: The VEX block instance.
:return: True if the entire block is a single-byte or multi-byte nop instruction, False otherwise.
:rtype: bool
"""
if arch... | def _is_noop_block(arch, block):
"""
Check if the block is a no-op block by checking VEX statements.
:param block: The VEX block instance.
:return: True if the entire block is a single-byte or multi-byte nop instruction, False otherwise.
:rtype: bool
"""
if arch... | [
"Check",
"if",
"the",
"block",
"is",
"a",
"no",
"-",
"op",
"block",
"by",
"checking",
"VEX",
"statements",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L1929-L1952 | [
"def",
"_is_noop_block",
"(",
"arch",
",",
"block",
")",
":",
"if",
"arch",
".",
"name",
"==",
"\"MIPS32\"",
":",
"if",
"arch",
".",
"memory_endness",
"==",
"\"Iend_BE\"",
":",
"MIPS32_BE_NOOPS",
"=",
"{",
"b\"\\x00\\x20\\x08\\x25\"",
",",
"# move $at, $at",
"... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._is_noop_insn | Check if the instruction does nothing.
:param insn: The capstone insn object.
:return: True if the instruction does no-op, False otherwise. | angr/analyses/cfg/cfg_base.py | def _is_noop_insn(insn):
"""
Check if the instruction does nothing.
:param insn: The capstone insn object.
:return: True if the instruction does no-op, False otherwise.
"""
if insn.insn_name() == 'nop':
# nops
return True
if insn.insn_nam... | def _is_noop_insn(insn):
"""
Check if the instruction does nothing.
:param insn: The capstone insn object.
:return: True if the instruction does no-op, False otherwise.
"""
if insn.insn_name() == 'nop':
# nops
return True
if insn.insn_nam... | [
"Check",
"if",
"the",
"instruction",
"does",
"nothing",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L1955-L1976 | [
"def",
"_is_noop_insn",
"(",
"insn",
")",
":",
"if",
"insn",
".",
"insn_name",
"(",
")",
"==",
"'nop'",
":",
"# nops",
"return",
"True",
"if",
"insn",
".",
"insn_name",
"(",
")",
"==",
"'lea'",
":",
"# lea reg, [reg + 0]",
"op0",
",",
"op1",
"=",
"insn... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._get_nop_length | Calculate the total size of leading nop instructions.
:param insns: A list of capstone insn objects.
:return: Number of bytes of leading nop instructions.
:rtype: int | angr/analyses/cfg/cfg_base.py | def _get_nop_length(cls, insns):
"""
Calculate the total size of leading nop instructions.
:param insns: A list of capstone insn objects.
:return: Number of bytes of leading nop instructions.
:rtype: int
"""
nop_length = 0
if insns and cls._is_noop_insn... | def _get_nop_length(cls, insns):
"""
Calculate the total size of leading nop instructions.
:param insns: A list of capstone insn objects.
:return: Number of bytes of leading nop instructions.
:rtype: int
"""
nop_length = 0
if insns and cls._is_noop_insn... | [
"Calculate",
"the",
"total",
"size",
"of",
"leading",
"nop",
"instructions",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L1979-L1998 | [
"def",
"_get_nop_length",
"(",
"cls",
",",
"insns",
")",
":",
"nop_length",
"=",
"0",
"if",
"insns",
"and",
"cls",
".",
"_is_noop_insn",
"(",
"insns",
"[",
"0",
"]",
")",
":",
"# see where those nop instructions terminate",
"for",
"insn",
"in",
"insns",
":",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._lift | Lift a basic block of code. Will use the base state as a source of bytes if possible. | angr/analyses/cfg/cfg_base.py | def _lift(self, *args, **kwargs):
"""
Lift a basic block of code. Will use the base state as a source of bytes if possible.
"""
if 'backup_state' not in kwargs:
kwargs['backup_state'] = self._base_state
return self.project.factory.block(*args, **kwargs) | def _lift(self, *args, **kwargs):
"""
Lift a basic block of code. Will use the base state as a source of bytes if possible.
"""
if 'backup_state' not in kwargs:
kwargs['backup_state'] = self._base_state
return self.project.factory.block(*args, **kwargs) | [
"Lift",
"a",
"basic",
"block",
"of",
"code",
".",
"Will",
"use",
"the",
"base",
"state",
"as",
"a",
"source",
"of",
"bytes",
"if",
"possible",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L2015-L2021 | [
"def",
"_lift",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'backup_state'",
"not",
"in",
"kwargs",
":",
"kwargs",
"[",
"'backup_state'",
"]",
"=",
"self",
".",
"_base_state",
"return",
"self",
".",
"project",
".",
"factory... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._resolve_indirect_jump_timelessly | Checks if MIPS32 and calls MIPS32 check, otherwise false
:param int addr: irsb address
:param pyvex.IRSB block: irsb
:param int func_addr: Function address
:return: If it was resolved and targets alongside it
:rtype: tuple | angr/analyses/cfg/cfg_base.py | def _resolve_indirect_jump_timelessly(self, addr, block, func_addr, jumpkind):
"""
Checks if MIPS32 and calls MIPS32 check, otherwise false
:param int addr: irsb address
:param pyvex.IRSB block: irsb
:param int func_addr: Function address
:return: If it was resolved and ... | def _resolve_indirect_jump_timelessly(self, addr, block, func_addr, jumpkind):
"""
Checks if MIPS32 and calls MIPS32 check, otherwise false
:param int addr: irsb address
:param pyvex.IRSB block: irsb
:param int func_addr: Function address
:return: If it was resolved and ... | [
"Checks",
"if",
"MIPS32",
"and",
"calls",
"MIPS32",
"check",
"otherwise",
"false"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L2027-L2046 | [
"def",
"_resolve_indirect_jump_timelessly",
"(",
"self",
",",
"addr",
",",
"block",
",",
"func_addr",
",",
"jumpkind",
")",
":",
"if",
"block",
".",
"statements",
"is",
"None",
":",
"block",
"=",
"self",
".",
"project",
".",
"factory",
".",
"block",
"(",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._indirect_jump_resolved | Called when an indirect jump is successfully resolved.
:param IndirectJump jump: The resolved indirect jump, or None if an IndirectJump instance is
not available.
:param int jump_addr: Address of the resolved in... | angr/analyses/cfg/cfg_base.py | def _indirect_jump_resolved(self, jump, jump_addr, resolved_by, targets):
"""
Called when an indirect jump is successfully resolved.
:param IndirectJump jump: The resolved indirect jump, or None if an IndirectJump instance is
... | def _indirect_jump_resolved(self, jump, jump_addr, resolved_by, targets):
"""
Called when an indirect jump is successfully resolved.
:param IndirectJump jump: The resolved indirect jump, or None if an IndirectJump instance is
... | [
"Called",
"when",
"an",
"indirect",
"jump",
"is",
"successfully",
"resolved",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L2048-L2064 | [
"def",
"_indirect_jump_resolved",
"(",
"self",
",",
"jump",
",",
"jump_addr",
",",
"resolved_by",
",",
"targets",
")",
":",
"addr",
"=",
"jump",
".",
"addr",
"if",
"jump",
"is",
"not",
"None",
"else",
"jump_addr",
"l",
".",
"debug",
"(",
"'The indirect jum... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._indirect_jump_unresolved | Called when we cannot resolve an indirect jump.
:param IndirectJump jump: The unresolved indirect jump.
:return: None | angr/analyses/cfg/cfg_base.py | def _indirect_jump_unresolved(self, jump):
"""
Called when we cannot resolve an indirect jump.
:param IndirectJump jump: The unresolved indirect jump.
:return: None
"""
l.debug('Failed to resolve the indirect jump at %#x.', jump.addr)
# tell KnowledgeBase that ... | def _indirect_jump_unresolved(self, jump):
"""
Called when we cannot resolve an indirect jump.
:param IndirectJump jump: The unresolved indirect jump.
:return: None
"""
l.debug('Failed to resolve the indirect jump at %#x.', jump.addr)
# tell KnowledgeBase that ... | [
"Called",
"when",
"we",
"cannot",
"resolve",
"an",
"indirect",
"jump",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L2066-L2078 | [
"def",
"_indirect_jump_unresolved",
"(",
"self",
",",
"jump",
")",
":",
"l",
".",
"debug",
"(",
"'Failed to resolve the indirect jump at %#x.'",
",",
"jump",
".",
"addr",
")",
"# tell KnowledgeBase that it's not resolved",
"# TODO: self.kb._unresolved_indirect_jumps is not proc... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._indirect_jump_encountered | Called when we encounter an indirect jump. We will try to resolve this indirect jump using timeless (fast)
indirect jump resolvers. If it cannot be resolved, we will see if this indirect jump has been resolved before.
:param int addr: Address of the block containing the indirect jump.
... | angr/analyses/cfg/cfg_base.py | def _indirect_jump_encountered(self, addr, cfg_node, irsb, func_addr, stmt_idx=DEFAULT_STATEMENT):
"""
Called when we encounter an indirect jump. We will try to resolve this indirect jump using timeless (fast)
indirect jump resolvers. If it cannot be resolved, we will see if this indirect jump h... | def _indirect_jump_encountered(self, addr, cfg_node, irsb, func_addr, stmt_idx=DEFAULT_STATEMENT):
"""
Called when we encounter an indirect jump. We will try to resolve this indirect jump using timeless (fast)
indirect jump resolvers. If it cannot be resolved, we will see if this indirect jump h... | [
"Called",
"when",
"we",
"encounter",
"an",
"indirect",
"jump",
".",
"We",
"will",
"try",
"to",
"resolve",
"this",
"indirect",
"jump",
"using",
"timeless",
"(",
"fast",
")",
"indirect",
"jump",
"resolvers",
".",
"If",
"it",
"cannot",
"be",
"resolved",
"we",... | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L2080-L2118 | [
"def",
"_indirect_jump_encountered",
"(",
"self",
",",
"addr",
",",
"cfg_node",
",",
"irsb",
",",
"func_addr",
",",
"stmt_idx",
"=",
"DEFAULT_STATEMENT",
")",
":",
"jumpkind",
"=",
"irsb",
".",
"jumpkind",
"l",
".",
"debug",
"(",
"'(%s) IRSB %#x has an indirect ... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._process_unresolved_indirect_jumps | Resolve all unresolved indirect jumps found in previous scanning.
Currently we support resolving the following types of indirect jumps:
- Ijk_Call: indirect calls where the function address is passed in from a proceeding basic block
- Ijk_Boring: jump tables
- For an up-to-date list, se... | angr/analyses/cfg/cfg_base.py | def _process_unresolved_indirect_jumps(self):
"""
Resolve all unresolved indirect jumps found in previous scanning.
Currently we support resolving the following types of indirect jumps:
- Ijk_Call: indirect calls where the function address is passed in from a proceeding basic block
... | def _process_unresolved_indirect_jumps(self):
"""
Resolve all unresolved indirect jumps found in previous scanning.
Currently we support resolving the following types of indirect jumps:
- Ijk_Call: indirect calls where the function address is passed in from a proceeding basic block
... | [
"Resolve",
"all",
"unresolved",
"indirect",
"jumps",
"found",
"in",
"previous",
"scanning",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L2120-L2143 | [
"def",
"_process_unresolved_indirect_jumps",
"(",
"self",
")",
":",
"l",
".",
"info",
"(",
"\"%d indirect jumps to resolve.\"",
",",
"len",
"(",
"self",
".",
"_indirect_jumps_to_resolve",
")",
")",
"all_targets",
"=",
"set",
"(",
")",
"for",
"idx",
",",
"jump",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CFGBase._process_one_indirect_jump | Resolve a given indirect jump.
:param IndirectJump jump: The IndirectJump instance.
:return: A set of resolved indirect jump targets (ints). | angr/analyses/cfg/cfg_base.py | def _process_one_indirect_jump(self, jump):
"""
Resolve a given indirect jump.
:param IndirectJump jump: The IndirectJump instance.
:return: A set of resolved indirect jump targets (ints).
"""
resolved = False
resolved_by = None
targets = None
... | def _process_one_indirect_jump(self, jump):
"""
Resolve a given indirect jump.
:param IndirectJump jump: The IndirectJump instance.
:return: A set of resolved indirect jump targets (ints).
"""
resolved = False
resolved_by = None
targets = None
... | [
"Resolve",
"a",
"given",
"indirect",
"jump",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_base.py#L2145-L2175 | [
"def",
"_process_one_indirect_jump",
"(",
"self",
",",
"jump",
")",
":",
"resolved",
"=",
"False",
"resolved_by",
"=",
"None",
"targets",
"=",
"None",
"block",
"=",
"self",
".",
"_lift",
"(",
"jump",
".",
"addr",
",",
"opt_level",
"=",
"1",
")",
"for",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | JumpTableResolver.resolve | Resolves jump tables.
:param cfg: A CFG instance.
:param int addr: IRSB address.
:param int func_addr: The function address.
:param pyvex.IRSB block: The IRSB.
:return: A bool indicating whether the indirect jump is resolved successfully, and a list of resolved targets
:... | angr/analyses/cfg/indirect_jump_resolvers/jumptable.py | def resolve(self, cfg, addr, func_addr, block, jumpkind):
"""
Resolves jump tables.
:param cfg: A CFG instance.
:param int addr: IRSB address.
:param int func_addr: The function address.
:param pyvex.IRSB block: The IRSB.
:return: A bool indicating whether the in... | def resolve(self, cfg, addr, func_addr, block, jumpkind):
"""
Resolves jump tables.
:param cfg: A CFG instance.
:param int addr: IRSB address.
:param int func_addr: The function address.
:param pyvex.IRSB block: The IRSB.
:return: A bool indicating whether the in... | [
"Resolves",
"jump",
"tables",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/indirect_jump_resolvers/jumptable.py#L78-L537 | [
"def",
"resolve",
"(",
"self",
",",
"cfg",
",",
"addr",
",",
"func_addr",
",",
"block",
",",
"jumpkind",
")",
":",
"project",
"=",
"self",
".",
"project",
"# short-hand",
"self",
".",
"_max_targets",
"=",
"cfg",
".",
"_indirect_jump_target_limit",
"# Perform... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | JumpTableResolver._parse_load_statement | Parse a memory load VEX statement and get the jump target addresses.
:param load_stmt: The VEX statement for loading the jump target addresses.
:param state: The SimState instance (in static mode).
:return: An abstract value (or a concrete value) representing the jump target ... | angr/analyses/cfg/indirect_jump_resolvers/jumptable.py | def _parse_load_statement(load_stmt, state):
"""
Parse a memory load VEX statement and get the jump target addresses.
:param load_stmt: The VEX statement for loading the jump target addresses.
:param state: The SimState instance (in static mode).
:return: An a... | def _parse_load_statement(load_stmt, state):
"""
Parse a memory load VEX statement and get the jump target addresses.
:param load_stmt: The VEX statement for loading the jump target addresses.
:param state: The SimState instance (in static mode).
:return: An a... | [
"Parse",
"a",
"memory",
"load",
"VEX",
"statement",
"and",
"get",
"the",
"jump",
"target",
"addresses",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/indirect_jump_resolvers/jumptable.py#L666-L724 | [
"def",
"_parse_load_statement",
"(",
"load_stmt",
",",
"state",
")",
":",
"# The jump table address is stored in a tmp. In this case, we find the jump-target loading tmp.",
"load_addr_tmp",
"=",
"None",
"if",
"isinstance",
"(",
"load_stmt",
",",
"pyvex",
".",
"IRStmt",
".",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SegmentList._search | Checks which segment that the address `addr` should belong to, and, returns the offset of that segment.
Note that the address may not actually belong to the block.
:param addr: The address to search
:return: The offset of the segment. | angr/analyses/cfg/segment_list.py | def _search(self, addr):
"""
Checks which segment that the address `addr` should belong to, and, returns the offset of that segment.
Note that the address may not actually belong to the block.
:param addr: The address to search
:return: The offset of the segment.
"""
... | def _search(self, addr):
"""
Checks which segment that the address `addr` should belong to, and, returns the offset of that segment.
Note that the address may not actually belong to the block.
:param addr: The address to search
:return: The offset of the segment.
"""
... | [
"Checks",
"which",
"segment",
"that",
"the",
"address",
"addr",
"should",
"belong",
"to",
"and",
"returns",
"the",
"offset",
"of",
"that",
"segment",
".",
"Note",
"that",
"the",
"address",
"may",
"not",
"actually",
"belong",
"to",
"the",
"block",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/segment_list.py#L76-L101 | [
"def",
"_search",
"(",
"self",
",",
"addr",
")",
":",
"start",
"=",
"0",
"end",
"=",
"len",
"(",
"self",
".",
"_list",
")",
"while",
"start",
"!=",
"end",
":",
"mid",
"=",
"(",
"start",
"+",
"end",
")",
"//",
"2",
"segment",
"=",
"self",
".",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SegmentList._insert_and_merge | Determines whether the block specified by (address, size) should be merged with adjacent blocks.
:param int address: Starting address of the block to be merged.
:param int size: Size of the block to be merged.
:param str sort: Type of the block.
:param int idx: ID of the address.
... | angr/analyses/cfg/segment_list.py | def _insert_and_merge(self, address, size, sort, idx):
"""
Determines whether the block specified by (address, size) should be merged with adjacent blocks.
:param int address: Starting address of the block to be merged.
:param int size: Size of the block to be merged.
:param str... | def _insert_and_merge(self, address, size, sort, idx):
"""
Determines whether the block specified by (address, size) should be merged with adjacent blocks.
:param int address: Starting address of the block to be merged.
:param int size: Size of the block to be merged.
:param str... | [
"Determines",
"whether",
"the",
"block",
"specified",
"by",
"(",
"address",
"size",
")",
"should",
"be",
"merged",
"with",
"adjacent",
"blocks",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/segment_list.py#L103-L152 | [
"def",
"_insert_and_merge",
"(",
"self",
",",
"address",
",",
"size",
",",
"sort",
",",
"idx",
")",
":",
"# sanity check",
"if",
"idx",
">",
"0",
"and",
"address",
"+",
"size",
"<=",
"self",
".",
"_list",
"[",
"idx",
"-",
"1",
"]",
".",
"start",
":... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SegmentList._insert_and_merge_core | The core part of method _insert_and_merge.
:param int pos: The starting position.
:param str direction: If we are traversing forwards or backwards in the list. It determines where the "sort"
of the overlapping memory block comes from. If everything works as exp... | angr/analyses/cfg/segment_list.py | def _insert_and_merge_core(self, pos, direction):
"""
The core part of method _insert_and_merge.
:param int pos: The starting position.
:param str direction: If we are traversing forwards or backwards in the list. It determines where the "sort"
... | def _insert_and_merge_core(self, pos, direction):
"""
The core part of method _insert_and_merge.
:param int pos: The starting position.
:param str direction: If we are traversing forwards or backwards in the list. It determines where the "sort"
... | [
"The",
"core",
"part",
"of",
"method",
"_insert_and_merge",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/segment_list.py#L154-L257 | [
"def",
"_insert_and_merge_core",
"(",
"self",
",",
"pos",
",",
"direction",
")",
":",
"bytes_changed",
"=",
"0",
"if",
"direction",
"==",
"\"forward\"",
":",
"if",
"pos",
"==",
"len",
"(",
"self",
".",
"_list",
")",
"-",
"1",
":",
"return",
"False",
",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SegmentList._dbg_output | Returns a string representation of the segments that form this SegmentList
:return: String representation of contents
:rtype: str | angr/analyses/cfg/segment_list.py | def _dbg_output(self):
"""
Returns a string representation of the segments that form this SegmentList
:return: String representation of contents
:rtype: str
"""
s = "["
lst = []
for segment in self._list:
lst.append(repr(segment))
s +=... | def _dbg_output(self):
"""
Returns a string representation of the segments that form this SegmentList
:return: String representation of contents
:rtype: str
"""
s = "["
lst = []
for segment in self._list:
lst.append(repr(segment))
s +=... | [
"Returns",
"a",
"string",
"representation",
"of",
"the",
"segments",
"that",
"form",
"this",
"SegmentList"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/segment_list.py#L259-L272 | [
"def",
"_dbg_output",
"(",
"self",
")",
":",
"s",
"=",
"\"[\"",
"lst",
"=",
"[",
"]",
"for",
"segment",
"in",
"self",
".",
"_list",
":",
"lst",
".",
"append",
"(",
"repr",
"(",
"segment",
")",
")",
"s",
"+=",
"\", \"",
".",
"join",
"(",
"lst",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SegmentList._debug_check | Iterates over list checking segments with same sort do not overlap
:raise: Exception: if segments overlap space with same sort | angr/analyses/cfg/segment_list.py | def _debug_check(self):
"""
Iterates over list checking segments with same sort do not overlap
:raise: Exception: if segments overlap space with same sort
"""
# old_start = 0
old_end = 0
old_sort = ""
for segment in self._list:
if segment.star... | def _debug_check(self):
"""
Iterates over list checking segments with same sort do not overlap
:raise: Exception: if segments overlap space with same sort
"""
# old_start = 0
old_end = 0
old_sort = ""
for segment in self._list:
if segment.star... | [
"Iterates",
"over",
"list",
"checking",
"segments",
"with",
"same",
"sort",
"do",
"not",
"overlap"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/segment_list.py#L274-L288 | [
"def",
"_debug_check",
"(",
"self",
")",
":",
"# old_start = 0",
"old_end",
"=",
"0",
"old_sort",
"=",
"\"\"",
"for",
"segment",
"in",
"self",
".",
"_list",
":",
"if",
"segment",
".",
"start",
"<=",
"old_end",
"and",
"segment",
".",
"sort",
"==",
"old_so... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SegmentList.next_free_pos | Returns the next free position with respect to an address, including that address itself
:param address: The address to begin the search with (including itself)
:return: The next free position | angr/analyses/cfg/segment_list.py | def next_free_pos(self, address):
"""
Returns the next free position with respect to an address, including that address itself
:param address: The address to begin the search with (including itself)
:return: The next free position
"""
idx = self._search(address)
... | def next_free_pos(self, address):
"""
Returns the next free position with respect to an address, including that address itself
:param address: The address to begin the search with (including itself)
:return: The next free position
"""
idx = self._search(address)
... | [
"Returns",
"the",
"next",
"free",
"position",
"with",
"respect",
"to",
"an",
"address",
"including",
"that",
"address",
"itself"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/segment_list.py#L294-L313 | [
"def",
"next_free_pos",
"(",
"self",
",",
"address",
")",
":",
"idx",
"=",
"self",
".",
"_search",
"(",
"address",
")",
"if",
"idx",
"<",
"len",
"(",
"self",
".",
"_list",
")",
"and",
"self",
".",
"_list",
"[",
"idx",
"]",
".",
"start",
"<=",
"ad... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SegmentList.next_pos_with_sort_not_in | Returns the address of the next occupied block whose sort is not one of the specified ones.
:param int address: The address to begin the search with (including itself).
:param sorts: A collection of sort strings.
:param max_distance: The maximum distance between `address` and the next ... | angr/analyses/cfg/segment_list.py | def next_pos_with_sort_not_in(self, address, sorts, max_distance=None):
"""
Returns the address of the next occupied block whose sort is not one of the specified ones.
:param int address: The address to begin the search with (including itself).
:param sorts: A collection of sort s... | def next_pos_with_sort_not_in(self, address, sorts, max_distance=None):
"""
Returns the address of the next occupied block whose sort is not one of the specified ones.
:param int address: The address to begin the search with (including itself).
:param sorts: A collection of sort s... | [
"Returns",
"the",
"address",
"of",
"the",
"next",
"occupied",
"block",
"whose",
"sort",
"is",
"not",
"one",
"of",
"the",
"specified",
"ones",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/segment_list.py#L315-L354 | [
"def",
"next_pos_with_sort_not_in",
"(",
"self",
",",
"address",
",",
"sorts",
",",
"max_distance",
"=",
"None",
")",
":",
"list_length",
"=",
"len",
"(",
"self",
".",
"_list",
")",
"idx",
"=",
"self",
".",
"_search",
"(",
"address",
")",
"if",
"idx",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SegmentList.is_occupied | Check if an address belongs to any segment
:param address: The address to check
:return: True if this address belongs to a segment, False otherwise | angr/analyses/cfg/segment_list.py | def is_occupied(self, address):
"""
Check if an address belongs to any segment
:param address: The address to check
:return: True if this address belongs to a segment, False otherwise
"""
idx = self._search(address)
if len(self._list) <= idx:
return ... | def is_occupied(self, address):
"""
Check if an address belongs to any segment
:param address: The address to check
:return: True if this address belongs to a segment, False otherwise
"""
idx = self._search(address)
if len(self._list) <= idx:
return ... | [
"Check",
"if",
"an",
"address",
"belongs",
"to",
"any",
"segment"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/segment_list.py#L356-L372 | [
"def",
"is_occupied",
"(",
"self",
",",
"address",
")",
":",
"idx",
"=",
"self",
".",
"_search",
"(",
"address",
")",
"if",
"len",
"(",
"self",
".",
"_list",
")",
"<=",
"idx",
":",
"return",
"False",
"if",
"self",
".",
"_list",
"[",
"idx",
"]",
"... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SegmentList.occupied_by_sort | Check if an address belongs to any segment, and if yes, returns the sort of the segment
:param int address: The address to check
:return: Sort of the segment that occupies this address
:rtype: str | angr/analyses/cfg/segment_list.py | def occupied_by_sort(self, address):
"""
Check if an address belongs to any segment, and if yes, returns the sort of the segment
:param int address: The address to check
:return: Sort of the segment that occupies this address
:rtype: str
"""
idx = self._search(a... | def occupied_by_sort(self, address):
"""
Check if an address belongs to any segment, and if yes, returns the sort of the segment
:param int address: The address to check
:return: Sort of the segment that occupies this address
:rtype: str
"""
idx = self._search(a... | [
"Check",
"if",
"an",
"address",
"belongs",
"to",
"any",
"segment",
"and",
"if",
"yes",
"returns",
"the",
"sort",
"of",
"the",
"segment"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/segment_list.py#L374-L391 | [
"def",
"occupied_by_sort",
"(",
"self",
",",
"address",
")",
":",
"idx",
"=",
"self",
".",
"_search",
"(",
"address",
")",
"if",
"len",
"(",
"self",
".",
"_list",
")",
"<=",
"idx",
":",
"return",
"None",
"if",
"self",
".",
"_list",
"[",
"idx",
"]",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SegmentList.occupy | Include a block, specified by (address, size), in this segment list.
:param int address: The starting address of the block.
:param int size: Size of the block.
:param str sort: Type of the block.
:return: None | angr/analyses/cfg/segment_list.py | def occupy(self, address, size, sort):
"""
Include a block, specified by (address, size), in this segment list.
:param int address: The starting address of the block.
:param int size: Size of the block.
:param str sort: Type of the block.
:return: None
... | def occupy(self, address, size, sort):
"""
Include a block, specified by (address, size), in this segment list.
:param int address: The starting address of the block.
:param int size: Size of the block.
:param str sort: Type of the block.
:return: None
... | [
"Include",
"a",
"block",
"specified",
"by",
"(",
"address",
"size",
")",
"in",
"this",
"segment",
"list",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/segment_list.py#L393-L416 | [
"def",
"occupy",
"(",
"self",
",",
"address",
",",
"size",
",",
"sort",
")",
":",
"if",
"size",
"is",
"None",
"or",
"size",
"<=",
"0",
":",
"# Cannot occupy a non-existent block",
"return",
"# l.debug(\"Occpuying 0x%08x-0x%08x\", address, address + size)",
"if",
"no... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SegmentList.copy | Make a copy of the SegmentList.
:return: A copy of the SegmentList instance.
:rtype: angr.analyses.cfg_fast.SegmentList | angr/analyses/cfg/segment_list.py | def copy(self):
"""
Make a copy of the SegmentList.
:return: A copy of the SegmentList instance.
:rtype: angr.analyses.cfg_fast.SegmentList
"""
n = SegmentList()
n._list = [ a.copy() for a in self._list ]
n._bytes_occupied = self._bytes_occupied
... | def copy(self):
"""
Make a copy of the SegmentList.
:return: A copy of the SegmentList instance.
:rtype: angr.analyses.cfg_fast.SegmentList
"""
n = SegmentList()
n._list = [ a.copy() for a in self._list ]
n._bytes_occupied = self._bytes_occupied
... | [
"Make",
"a",
"copy",
"of",
"the",
"SegmentList",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/segment_list.py#L420-L431 | [
"def",
"copy",
"(",
"self",
")",
":",
"n",
"=",
"SegmentList",
"(",
")",
"n",
".",
"_list",
"=",
"[",
"a",
".",
"copy",
"(",
")",
"for",
"a",
"in",
"self",
".",
"_list",
"]",
"n",
".",
"_bytes_occupied",
"=",
"self",
".",
"_bytes_occupied",
"retu... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CallingConventionAnalysis._analyze_function | Go over the variable information in variable manager for this function, and return all uninitialized
register/stack variables.
:return: | angr/analyses/calling_convention.py | def _analyze_function(self):
"""
Go over the variable information in variable manager for this function, and return all uninitialized
register/stack variables.
:return:
"""
if not self._function.is_simprocedure \
and not self._function.is_plt \
... | def _analyze_function(self):
"""
Go over the variable information in variable manager for this function, and return all uninitialized
register/stack variables.
:return:
"""
if not self._function.is_simprocedure \
and not self._function.is_plt \
... | [
"Go",
"over",
"the",
"variable",
"information",
"in",
"variable",
"manager",
"for",
"this",
"function",
"and",
"return",
"all",
"uninitialized",
"register",
"/",
"stack",
"variables",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/calling_convention.py#L48-L77 | [
"def",
"_analyze_function",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_function",
".",
"is_simprocedure",
"and",
"not",
"self",
".",
"_function",
".",
"is_plt",
"and",
"not",
"self",
".",
"_variable_manager",
".",
"has_function_manager",
"(",
"self",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | CallingConventionAnalysis._is_sane_register_variable | Filters all registers that are surly not members of function arguments.
This can be seen as a workaround, since VariableRecoveryFast sometimes gives input variables of cc_ndep (which
is a VEX-specific register) :-(
:param SimRegisterVariable variable: The variable to test.
:return: ... | angr/analyses/calling_convention.py | def _is_sane_register_variable(self, variable):
"""
Filters all registers that are surly not members of function arguments.
This can be seen as a workaround, since VariableRecoveryFast sometimes gives input variables of cc_ndep (which
is a VEX-specific register) :-(
:param SimRe... | def _is_sane_register_variable(self, variable):
"""
Filters all registers that are surly not members of function arguments.
This can be seen as a workaround, since VariableRecoveryFast sometimes gives input variables of cc_ndep (which
is a VEX-specific register) :-(
:param SimRe... | [
"Filters",
"all",
"registers",
"that",
"are",
"surly",
"not",
"members",
"of",
"function",
"arguments",
".",
"This",
"can",
"be",
"seen",
"as",
"a",
"workaround",
"since",
"VariableRecoveryFast",
"sometimes",
"gives",
"input",
"variables",
"of",
"cc_ndep",
"(",
... | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/calling_convention.py#L128-L164 | [
"def",
"_is_sane_register_variable",
"(",
"self",
",",
"variable",
")",
":",
"arch",
"=",
"self",
".",
"project",
".",
"arch",
"if",
"arch",
".",
"name",
"==",
"'AARCH64'",
":",
"return",
"16",
"<=",
"variable",
".",
"reg",
"<",
"80",
"# x0-x7",
"elif",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimLibrary.copy | Make a copy of this SimLibrary, allowing it to be mutated without affecting the global version.
:return: A new SimLibrary object with the same library references but different dict/list references | angr/procedures/definitions/__init__.py | def copy(self):
"""
Make a copy of this SimLibrary, allowing it to be mutated without affecting the global version.
:return: A new SimLibrary object with the same library references but different dict/list references
"""
o = SimLibrary()
o.procedures = dict(self.proce... | def copy(self):
"""
Make a copy of this SimLibrary, allowing it to be mutated without affecting the global version.
:return: A new SimLibrary object with the same library references but different dict/list references
"""
o = SimLibrary()
o.procedures = dict(self.proce... | [
"Make",
"a",
"copy",
"of",
"this",
"SimLibrary",
"allowing",
"it",
"to",
"be",
"mutated",
"without",
"affecting",
"the",
"global",
"version",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/definitions/__init__.py#L38-L50 | [
"def",
"copy",
"(",
"self",
")",
":",
"o",
"=",
"SimLibrary",
"(",
")",
"o",
".",
"procedures",
"=",
"dict",
"(",
"self",
".",
"procedures",
")",
"o",
".",
"non_returning",
"=",
"set",
"(",
"self",
".",
"non_returning",
")",
"o",
".",
"prototypes",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimLibrary.update | Augment this SimLibrary with the information from another SimLibrary
:param other: The other SimLibrary | angr/procedures/definitions/__init__.py | def update(self, other):
"""
Augment this SimLibrary with the information from another SimLibrary
:param other: The other SimLibrary
"""
self.procedures.update(other.procedures)
self.non_returning.update(other.non_returning)
self.prototypes.update(other.prototy... | def update(self, other):
"""
Augment this SimLibrary with the information from another SimLibrary
:param other: The other SimLibrary
"""
self.procedures.update(other.procedures)
self.non_returning.update(other.non_returning)
self.prototypes.update(other.prototy... | [
"Augment",
"this",
"SimLibrary",
"with",
"the",
"information",
"from",
"another",
"SimLibrary"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/definitions/__init__.py#L52-L61 | [
"def",
"update",
"(",
"self",
",",
"other",
")",
":",
"self",
".",
"procedures",
".",
"update",
"(",
"other",
".",
"procedures",
")",
"self",
".",
"non_returning",
".",
"update",
"(",
"other",
".",
"non_returning",
")",
"self",
".",
"prototypes",
".",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimLibrary.set_library_names | Set some common names of this library by which it may be referred during linking
:param names: Any number of string library names may be passed as varargs. | angr/procedures/definitions/__init__.py | def set_library_names(self, *names):
"""
Set some common names of this library by which it may be referred during linking
:param names: Any number of string library names may be passed as varargs.
"""
for name in names:
self.names.append(name)
SIM_LIBRA... | def set_library_names(self, *names):
"""
Set some common names of this library by which it may be referred during linking
:param names: Any number of string library names may be passed as varargs.
"""
for name in names:
self.names.append(name)
SIM_LIBRA... | [
"Set",
"some",
"common",
"names",
"of",
"this",
"library",
"by",
"which",
"it",
"may",
"be",
"referred",
"during",
"linking"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/definitions/__init__.py#L70-L78 | [
"def",
"set_library_names",
"(",
"self",
",",
"*",
"names",
")",
":",
"for",
"name",
"in",
"names",
":",
"self",
".",
"names",
".",
"append",
"(",
"name",
")",
"SIM_LIBRARIES",
"[",
"name",
"]",
"=",
"self"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimLibrary.set_default_cc | Set the default calling convention used for this library under a given architecture
:param arch_name: The string name of the architecture, i.e. the ``.name`` field from archinfo.
:parm cc_cls: The SimCC class (not an instance!) to use | angr/procedures/definitions/__init__.py | def set_default_cc(self, arch_name, cc_cls):
"""
Set the default calling convention used for this library under a given architecture
:param arch_name: The string name of the architecture, i.e. the ``.name`` field from archinfo.
:parm cc_cls: The SimCC class (not an instance!) to... | def set_default_cc(self, arch_name, cc_cls):
"""
Set the default calling convention used for this library under a given architecture
:param arch_name: The string name of the architecture, i.e. the ``.name`` field from archinfo.
:parm cc_cls: The SimCC class (not an instance!) to... | [
"Set",
"the",
"default",
"calling",
"convention",
"used",
"for",
"this",
"library",
"under",
"a",
"given",
"architecture"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/definitions/__init__.py#L80-L88 | [
"def",
"set_default_cc",
"(",
"self",
",",
"arch_name",
",",
"cc_cls",
")",
":",
"arch_name",
"=",
"archinfo",
".",
"arch_from_id",
"(",
"arch_name",
")",
".",
"name",
"self",
".",
"default_ccs",
"[",
"arch_name",
"]",
"=",
"cc_cls"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimLibrary.set_c_prototype | Set the prototype of a function in the form of a C-style function declaration.
:param str c_decl: The C-style declaration of the function.
:return: A tuple of (function name, function prototype)
:rtype: tuple | angr/procedures/definitions/__init__.py | def set_c_prototype(self, c_decl):
"""
Set the prototype of a function in the form of a C-style function declaration.
:param str c_decl: The C-style declaration of the function.
:return: A tuple of (function name, function prototype)
:rtype: tuple
""... | def set_c_prototype(self, c_decl):
"""
Set the prototype of a function in the form of a C-style function declaration.
:param str c_decl: The C-style declaration of the function.
:return: A tuple of (function name, function prototype)
:rtype: tuple
""... | [
"Set",
"the",
"prototype",
"of",
"a",
"function",
"in",
"the",
"form",
"of",
"a",
"C",
"-",
"style",
"function",
"declaration",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/definitions/__init__.py#L116-L133 | [
"def",
"set_c_prototype",
"(",
"self",
",",
"c_decl",
")",
":",
"parsed",
"=",
"parse_file",
"(",
"c_decl",
")",
"parsed_decl",
"=",
"parsed",
"[",
"0",
"]",
"if",
"not",
"parsed_decl",
":",
"raise",
"ValueError",
"(",
"'Cannot parse the function prototype.'",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimLibrary.add | Add a function implementation fo the library.
:param name: The name of the function as a string
:param proc_cls: The implementation of the function as a SimProcedure _class_, not instance
:param kwargs: Any additional parameters to the procedure class constructor may be passed as... | angr/procedures/definitions/__init__.py | def add(self, name, proc_cls, **kwargs):
"""
Add a function implementation fo the library.
:param name: The name of the function as a string
:param proc_cls: The implementation of the function as a SimProcedure _class_, not instance
:param kwargs: Any additional p... | def add(self, name, proc_cls, **kwargs):
"""
Add a function implementation fo the library.
:param name: The name of the function as a string
:param proc_cls: The implementation of the function as a SimProcedure _class_, not instance
:param kwargs: Any additional p... | [
"Add",
"a",
"function",
"implementation",
"fo",
"the",
"library",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/definitions/__init__.py#L135-L143 | [
"def",
"add",
"(",
"self",
",",
"name",
",",
"proc_cls",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"procedures",
"[",
"name",
"]",
"=",
"proc_cls",
"(",
"display_name",
"=",
"name",
",",
"*",
"*",
"kwargs",
")"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimLibrary.add_all_from_dict | Batch-add function implementations to the library.
:param dictionary: A mapping from name to procedure class, i.e. the first two arguments to add()
:param kwargs: Any additional kwargs will be passed to the constructors of _each_ procedure class | angr/procedures/definitions/__init__.py | def add_all_from_dict(self, dictionary, **kwargs):
"""
Batch-add function implementations to the library.
:param dictionary: A mapping from name to procedure class, i.e. the first two arguments to add()
:param kwargs: Any additional kwargs will be passed to the constructors of _ea... | def add_all_from_dict(self, dictionary, **kwargs):
"""
Batch-add function implementations to the library.
:param dictionary: A mapping from name to procedure class, i.e. the first two arguments to add()
:param kwargs: Any additional kwargs will be passed to the constructors of _ea... | [
"Batch",
"-",
"add",
"function",
"implementations",
"to",
"the",
"library",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/definitions/__init__.py#L145-L153 | [
"def",
"add_all_from_dict",
"(",
"self",
",",
"dictionary",
",",
"*",
"*",
"kwargs",
")",
":",
"for",
"name",
",",
"procedure",
"in",
"dictionary",
".",
"items",
"(",
")",
":",
"self",
".",
"add",
"(",
"name",
",",
"procedure",
",",
"*",
"*",
"kwargs... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimLibrary.add_alias | Add some duplicate names for a given function. The original function's implementation must already be
registered.
:param name: The name of the function for which an implementation is already present
:param alt_names: Any number of alternate names may be passed as varargs | angr/procedures/definitions/__init__.py | def add_alias(self, name, *alt_names):
"""
Add some duplicate names for a given function. The original function's implementation must already be
registered.
:param name: The name of the function for which an implementation is already present
:param alt_names: Any number... | def add_alias(self, name, *alt_names):
"""
Add some duplicate names for a given function. The original function's implementation must already be
registered.
:param name: The name of the function for which an implementation is already present
:param alt_names: Any number... | [
"Add",
"some",
"duplicate",
"names",
"for",
"a",
"given",
"function",
".",
"The",
"original",
"function",
"s",
"implementation",
"must",
"already",
"be",
"registered",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/definitions/__init__.py#L155-L167 | [
"def",
"add_alias",
"(",
"self",
",",
"name",
",",
"*",
"alt_names",
")",
":",
"old_procedure",
"=",
"self",
".",
"procedures",
"[",
"name",
"]",
"for",
"alt",
"in",
"alt_names",
":",
"new_procedure",
"=",
"copy",
".",
"deepcopy",
"(",
"old_procedure",
"... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimLibrary.get | Get an implementation of the given function specialized for the given arch, or a stub procedure if none exists.
:param name: The name of the function as a string
:param arch: The architecure to use, as either a string or an archinfo.Arch instance
:return: A SimProcedure instance re... | angr/procedures/definitions/__init__.py | def get(self, name, arch):
"""
Get an implementation of the given function specialized for the given arch, or a stub procedure if none exists.
:param name: The name of the function as a string
:param arch: The architecure to use, as either a string or an archinfo.Arch instance
... | def get(self, name, arch):
"""
Get an implementation of the given function specialized for the given arch, or a stub procedure if none exists.
:param name: The name of the function as a string
:param arch: The architecure to use, as either a string or an archinfo.Arch instance
... | [
"Get",
"an",
"implementation",
"of",
"the",
"given",
"function",
"specialized",
"for",
"the",
"given",
"arch",
"or",
"a",
"stub",
"procedure",
"if",
"none",
"exists",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/definitions/__init__.py#L188-L203 | [
"def",
"get",
"(",
"self",
",",
"name",
",",
"arch",
")",
":",
"if",
"type",
"(",
"arch",
")",
"is",
"str",
":",
"arch",
"=",
"archinfo",
".",
"arch_from_id",
"(",
"arch",
")",
"if",
"name",
"in",
"self",
".",
"procedures",
":",
"proc",
"=",
"cop... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimLibrary.get_stub | Get a stub procedure for the given function, regardless of if a real implementation is available. This will
apply any metadata, such as a default calling convention or a function prototype.
By stub, we pretty much always mean a ``ReturnUnconstrained`` SimProcedure with the appropriate display name
... | angr/procedures/definitions/__init__.py | def get_stub(self, name, arch):
"""
Get a stub procedure for the given function, regardless of if a real implementation is available. This will
apply any metadata, such as a default calling convention or a function prototype.
By stub, we pretty much always mean a ``ReturnUnconstrained``... | def get_stub(self, name, arch):
"""
Get a stub procedure for the given function, regardless of if a real implementation is available. This will
apply any metadata, such as a default calling convention or a function prototype.
By stub, we pretty much always mean a ``ReturnUnconstrained``... | [
"Get",
"a",
"stub",
"procedure",
"for",
"the",
"given",
"function",
"regardless",
"of",
"if",
"a",
"real",
"implementation",
"is",
"available",
".",
"This",
"will",
"apply",
"any",
"metadata",
"such",
"as",
"a",
"default",
"calling",
"convention",
"or",
"a",... | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/definitions/__init__.py#L205-L219 | [
"def",
"get_stub",
"(",
"self",
",",
"name",
",",
"arch",
")",
":",
"proc",
"=",
"self",
".",
"fallback_proc",
"(",
"display_name",
"=",
"name",
",",
"is_stub",
"=",
"True",
")",
"self",
".",
"_apply_metadata",
"(",
"proc",
",",
"arch",
")",
"return",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimLibrary.has_metadata | Check if a function has either an implementation or any metadata associated with it
:param name: The name of the function as a string
:return: A bool indicating if anything is known about the function | angr/procedures/definitions/__init__.py | def has_metadata(self, name):
"""
Check if a function has either an implementation or any metadata associated with it
:param name: The name of the function as a string
:return: A bool indicating if anything is known about the function
"""
return self.has_implem... | def has_metadata(self, name):
"""
Check if a function has either an implementation or any metadata associated with it
:param name: The name of the function as a string
:return: A bool indicating if anything is known about the function
"""
return self.has_implem... | [
"Check",
"if",
"a",
"function",
"has",
"either",
"an",
"implementation",
"or",
"any",
"metadata",
"associated",
"with",
"it"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/definitions/__init__.py#L221-L230 | [
"def",
"has_metadata",
"(",
"self",
",",
"name",
")",
":",
"return",
"self",
".",
"has_implementation",
"(",
"name",
")",
"or",
"name",
"in",
"self",
".",
"non_returning",
"or",
"name",
"in",
"self",
".",
"prototypes"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSyscallLibrary.minimum_syscall_number | :param abi: The abi to evaluate
:return: The smallest syscall number known for the given abi | angr/procedures/definitions/__init__.py | def minimum_syscall_number(self, abi):
"""
:param abi: The abi to evaluate
:return: The smallest syscall number known for the given abi
"""
if abi not in self.syscall_number_mapping or \
not self.syscall_number_mapping[abi]:
return 0
return ... | def minimum_syscall_number(self, abi):
"""
:param abi: The abi to evaluate
:return: The smallest syscall number known for the given abi
"""
if abi not in self.syscall_number_mapping or \
not self.syscall_number_mapping[abi]:
return 0
return ... | [
":",
"param",
"abi",
":",
"The",
"abi",
"to",
"evaluate",
":",
"return",
":",
"The",
"smallest",
"syscall",
"number",
"known",
"for",
"the",
"given",
"abi"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/definitions/__init__.py#L289-L297 | [
"def",
"minimum_syscall_number",
"(",
"self",
",",
"abi",
")",
":",
"if",
"abi",
"not",
"in",
"self",
".",
"syscall_number_mapping",
"or",
"not",
"self",
".",
"syscall_number_mapping",
"[",
"abi",
"]",
":",
"return",
"0",
"return",
"min",
"(",
"self",
".",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSyscallLibrary.maximum_syscall_number | :param abi: The abi to evaluate
:return: The largest syscall number known for the given abi | angr/procedures/definitions/__init__.py | def maximum_syscall_number(self, abi):
"""
:param abi: The abi to evaluate
:return: The largest syscall number known for the given abi
"""
if abi not in self.syscall_number_mapping or \
not self.syscall_number_mapping[abi]:
return 0
return m... | def maximum_syscall_number(self, abi):
"""
:param abi: The abi to evaluate
:return: The largest syscall number known for the given abi
"""
if abi not in self.syscall_number_mapping or \
not self.syscall_number_mapping[abi]:
return 0
return m... | [
":",
"param",
"abi",
":",
"The",
"abi",
"to",
"evaluate",
":",
"return",
":",
"The",
"largest",
"syscall",
"number",
"known",
"for",
"the",
"given",
"abi"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/definitions/__init__.py#L299-L307 | [
"def",
"maximum_syscall_number",
"(",
"self",
",",
"abi",
")",
":",
"if",
"abi",
"not",
"in",
"self",
".",
"syscall_number_mapping",
"or",
"not",
"self",
".",
"syscall_number_mapping",
"[",
"abi",
"]",
":",
"return",
"0",
"return",
"max",
"(",
"self",
".",... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSyscallLibrary.add_number_mapping | Associate a syscall number with the name of a function present in the underlying SimLibrary
:param abi: The abi for which this mapping applies
:param number: The syscall number
:param name: The name of the function | angr/procedures/definitions/__init__.py | def add_number_mapping(self, abi, number, name):
"""
Associate a syscall number with the name of a function present in the underlying SimLibrary
:param abi: The abi for which this mapping applies
:param number: The syscall number
:param name: The name of the function
... | def add_number_mapping(self, abi, number, name):
"""
Associate a syscall number with the name of a function present in the underlying SimLibrary
:param abi: The abi for which this mapping applies
:param number: The syscall number
:param name: The name of the function
... | [
"Associate",
"a",
"syscall",
"number",
"with",
"the",
"name",
"of",
"a",
"function",
"present",
"in",
"the",
"underlying",
"SimLibrary"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/definitions/__init__.py#L309-L318 | [
"def",
"add_number_mapping",
"(",
"self",
",",
"abi",
",",
"number",
",",
"name",
")",
":",
"self",
".",
"syscall_number_mapping",
"[",
"abi",
"]",
"[",
"number",
"]",
"=",
"name",
"self",
".",
"syscall_name_mapping",
"[",
"abi",
"]",
"[",
"name",
"]",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSyscallLibrary.add_number_mapping_from_dict | Batch-associate syscall numbers with names of functions present in the underlying SimLibrary
:param abi: The abi for which this mapping applies
:param mapping: A dict mapping syscall numbers to function names | angr/procedures/definitions/__init__.py | def add_number_mapping_from_dict(self, abi, mapping):
"""
Batch-associate syscall numbers with names of functions present in the underlying SimLibrary
:param abi: The abi for which this mapping applies
:param mapping: A dict mapping syscall numbers to function names
"""
... | def add_number_mapping_from_dict(self, abi, mapping):
"""
Batch-associate syscall numbers with names of functions present in the underlying SimLibrary
:param abi: The abi for which this mapping applies
:param mapping: A dict mapping syscall numbers to function names
"""
... | [
"Batch",
"-",
"associate",
"syscall",
"numbers",
"with",
"names",
"of",
"functions",
"present",
"in",
"the",
"underlying",
"SimLibrary"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/definitions/__init__.py#L320-L328 | [
"def",
"add_number_mapping_from_dict",
"(",
"self",
",",
"abi",
",",
"mapping",
")",
":",
"self",
".",
"syscall_number_mapping",
"[",
"abi",
"]",
".",
"update",
"(",
"mapping",
")",
"self",
".",
"syscall_name_mapping",
"[",
"abi",
"]",
".",
"update",
"(",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSyscallLibrary.get | The get() function for SimSyscallLibrary looks a little different from its original version.
Instead of providing a name, you provide a number, and you additionally provide a list of abi names that are
applicable. The first abi for which the number is present in the mapping will be chosen. This allows ... | angr/procedures/definitions/__init__.py | def get(self, number, arch, abi_list=()):
"""
The get() function for SimSyscallLibrary looks a little different from its original version.
Instead of providing a name, you provide a number, and you additionally provide a list of abi names that are
applicable. The first abi for which the... | def get(self, number, arch, abi_list=()):
"""
The get() function for SimSyscallLibrary looks a little different from its original version.
Instead of providing a name, you provide a number, and you additionally provide a list of abi names that are
applicable. The first abi for which the... | [
"The",
"get",
"()",
"function",
"for",
"SimSyscallLibrary",
"looks",
"a",
"little",
"different",
"from",
"its",
"original",
"version",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/definitions/__init__.py#L360-L380 | [
"def",
"get",
"(",
"self",
",",
"number",
",",
"arch",
",",
"abi_list",
"=",
"(",
")",
")",
":",
"name",
",",
"arch",
",",
"abi",
"=",
"self",
".",
"_canonicalize",
"(",
"number",
",",
"arch",
",",
"abi_list",
")",
"proc",
"=",
"super",
"(",
"Sim... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSyscallLibrary.get_stub | Pretty much the intersection of SimLibrary.get_stub() and SimSyscallLibrary.get().
:param number: The syscall number
:param arch: The architecture being worked with, as either a string name or an archinfo.Arch
:param abi_list: A list of ABI names that could be used
:retur... | angr/procedures/definitions/__init__.py | def get_stub(self, number, arch, abi_list=()):
"""
Pretty much the intersection of SimLibrary.get_stub() and SimSyscallLibrary.get().
:param number: The syscall number
:param arch: The architecture being worked with, as either a string name or an archinfo.Arch
:param... | def get_stub(self, number, arch, abi_list=()):
"""
Pretty much the intersection of SimLibrary.get_stub() and SimSyscallLibrary.get().
:param number: The syscall number
:param arch: The architecture being worked with, as either a string name or an archinfo.Arch
:param... | [
"Pretty",
"much",
"the",
"intersection",
"of",
"SimLibrary",
".",
"get_stub",
"()",
"and",
"SimSyscallLibrary",
".",
"get",
"()",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/definitions/__init__.py#L382-L395 | [
"def",
"get_stub",
"(",
"self",
",",
"number",
",",
"arch",
",",
"abi_list",
"=",
"(",
")",
")",
":",
"name",
",",
"arch",
",",
"abi",
"=",
"self",
".",
"_canonicalize",
"(",
"number",
",",
"arch",
",",
"abi_list",
")",
"proc",
"=",
"super",
"(",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimSyscallLibrary.has_implementation | Pretty much the intersection of SimLibrary.has_implementation() and SimSyscallLibrary.get().
:param number: The syscall number
:param arch: The architecture being worked with, as either a string name or an archinfo.Arch
:param abi_list: A list of ABI names that could be used
... | angr/procedures/definitions/__init__.py | def has_implementation(self, number, arch, abi_list=()):
"""
Pretty much the intersection of SimLibrary.has_implementation() and SimSyscallLibrary.get().
:param number: The syscall number
:param arch: The architecture being worked with, as either a string name or an archinfo... | def has_implementation(self, number, arch, abi_list=()):
"""
Pretty much the intersection of SimLibrary.has_implementation() and SimSyscallLibrary.get().
:param number: The syscall number
:param arch: The architecture being worked with, as either a string name or an archinfo... | [
"Pretty",
"much",
"the",
"intersection",
"of",
"SimLibrary",
".",
"has_implementation",
"()",
"and",
"SimSyscallLibrary",
".",
"get",
"()",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/definitions/__init__.py#L409-L419 | [
"def",
"has_implementation",
"(",
"self",
",",
"number",
",",
"arch",
",",
"abi_list",
"=",
"(",
")",
")",
":",
"name",
",",
"_",
",",
"_",
"=",
"self",
".",
"_canonicalize",
"(",
"number",
",",
"arch",
",",
"abi_list",
")",
"return",
"super",
"(",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimStateScratch.tmp_expr | Returns the Claripy expression of a VEX temp value.
:param tmp: the number of the tmp
:param simplify: simplify the tmp before returning it
:returns: a Claripy expression of the tmp | angr/state_plugins/scratch.py | def tmp_expr(self, tmp):
"""
Returns the Claripy expression of a VEX temp value.
:param tmp: the number of the tmp
:param simplify: simplify the tmp before returning it
:returns: a Claripy expression of the tmp
"""
self.state._inspect('tmp_read', BP_BEFORE, tmp_r... | def tmp_expr(self, tmp):
"""
Returns the Claripy expression of a VEX temp value.
:param tmp: the number of the tmp
:param simplify: simplify the tmp before returning it
:returns: a Claripy expression of the tmp
"""
self.state._inspect('tmp_read', BP_BEFORE, tmp_r... | [
"Returns",
"the",
"Claripy",
"expression",
"of",
"a",
"VEX",
"temp",
"value",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/scratch.py#L85-L102 | [
"def",
"tmp_expr",
"(",
"self",
",",
"tmp",
")",
":",
"self",
".",
"state",
".",
"_inspect",
"(",
"'tmp_read'",
",",
"BP_BEFORE",
",",
"tmp_read_num",
"=",
"tmp",
")",
"try",
":",
"v",
"=",
"self",
".",
"temps",
"[",
"tmp",
"]",
"if",
"v",
"is",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimStateScratch.store_tmp | Stores a Claripy expression in a VEX temp value.
If in symbolic mode, this involves adding a constraint for the tmp's symbolic variable.
:param tmp: the number of the tmp
:param content: a Claripy expression of the content
:param reg_deps: the register dependencies of the content
... | angr/state_plugins/scratch.py | def store_tmp(self, tmp, content, reg_deps=None, tmp_deps=None, deps=None):
"""
Stores a Claripy expression in a VEX temp value.
If in symbolic mode, this involves adding a constraint for the tmp's symbolic variable.
:param tmp: the number of the tmp
:param content: a Claripy ex... | def store_tmp(self, tmp, content, reg_deps=None, tmp_deps=None, deps=None):
"""
Stores a Claripy expression in a VEX temp value.
If in symbolic mode, this involves adding a constraint for the tmp's symbolic variable.
:param tmp: the number of the tmp
:param content: a Claripy ex... | [
"Stores",
"a",
"Claripy",
"expression",
"in",
"a",
"VEX",
"temp",
"value",
".",
"If",
"in",
"symbolic",
"mode",
"this",
"involves",
"adding",
"a",
"constraint",
"for",
"the",
"tmp",
"s",
"symbolic",
"variable",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/scratch.py#L104-L131 | [
"def",
"store_tmp",
"(",
"self",
",",
"tmp",
",",
"content",
",",
"reg_deps",
"=",
"None",
",",
"tmp_deps",
"=",
"None",
",",
"deps",
"=",
"None",
")",
":",
"self",
".",
"state",
".",
"_inspect",
"(",
"'tmp_write'",
",",
"BP_BEFORE",
",",
"tmp_write_nu... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimFilesystem._normalize_path | Takes a path and returns a simple absolute path as a list of directories from the root | angr/state_plugins/filesystem.py | def _normalize_path(self, path):
"""
Takes a path and returns a simple absolute path as a list of directories from the root
"""
if type(path) is str:
path = path.encode()
path = path.split(b'\0')[0]
if path[0:1] != self.pathsep:
path = self.cwd + ... | def _normalize_path(self, path):
"""
Takes a path and returns a simple absolute path as a list of directories from the root
"""
if type(path) is str:
path = path.encode()
path = path.split(b'\0')[0]
if path[0:1] != self.pathsep:
path = self.cwd + ... | [
"Takes",
"a",
"path",
"and",
"returns",
"a",
"simple",
"absolute",
"path",
"as",
"a",
"list",
"of",
"directories",
"from",
"the",
"root"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/filesystem.py#L118-L142 | [
"def",
"_normalize_path",
"(",
"self",
",",
"path",
")",
":",
"if",
"type",
"(",
"path",
")",
"is",
"str",
":",
"path",
"=",
"path",
".",
"encode",
"(",
")",
"path",
"=",
"path",
".",
"split",
"(",
"b'\\0'",
")",
"[",
"0",
"]",
"if",
"path",
"[... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimFilesystem.chdir | Changes the current directory to the given path | angr/state_plugins/filesystem.py | def chdir(self, path):
"""
Changes the current directory to the given path
"""
self.cwd = self._join_chunks(self._normalize_path(path)) | def chdir(self, path):
"""
Changes the current directory to the given path
"""
self.cwd = self._join_chunks(self._normalize_path(path)) | [
"Changes",
"the",
"current",
"directory",
"to",
"the",
"given",
"path"
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/filesystem.py#L150-L154 | [
"def",
"chdir",
"(",
"self",
",",
"path",
")",
":",
"self",
".",
"cwd",
"=",
"self",
".",
"_join_chunks",
"(",
"self",
".",
"_normalize_path",
"(",
"path",
")",
")"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimFilesystem.get | Get a file from the filesystem. Returns a SimFile or None. | angr/state_plugins/filesystem.py | def get(self, path):
"""
Get a file from the filesystem. Returns a SimFile or None.
"""
mountpoint, chunks = self.get_mountpoint(path)
if mountpoint is None:
return self._files.get(self._join_chunks(chunks))
else:
return mountpoint.get(chunks) | def get(self, path):
"""
Get a file from the filesystem. Returns a SimFile or None.
"""
mountpoint, chunks = self.get_mountpoint(path)
if mountpoint is None:
return self._files.get(self._join_chunks(chunks))
else:
return mountpoint.get(chunks) | [
"Get",
"a",
"file",
"from",
"the",
"filesystem",
".",
"Returns",
"a",
"SimFile",
"or",
"None",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/filesystem.py#L156-L165 | [
"def",
"get",
"(",
"self",
",",
"path",
")",
":",
"mountpoint",
",",
"chunks",
"=",
"self",
".",
"get_mountpoint",
"(",
"path",
")",
"if",
"mountpoint",
"is",
"None",
":",
"return",
"self",
".",
"_files",
".",
"get",
"(",
"self",
".",
"_join_chunks",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimFilesystem.insert | Insert a file into the filesystem. Returns whether the operation was successful. | angr/state_plugins/filesystem.py | def insert(self, path, simfile):
"""
Insert a file into the filesystem. Returns whether the operation was successful.
"""
if self.state is not None:
simfile.set_state(self.state)
mountpoint, chunks = self.get_mountpoint(path)
if mountpoint is None:
... | def insert(self, path, simfile):
"""
Insert a file into the filesystem. Returns whether the operation was successful.
"""
if self.state is not None:
simfile.set_state(self.state)
mountpoint, chunks = self.get_mountpoint(path)
if mountpoint is None:
... | [
"Insert",
"a",
"file",
"into",
"the",
"filesystem",
".",
"Returns",
"whether",
"the",
"operation",
"was",
"successful",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/filesystem.py#L167-L179 | [
"def",
"insert",
"(",
"self",
",",
"path",
",",
"simfile",
")",
":",
"if",
"self",
".",
"state",
"is",
"not",
"None",
":",
"simfile",
".",
"set_state",
"(",
"self",
".",
"state",
")",
"mountpoint",
",",
"chunks",
"=",
"self",
".",
"get_mountpoint",
"... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimFilesystem.delete | Remove a file from the filesystem. Returns whether the operation was successful.
This will add a ``fs_unlink`` event with the path of the file and also the index into the `unlinks` list. | angr/state_plugins/filesystem.py | def delete(self, path):
"""
Remove a file from the filesystem. Returns whether the operation was successful.
This will add a ``fs_unlink`` event with the path of the file and also the index into the `unlinks` list.
"""
mountpoint, chunks = self.get_mountpoint(path)
apath... | def delete(self, path):
"""
Remove a file from the filesystem. Returns whether the operation was successful.
This will add a ``fs_unlink`` event with the path of the file and also the index into the `unlinks` list.
"""
mountpoint, chunks = self.get_mountpoint(path)
apath... | [
"Remove",
"a",
"file",
"from",
"the",
"filesystem",
".",
"Returns",
"whether",
"the",
"operation",
"was",
"successful",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/filesystem.py#L181-L200 | [
"def",
"delete",
"(",
"self",
",",
"path",
")",
":",
"mountpoint",
",",
"chunks",
"=",
"self",
".",
"get_mountpoint",
"(",
"path",
")",
"apath",
"=",
"self",
".",
"_join_chunks",
"(",
"chunks",
")",
"if",
"mountpoint",
"is",
"None",
":",
"try",
":",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimFilesystem.mount | Add a mountpoint to the filesystem. | angr/state_plugins/filesystem.py | def mount(self, path, mount):
"""
Add a mountpoint to the filesystem.
"""
self._mountpoints[self._join_chunks(self._normalize_path(path))] = mount | def mount(self, path, mount):
"""
Add a mountpoint to the filesystem.
"""
self._mountpoints[self._join_chunks(self._normalize_path(path))] = mount | [
"Add",
"a",
"mountpoint",
"to",
"the",
"filesystem",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/filesystem.py#L202-L206 | [
"def",
"mount",
"(",
"self",
",",
"path",
",",
"mount",
")",
":",
"self",
".",
"_mountpoints",
"[",
"self",
".",
"_join_chunks",
"(",
"self",
".",
"_normalize_path",
"(",
"path",
")",
")",
"]",
"=",
"mount"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimFilesystem.unmount | Remove a mountpoint from the filesystem. | angr/state_plugins/filesystem.py | def unmount(self, path):
"""
Remove a mountpoint from the filesystem.
"""
del self._mountpoints[self._join_chunks(self._normalize_path(path))] | def unmount(self, path):
"""
Remove a mountpoint from the filesystem.
"""
del self._mountpoints[self._join_chunks(self._normalize_path(path))] | [
"Remove",
"a",
"mountpoint",
"from",
"the",
"filesystem",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/filesystem.py#L208-L212 | [
"def",
"unmount",
"(",
"self",
",",
"path",
")",
":",
"del",
"self",
".",
"_mountpoints",
"[",
"self",
".",
"_join_chunks",
"(",
"self",
".",
"_normalize_path",
"(",
"path",
")",
")",
"]"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | SimFilesystem.get_mountpoint | Look up the mountpoint servicing the given path.
:return: A tuple of the mount and a list of path elements traversing from the mountpoint to the specified file. | angr/state_plugins/filesystem.py | def get_mountpoint(self, path):
"""
Look up the mountpoint servicing the given path.
:return: A tuple of the mount and a list of path elements traversing from the mountpoint to the specified file.
"""
path_chunks = self._normalize_path(path)
for i in range(len(path_chunk... | def get_mountpoint(self, path):
"""
Look up the mountpoint servicing the given path.
:return: A tuple of the mount and a list of path elements traversing from the mountpoint to the specified file.
"""
path_chunks = self._normalize_path(path)
for i in range(len(path_chunk... | [
"Look",
"up",
"the",
"mountpoint",
"servicing",
"the",
"given",
"path",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/filesystem.py#L214-L229 | [
"def",
"get_mountpoint",
"(",
"self",
",",
"path",
")",
":",
"path_chunks",
"=",
"self",
".",
"_normalize_path",
"(",
"path",
")",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"path_chunks",
")",
"-",
"1",
",",
"-",
"1",
",",
"-",
"1",
")",
":",
"... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
train | JNISimProcedure._store_in_native_memory | Store in native memory.
:param data: Either a single value or a list.
Lists get interpreted as an array.
:param data_type: Java type of the element(s).
:param addr: Native store address.
If not set, native memory is allocated.
... | angr/procedures/java_jni/__init__.py | def _store_in_native_memory(self, data, data_type, addr=None):
"""
Store in native memory.
:param data: Either a single value or a list.
Lists get interpreted as an array.
:param data_type: Java type of the element(s).
:param addr: Native stor... | def _store_in_native_memory(self, data, data_type, addr=None):
"""
Store in native memory.
:param data: Either a single value or a list.
Lists get interpreted as an array.
:param data_type: Java type of the element(s).
:param addr: Native stor... | [
"Store",
"in",
"native",
"memory",
"."
] | angr/angr | python | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/java_jni/__init__.py#L46-L77 | [
"def",
"_store_in_native_memory",
"(",
"self",
",",
"data",
",",
"data_type",
",",
"addr",
"=",
"None",
")",
":",
"# check if addr is symbolic",
"if",
"addr",
"is",
"not",
"None",
"and",
"self",
".",
"state",
".",
"solver",
".",
"symbolic",
"(",
"addr",
")... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.