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
FormatParser._sim_atoi_inner
Return the result of invoking the atoi simprocedure on `str_addr`.
angr/procedures/stubs/format_parser.py
def _sim_atoi_inner(self, str_addr, region, base=10, read_length=None): """ Return the result of invoking the atoi simprocedure on `str_addr`. """ from .. import SIM_PROCEDURES strtol = SIM_PROCEDURES['libc']['strtol'] return strtol.strtol_inner(str_addr, self.state, re...
def _sim_atoi_inner(self, str_addr, region, base=10, read_length=None): """ Return the result of invoking the atoi simprocedure on `str_addr`. """ from .. import SIM_PROCEDURES strtol = SIM_PROCEDURES['libc']['strtol'] return strtol.strtol_inner(str_addr, self.state, re...
[ "Return", "the", "result", "of", "invoking", "the", "atoi", "simprocedure", "on", "str_addr", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/stubs/format_parser.py#L517-L525
[ "def", "_sim_atoi_inner", "(", "self", ",", "str_addr", ",", "region", ",", "base", "=", "10", ",", "read_length", "=", "None", ")", ":", "from", ".", ".", "import", "SIM_PROCEDURES", "strtol", "=", "SIM_PROCEDURES", "[", "'libc'", "]", "[", "'strtol'", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
FormatParser._sim_strlen
Return the result of invoking the strlen simprocedure on `str_addr`.
angr/procedures/stubs/format_parser.py
def _sim_strlen(self, str_addr): """ Return the result of invoking the strlen simprocedure on `str_addr`. """ from .. import SIM_PROCEDURES strlen = SIM_PROCEDURES['libc']['strlen'] return self.inline_call(strlen, str_addr).ret_expr
def _sim_strlen(self, str_addr): """ Return the result of invoking the strlen simprocedure on `str_addr`. """ from .. import SIM_PROCEDURES strlen = SIM_PROCEDURES['libc']['strlen'] return self.inline_call(strlen, str_addr).ret_expr
[ "Return", "the", "result", "of", "invoking", "the", "strlen", "simprocedure", "on", "str_addr", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/stubs/format_parser.py#L528-L536
[ "def", "_sim_strlen", "(", "self", ",", "str_addr", ")", ":", "from", ".", ".", "import", "SIM_PROCEDURES", "strlen", "=", "SIM_PROCEDURES", "[", "'libc'", "]", "[", "'strlen'", "]", "return", "self", ".", "inline_call", "(", "strlen", ",", "str_addr", ")"...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
FormatParser._parse
Parse format strings. :param fmt_idx: The index of the (pointer to the) format string in the arguments list. :returns: A FormatString object which can be used for replacing the format specifiers with arguments or for scanning into arguments.
angr/procedures/stubs/format_parser.py
def _parse(self, fmt_idx): """ Parse format strings. :param fmt_idx: The index of the (pointer to the) format string in the arguments list. :returns: A FormatString object which can be used for replacing the format specifiers with arguments or for scanning ...
def _parse(self, fmt_idx): """ Parse format strings. :param fmt_idx: The index of the (pointer to the) format string in the arguments list. :returns: A FormatString object which can be used for replacing the format specifiers with arguments or for scanning ...
[ "Parse", "format", "strings", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/stubs/format_parser.py#L539-L582
[ "def", "_parse", "(", "self", ",", "fmt_idx", ")", ":", "fmtstr_ptr", "=", "self", ".", "arg", "(", "fmt_idx", ")", "if", "self", ".", "state", ".", "solver", ".", "symbolic", "(", "fmtstr_ptr", ")", ":", "raise", "SimProcedureError", "(", "\"Symbolic po...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Unicorn._process_value
Pre-process an AST for insertion into unicorn. :param d: the AST :param from_where: the ID of the memory region it comes from ('mem' or 'reg') :returns: the value to be inserted into Unicorn, or None
angr/state_plugins/unicorn_engine.py
def _process_value(self, d, from_where): """ Pre-process an AST for insertion into unicorn. :param d: the AST :param from_where: the ID of the memory region it comes from ('mem' or 'reg') :returns: the value to be inserted into Unicorn, or None """ if len(d.annot...
def _process_value(self, d, from_where): """ Pre-process an AST for insertion into unicorn. :param d: the AST :param from_where: the ID of the memory region it comes from ('mem' or 'reg') :returns: the value to be inserted into Unicorn, or None """ if len(d.annot...
[ "Pre", "-", "process", "an", "AST", "for", "insertion", "into", "unicorn", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/unicorn_engine.py#L657-L684
[ "def", "_process_value", "(", "self", ",", "d", ",", "from_where", ")", ":", "if", "len", "(", "d", ".", "annotations", ")", ":", "l", ".", "debug", "(", "\"Blocking annotated AST.\"", ")", "return", "None", "elif", "not", "d", ".", "symbolic", ":", "r...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Unicorn._hook_mem_unmapped
This callback is called when unicorn needs to access data that's not yet present in memory.
angr/state_plugins/unicorn_engine.py
def _hook_mem_unmapped(self, uc, access, address, size, value, user_data, size_extension=True): #pylint:disable=unused-argument """ This callback is called when unicorn needs to access data that's not yet present in memory. """ # FIXME check angr hooks at `address` if size_exten...
def _hook_mem_unmapped(self, uc, access, address, size, value, user_data, size_extension=True): #pylint:disable=unused-argument """ This callback is called when unicorn needs to access data that's not yet present in memory. """ # FIXME check angr hooks at `address` if size_exten...
[ "This", "callback", "is", "called", "when", "unicorn", "needs", "to", "access", "data", "that", "s", "not", "yet", "present", "in", "memory", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/unicorn_engine.py#L686-L758
[ "def", "_hook_mem_unmapped", "(", "self", ",", "uc", ",", "access", ",", "address", ",", "size", ",", "value", ",", "user_data", ",", "size_extension", "=", "True", ")", ":", "#pylint:disable=unused-argument", "# FIXME check angr hooks at `address`", "if", "size_ext...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Unicorn.set_regs
setting unicorn registers
angr/state_plugins/unicorn_engine.py
def set_regs(self): ''' setting unicorn registers ''' uc = self.uc if self.state.arch.qemu_name == 'x86_64': fs = self.state.solver.eval(self.state.regs.fs) gs = self.state.solver.eval(self.state.regs.gs) self.write_msr(fs, 0xC0000100) self.write_...
def set_regs(self): ''' setting unicorn registers ''' uc = self.uc if self.state.arch.qemu_name == 'x86_64': fs = self.state.solver.eval(self.state.regs.fs) gs = self.state.solver.eval(self.state.regs.gs) self.write_msr(fs, 0xC0000100) self.write_...
[ "setting", "unicorn", "registers" ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/unicorn_engine.py#L1079-L1163
[ "def", "set_regs", "(", "self", ")", ":", "uc", "=", "self", ".", "uc", "if", "self", ".", "state", ".", "arch", ".", "qemu_name", "==", "'x86_64'", ":", "fs", "=", "self", ".", "state", ".", "solver", ".", "eval", "(", "self", ".", "state", ".",...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Unicorn.get_regs
loading registers from unicorn
angr/state_plugins/unicorn_engine.py
def get_regs(self): ''' loading registers from unicorn ''' # first, get the ignore list (in case of symbolic registers) if options.UNICORN_SYM_REGS_SUPPORT in self.state.options: highest_reg_offset, reg_size = max(self.state.arch.registers.values()) symbolic_list = (ctyp...
def get_regs(self): ''' loading registers from unicorn ''' # first, get the ignore list (in case of symbolic registers) if options.UNICORN_SYM_REGS_SUPPORT in self.state.options: highest_reg_offset, reg_size = max(self.state.arch.registers.values()) symbolic_list = (ctyp...
[ "loading", "registers", "from", "unicorn" ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/unicorn_engine.py#L1215-L1316
[ "def", "get_regs", "(", "self", ")", ":", "# first, get the ignore list (in case of symbolic registers)", "if", "options", ".", "UNICORN_SYM_REGS_SUPPORT", "in", "self", ".", "state", ".", "options", ":", "highest_reg_offset", ",", "reg_size", "=", "max", "(", "self",...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Unicorn._check_registers
check if this state might be used in unicorn (has no concrete register)
angr/state_plugins/unicorn_engine.py
def _check_registers(self, report=True): ''' check if this state might be used in unicorn (has no concrete register)''' for r in self.state.arch.uc_regs.keys(): v = getattr(self.state.regs, r) processed_v = self._process_value(v, 'reg') if processed_v is None or proce...
def _check_registers(self, report=True): ''' check if this state might be used in unicorn (has no concrete register)''' for r in self.state.arch.uc_regs.keys(): v = getattr(self.state.regs, r) processed_v = self._process_value(v, 'reg') if processed_v is None or proce...
[ "check", "if", "this", "state", "might", "be", "used", "in", "unicorn", "(", "has", "no", "concrete", "register", ")" ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/unicorn_engine.py#L1318-L1339
[ "def", "_check_registers", "(", "self", ",", "report", "=", "True", ")", ":", "for", "r", "in", "self", ".", "state", ".", "arch", ".", "uc_regs", ".", "keys", "(", ")", ":", "v", "=", "getattr", "(", "self", ".", "state", ".", "regs", ",", "r", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Clinic._track_stack_pointers
For each instruction, track its stack pointer offset and stack base pointer offset. :return: None
angr/analyses/decompiler/clinic.py
def _track_stack_pointers(self): """ For each instruction, track its stack pointer offset and stack base pointer offset. :return: None """ regs = {self.project.arch.sp_offset} if hasattr(self.project.arch, 'bp_offset') and self.project.arch.bp_offset is not None: ...
def _track_stack_pointers(self): """ For each instruction, track its stack pointer offset and stack base pointer offset. :return: None """ regs = {self.project.arch.sp_offset} if hasattr(self.project.arch, 'bp_offset') and self.project.arch.bp_offset is not None: ...
[ "For", "each", "instruction", "track", "its", "stack", "pointer", "offset", "and", "stack", "base", "pointer", "offset", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/decompiler/clinic.py#L107-L120
[ "def", "_track_stack_pointers", "(", "self", ")", ":", "regs", "=", "{", "self", ".", "project", ".", "arch", ".", "sp_offset", "}", "if", "hasattr", "(", "self", ".", "project", ".", "arch", ",", "'bp_offset'", ")", "and", "self", ".", "project", ".",...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Clinic._convert
Convert a VEX block to an AIL block. :param block_node: A BlockNode instance. :return: An converted AIL block. :rtype: ailment.Block
angr/analyses/decompiler/clinic.py
def _convert(self, block_node): """ Convert a VEX block to an AIL block. :param block_node: A BlockNode instance. :return: An converted AIL block. :rtype: ailment.Block """ if not type(block_node) is BlockNode: return block_no...
def _convert(self, block_node): """ Convert a VEX block to an AIL block. :param block_node: A BlockNode instance. :return: An converted AIL block. :rtype: ailment.Block """ if not type(block_node) is BlockNode: return block_no...
[ "Convert", "a", "VEX", "block", "to", "an", "AIL", "block", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/decompiler/clinic.py#L134-L149
[ "def", "_convert", "(", "self", ",", "block_node", ")", ":", "if", "not", "type", "(", "block_node", ")", "is", "BlockNode", ":", "return", "block_node", "block", "=", "self", ".", "project", ".", "factory", ".", "block", "(", "block_node", ".", "addr", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Clinic._simplify_blocks
Simplify all blocks in self._blocks. :param stack_pointer_tracker: The RegisterDeltaTracker analysis instance. :return: None
angr/analyses/decompiler/clinic.py
def _simplify_blocks(self, stack_pointer_tracker=None): """ Simplify all blocks in self._blocks. :param stack_pointer_tracker: The RegisterDeltaTracker analysis instance. :return: None """ # First of all, let's simplify blocks one by one ...
def _simplify_blocks(self, stack_pointer_tracker=None): """ Simplify all blocks in self._blocks. :param stack_pointer_tracker: The RegisterDeltaTracker analysis instance. :return: None """ # First of all, let's simplify blocks one by one ...
[ "Simplify", "all", "blocks", "in", "self", ".", "_blocks", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/decompiler/clinic.py#L151-L167
[ "def", "_simplify_blocks", "(", "self", ",", "stack_pointer_tracker", "=", "None", ")", ":", "# First of all, let's simplify blocks one by one", "for", "key", "in", "self", ".", "_blocks", ":", "ail_block", "=", "self", ".", "_blocks", "[", "key", "]", "simplified...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Clinic._simplify_block
Simplify a single AIL block. :param ailment.Block ail_block: The AIL block to simplify. :param stack_pointer_tracker: The RegisterDeltaTracker analysis instance. :return: A simplified AIL block.
angr/analyses/decompiler/clinic.py
def _simplify_block(self, ail_block, stack_pointer_tracker=None): """ Simplify a single AIL block. :param ailment.Block ail_block: The AIL block to simplify. :param stack_pointer_tracker: The RegisterDeltaTracker analysis instance. :return: A simplified ...
def _simplify_block(self, ail_block, stack_pointer_tracker=None): """ Simplify a single AIL block. :param ailment.Block ail_block: The AIL block to simplify. :param stack_pointer_tracker: The RegisterDeltaTracker analysis instance. :return: A simplified ...
[ "Simplify", "a", "single", "AIL", "block", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/decompiler/clinic.py#L169-L179
[ "def", "_simplify_block", "(", "self", ",", "ail_block", ",", "stack_pointer_tracker", "=", "None", ")", ":", "simp", "=", "self", ".", "project", ".", "analyses", ".", "AILBlockSimplifier", "(", "ail_block", ",", "stack_pointer_tracker", "=", "stack_pointer_track...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Clinic._simplify_function
Simplify the entire function. :return: None
angr/analyses/decompiler/clinic.py
def _simplify_function(self): """ Simplify the entire function. :return: None """ # Computing reaching definitions rd = self.project.analyses.ReachingDefinitions(func=self.function, func_graph=self.graph, observe_all=True) simp = self.project.analyses.AILSim...
def _simplify_function(self): """ Simplify the entire function. :return: None """ # Computing reaching definitions rd = self.project.analyses.ReachingDefinitions(func=self.function, func_graph=self.graph, observe_all=True) simp = self.project.analyses.AILSim...
[ "Simplify", "the", "entire", "function", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/decompiler/clinic.py#L181-L198
[ "def", "_simplify_function", "(", "self", ")", ":", "# Computing reaching definitions", "rd", "=", "self", ".", "project", ".", "analyses", ".", "ReachingDefinitions", "(", "func", "=", "self", ".", "function", ",", "func_graph", "=", "self", ".", "graph", ","...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Clinic._make_callsites
Simplify all function call statements. :return: None
angr/analyses/decompiler/clinic.py
def _make_callsites(self, stack_pointer_tracker=None): """ Simplify all function call statements. :return: None """ # Computing reaching definitions rd = self.project.analyses.ReachingDefinitions(func=self.function, func_graph=self.graph, observe_all=True) f...
def _make_callsites(self, stack_pointer_tracker=None): """ Simplify all function call statements. :return: None """ # Computing reaching definitions rd = self.project.analyses.ReachingDefinitions(func=self.function, func_graph=self.graph, observe_all=True) f...
[ "Simplify", "all", "function", "call", "statements", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/decompiler/clinic.py#L213-L231
[ "def", "_make_callsites", "(", "self", ",", "stack_pointer_tracker", "=", "None", ")", ":", "# Computing reaching definitions", "rd", "=", "self", ".", "project", ".", "analyses", ".", "ReachingDefinitions", "(", "func", "=", "self", ".", "function", ",", "func_...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Clinic._link_variables_on_block
Link atoms (AIL expressions) in the given block to corresponding variables identified previously. :param ailment.Block block: The AIL block to work on. :return: None
angr/analyses/decompiler/clinic.py
def _link_variables_on_block(self, block, kb): """ Link atoms (AIL expressions) in the given block to corresponding variables identified previously. :param ailment.Block block: The AIL block to work on. :return: None """ variable_manager = kb.variable...
def _link_variables_on_block(self, block, kb): """ Link atoms (AIL expressions) in the given block to corresponding variables identified previously. :param ailment.Block block: The AIL block to work on. :return: None """ variable_manager = kb.variable...
[ "Link", "atoms", "(", "AIL", "expressions", ")", "in", "the", "given", "block", "to", "corresponding", "variables", "identified", "previously", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/decompiler/clinic.py#L244-L273
[ "def", "_link_variables_on_block", "(", "self", ",", "block", ",", "kb", ")", ":", "variable_manager", "=", "kb", ".", "variables", "[", "self", ".", "function", ".", "addr", "]", "for", "stmt_idx", ",", "stmt", "in", "enumerate", "(", "block", ".", "sta...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Clinic._link_variables_on_expr
Link atoms (AIL expressions) in the given expression to corresponding variables identified previously. :param variable_manager: Variable manager of the function. :param ailment.Block block: AIL block. :param int stmt_idx: ID of the statement. :param stmt: The AI...
angr/analyses/decompiler/clinic.py
def _link_variables_on_expr(self, variable_manager, block, stmt_idx, stmt, expr): """ Link atoms (AIL expressions) in the given expression to corresponding variables identified previously. :param variable_manager: Variable manager of the function. :param ailment.Block block: AIL bloc...
def _link_variables_on_expr(self, variable_manager, block, stmt_idx, stmt, expr): """ Link atoms (AIL expressions) in the given expression to corresponding variables identified previously. :param variable_manager: Variable manager of the function. :param ailment.Block block: AIL bloc...
[ "Link", "atoms", "(", "AIL", "expressions", ")", "in", "the", "given", "expression", "to", "corresponding", "variables", "identified", "previously", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/decompiler/clinic.py#L275-L337
[ "def", "_link_variables_on_expr", "(", "self", ",", "variable_manager", ",", "block", ",", "stmt_idx", ",", "stmt", ",", "expr", ")", ":", "if", "type", "(", "expr", ")", "is", "ailment", ".", "Expr", ".", "Register", ":", "# find a register variable", "reg_...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
SimJavaVmClassloader.get_class
Get a class descriptor for the class. :param str class_name: Name of class. :param bool init_class: Whether the class initializer <clinit> should be executed. :param func step_func: Callback function executed at every step of the simulation manager during ...
angr/state_plugins/javavm_classloader.py
def get_class(self, class_name, init_class=False, step_func=None): """ Get a class descriptor for the class. :param str class_name: Name of class. :param bool init_class: Whether the class initializer <clinit> should be executed. :param func step...
def get_class(self, class_name, init_class=False, step_func=None): """ Get a class descriptor for the class. :param str class_name: Name of class. :param bool init_class: Whether the class initializer <clinit> should be executed. :param func step...
[ "Get", "a", "class", "descriptor", "for", "the", "class", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/javavm_classloader.py#L23-L41
[ "def", "get_class", "(", "self", ",", "class_name", ",", "init_class", "=", "False", ",", "step_func", "=", "None", ")", ":", "# try to get the soot class object from CLE", "java_binary", "=", "self", ".", "state", ".", "javavm_registers", ".", "load", "(", "'ip...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
SimJavaVmClassloader.get_superclass
Get the superclass of the class.
angr/state_plugins/javavm_classloader.py
def get_superclass(self, class_): """ Get the superclass of the class. """ if not class_.is_loaded or class_.superclass_name is None: return None return self.get_class(class_.superclass_name)
def get_superclass(self, class_): """ Get the superclass of the class. """ if not class_.is_loaded or class_.superclass_name is None: return None return self.get_class(class_.superclass_name)
[ "Get", "the", "superclass", "of", "the", "class", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/javavm_classloader.py#L43-L49
[ "def", "get_superclass", "(", "self", ",", "class_", ")", ":", "if", "not", "class_", ".", "is_loaded", "or", "class_", ".", "superclass_name", "is", "None", ":", "return", "None", "return", "self", ".", "get_class", "(", "class_", ".", "superclass_name", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
SimJavaVmClassloader.get_class_hierarchy
Walks up the class hierarchy and returns a list of all classes between base class (inclusive) and java.lang.Object (exclusive).
angr/state_plugins/javavm_classloader.py
def get_class_hierarchy(self, base_class): """ Walks up the class hierarchy and returns a list of all classes between base class (inclusive) and java.lang.Object (exclusive). """ classes = [base_class] while classes[-1] is not None and classes[-1] != "java.lang.Object": ...
def get_class_hierarchy(self, base_class): """ Walks up the class hierarchy and returns a list of all classes between base class (inclusive) and java.lang.Object (exclusive). """ classes = [base_class] while classes[-1] is not None and classes[-1] != "java.lang.Object": ...
[ "Walks", "up", "the", "class", "hierarchy", "and", "returns", "a", "list", "of", "all", "classes", "between", "base", "class", "(", "inclusive", ")", "and", "java", ".", "lang", ".", "Object", "(", "exclusive", ")", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/javavm_classloader.py#L51-L59
[ "def", "get_class_hierarchy", "(", "self", ",", "base_class", ")", ":", "classes", "=", "[", "base_class", "]", "while", "classes", "[", "-", "1", "]", "is", "not", "None", "and", "classes", "[", "-", "1", "]", "!=", "\"java.lang.Object\"", ":", "classes...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
SimJavaVmClassloader.init_class
This method simulates the loading of a class by the JVM, during which parts of the class (e.g. static fields) are initialized. For this, we run the class initializer method <clinit> (if available) and update the state accordingly. Note: Initialization is skipped, if the class has alread...
angr/state_plugins/javavm_classloader.py
def init_class(self, class_, step_func=None): """ This method simulates the loading of a class by the JVM, during which parts of the class (e.g. static fields) are initialized. For this, we run the class initializer method <clinit> (if available) and update the state accordingly....
def init_class(self, class_, step_func=None): """ This method simulates the loading of a class by the JVM, during which parts of the class (e.g. static fields) are initialized. For this, we run the class initializer method <clinit> (if available) and update the state accordingly....
[ "This", "method", "simulates", "the", "loading", "of", "a", "class", "by", "the", "JVM", "during", "which", "parts", "of", "the", "class", "(", "e", ".", "g", ".", "static", "fields", ")", "are", "initialized", ".", "For", "this", "we", "run", "the", ...
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/javavm_classloader.py#L68-L106
[ "def", "init_class", "(", "self", ",", "class_", ",", "step_func", "=", "None", ")", ":", "if", "self", ".", "is_class_initialized", "(", "class_", ")", ":", "l", ".", "debug", "(", "\"Class %r already initialized.\"", ",", "class_", ")", "return", "l", "....
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Blade._get_irsb
Get the IRSB object from an address, a SimRun, or a CFGNode. :param v: Can be one of the following: an address, or a CFGNode. :return: The IRSB instance. :rtype: pyvex.IRSB
angr/blade.py
def _get_irsb(self, v): """ Get the IRSB object from an address, a SimRun, or a CFGNode. :param v: Can be one of the following: an address, or a CFGNode. :return: The IRSB instance. :rtype: pyvex.IRSB """ if isinstance(v, CFGNode): v = v.addr ...
def _get_irsb(self, v): """ Get the IRSB object from an address, a SimRun, or a CFGNode. :param v: Can be one of the following: an address, or a CFGNode. :return: The IRSB instance. :rtype: pyvex.IRSB """ if isinstance(v, CFGNode): v = v.addr ...
[ "Get", "the", "IRSB", "object", "from", "an", "address", "a", "SimRun", "or", "a", "CFGNode", ".", ":", "param", "v", ":", "Can", "be", "one", "of", "the", "following", ":", "an", "address", "or", "a", "CFGNode", ".", ":", "return", ":", "The", "IR...
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/blade.py#L133-L158
[ "def", "_get_irsb", "(", "self", ",", "v", ")", ":", "if", "isinstance", "(", "v", ",", "CFGNode", ")", ":", "v", "=", "v", ".", "addr", "if", "type", "(", "v", ")", "is", "int", ":", "# Generate an IRSB from self._project", "if", "v", "in", "self", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Blade._get_addr
Get address of the basic block or CFG node specified by v. :param v: Can be one of the following: a CFGNode, or an address. :return: The address. :rtype: int
angr/blade.py
def _get_addr(self, v): """ Get address of the basic block or CFG node specified by v. :param v: Can be one of the following: a CFGNode, or an address. :return: The address. :rtype: int """ if isinstance(v, CFGNode): return v.addr elif type(v)...
def _get_addr(self, v): """ Get address of the basic block or CFG node specified by v. :param v: Can be one of the following: a CFGNode, or an address. :return: The address. :rtype: int """ if isinstance(v, CFGNode): return v.addr elif type(v)...
[ "Get", "address", "of", "the", "basic", "block", "or", "CFG", "node", "specified", "by", "v", ".", ":", "param", "v", ":", "Can", "be", "one", "of", "the", "following", ":", "a", "CFGNode", "or", "an", "address", ".", ":", "return", ":", "The", "ad...
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/blade.py#L171-L184
[ "def", "_get_addr", "(", "self", ",", "v", ")", ":", "if", "isinstance", "(", "v", ",", "CFGNode", ")", ":", "return", "v", ".", "addr", "elif", "type", "(", "v", ")", "is", "int", ":", "return", "v", "else", ":", "raise", "AngrBladeError", "(", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Blade._backward_slice
Backward slicing. We support the following IRStmts: # WrTmp # Put We support the following IRExprs: # Get # RdTmp # Const :return:
angr/blade.py
def _backward_slice(self): """ Backward slicing. We support the following IRStmts: # WrTmp # Put We support the following IRExprs: # Get # RdTmp # Const :return: """ temps = set() regs = set() # Retrieve...
def _backward_slice(self): """ Backward slicing. We support the following IRStmts: # WrTmp # Put We support the following IRExprs: # Get # RdTmp # Const :return: """ temps = set() regs = set() # Retrieve...
[ "Backward", "slicing", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/blade.py#L200-L287
[ "def", "_backward_slice", "(", "self", ")", ":", "temps", "=", "set", "(", ")", "regs", "=", "set", "(", ")", "# Retrieve the target: are we slicing from a register(IRStmt.Put), or a temp(IRStmt.WrTmp)?", "try", ":", "stmts", "=", "self", ".", "_get_irsb", "(", "sel...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
pc_calculate_condition_simple
A simplified version of pc_calculate_condition(). Please refer to the documentation of Simplified CCalls above. Limitation: symbolic flags are not supported for now.
angr/engines/vex/ccall.py
def pc_calculate_condition_simple(state, cond, cc_op, cc_dep1, cc_dep2, cc_ndep, platform=None): """ A simplified version of pc_calculate_condition(). Please refer to the documentation of Simplified CCalls above. Limitation: symbolic flags are not supported for now. """ if state.solver.symbolic(co...
def pc_calculate_condition_simple(state, cond, cc_op, cc_dep1, cc_dep2, cc_ndep, platform=None): """ A simplified version of pc_calculate_condition(). Please refer to the documentation of Simplified CCalls above. Limitation: symbolic flags are not supported for now. """ if state.solver.symbolic(co...
[ "A", "simplified", "version", "of", "pc_calculate_condition", "()", ".", "Please", "refer", "to", "the", "documentation", "of", "Simplified", "CCalls", "above", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/vex/ccall.py#L729-L778
[ "def", "pc_calculate_condition_simple", "(", "state", ",", "cond", ",", "cc_op", ",", "cc_dep1", ",", "cc_dep2", ",", "cc_ndep", ",", "platform", "=", "None", ")", ":", "if", "state", ".", "solver", ".", "symbolic", "(", "cond", ")", ":", "raise", "SimEr...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
_concat_flags
Concatenate different flag BVs to a single BV. Currently used for ARM, X86 and AMD64. :param nbits : platform size in bits. :param flags_vec: vector of flag BVs and their offset in the resulting BV. :type nbits : int :type flags_vec : list :return : the resulting flag BV. :r...
angr/engines/vex/ccall.py
def _concat_flags(nbits, flags_vec): """ Concatenate different flag BVs to a single BV. Currently used for ARM, X86 and AMD64. :param nbits : platform size in bits. :param flags_vec: vector of flag BVs and their offset in the resulting BV. :type nbits : int :type flags_vec : list ...
def _concat_flags(nbits, flags_vec): """ Concatenate different flag BVs to a single BV. Currently used for ARM, X86 and AMD64. :param nbits : platform size in bits. :param flags_vec: vector of flag BVs and their offset in the resulting BV. :type nbits : int :type flags_vec : list ...
[ "Concatenate", "different", "flag", "BVs", "to", "a", "single", "BV", ".", "Currently", "used", "for", "ARM", "X86", "and", "AMD64", ".", ":", "param", "nbits", ":", "platform", "size", "in", "bits", ".", ":", "param", "flags_vec", ":", "vector", "of", ...
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/vex/ccall.py#L1718-L1737
[ "def", "_concat_flags", "(", "nbits", ",", "flags_vec", ")", ":", "result", "=", "claripy", ".", "BVV", "(", "0", ",", "0", ")", "for", "offset", ",", "bit", "in", "flags_vec", ":", "current_position", "=", "nbits", "-", "1", "-", "result", ".", "len...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
RegionSimplifier._simplify
RegionSimplifier performs the following simplifications: - Remove redundant Gotos - Remove redundant If/If-else statements
angr/analyses/decompiler/region_simplifier.py
def _simplify(self): """ RegionSimplifier performs the following simplifications: - Remove redundant Gotos - Remove redundant If/If-else statements """ r = self.region r = self._simplify_gotos(r) r = self._simplify_ifs(r) self.result = r
def _simplify(self): """ RegionSimplifier performs the following simplifications: - Remove redundant Gotos - Remove redundant If/If-else statements """ r = self.region r = self._simplify_gotos(r) r = self._simplify_ifs(r) self.result = r
[ "RegionSimplifier", "performs", "the", "following", "simplifications", ":", "-", "Remove", "redundant", "Gotos", "-", "Remove", "redundant", "If", "/", "If", "-", "else", "statements" ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/decompiler/region_simplifier.py#L38-L49
[ "def", "_simplify", "(", "self", ")", ":", "r", "=", "self", ".", "region", "r", "=", "self", ".", "_simplify_gotos", "(", "r", ")", "r", "=", "self", ".", "_simplify_ifs", "(", "r", ")", "self", ".", "result", "=", "r" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Serializable.parse
Parse a bytes object and create a class object. :param bytes s: A bytes object. :return: A class object. :rtype: cls
angr/serializable.py
def parse(cls, s, **kwargs): """ Parse a bytes object and create a class object. :param bytes s: A bytes object. :return: A class object. :rtype: cls """ pb2_obj = cls._get_cmsg() pb2_obj.ParseFromString(s) return cls.parse_from_c...
def parse(cls, s, **kwargs): """ Parse a bytes object and create a class object. :param bytes s: A bytes object. :return: A class object. :rtype: cls """ pb2_obj = cls._get_cmsg() pb2_obj.ParseFromString(s) return cls.parse_from_c...
[ "Parse", "a", "bytes", "object", "and", "create", "a", "class", "object", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/serializable.py#L52-L64
[ "def", "parse", "(", "cls", ",", "s", ",", "*", "*", "kwargs", ")", ":", "pb2_obj", "=", "cls", ".", "_get_cmsg", "(", ")", "pb2_obj", ".", "ParseFromString", "(", "s", ")", "return", "cls", ".", "parse_from_cmessage", "(", "pb2_obj", ",", "*", "*", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
SimJavaVmMemory.store_array_elements
Stores either a single element or a range of elements in the array. :param array: Reference to the array. :param start_idx: Starting index for the store. :param data: Either a single value or a list of values.
angr/state_plugins/javavm_memory.py
def store_array_elements(self, array, start_idx, data): """ Stores either a single element or a range of elements in the array. :param array: Reference to the array. :param start_idx: Starting index for the store. :param data: Either a single value or a list of values. ...
def store_array_elements(self, array, start_idx, data): """ Stores either a single element or a range of elements in the array. :param array: Reference to the array. :param start_idx: Starting index for the store. :param data: Either a single value or a list of values. ...
[ "Stores", "either", "a", "single", "element", "or", "a", "range", "of", "elements", "in", "the", "array", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/javavm_memory.py#L133-L180
[ "def", "store_array_elements", "(", "self", ",", "array", ",", "start_idx", ",", "data", ")", ":", "# we process data as a list of elements", "# => if there is only a single element, wrap it in a list", "data", "=", "data", "if", "isinstance", "(", "data", ",", "list", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
SimJavaVmMemory.load_array_elements
Loads either a single element or a range of elements from the array. :param array: Reference to the array. :param start_idx: Starting index for the load. :param no_of_elements: Number of elements to load.
angr/state_plugins/javavm_memory.py
def load_array_elements(self, array, start_idx, no_of_elements): """ Loads either a single element or a range of elements from the array. :param array: Reference to the array. :param start_idx: Starting index for the load. :param no_of_elements: Number of elemen...
def load_array_elements(self, array, start_idx, no_of_elements): """ Loads either a single element or a range of elements from the array. :param array: Reference to the array. :param start_idx: Starting index for the load. :param no_of_elements: Number of elemen...
[ "Loads", "either", "a", "single", "element", "or", "a", "range", "of", "elements", "from", "the", "array", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/javavm_memory.py#L198-L252
[ "def", "load_array_elements", "(", "self", ",", "array", ",", "start_idx", ",", "no_of_elements", ")", ":", "# concretize start index", "concrete_start_idxes", "=", "self", ".", "concretize_load_idx", "(", "start_idx", ")", "if", "len", "(", "concrete_start_idxes", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
SimJavaVmMemory._apply_concretization_strategies
Applies concretization strategies on the index, until one of them succeeds.
angr/state_plugins/javavm_memory.py
def _apply_concretization_strategies(self, idx, strategies, action): # pylint: disable=unused-argument """ Applies concretization strategies on the index, until one of them succeeds. """ for s in strategies: try: idxes = s.concretize(self, idx) ex...
def _apply_concretization_strategies(self, idx, strategies, action): # pylint: disable=unused-argument """ Applies concretization strategies on the index, until one of them succeeds. """ for s in strategies: try: idxes = s.concretize(self, idx) ex...
[ "Applies", "concretization", "strategies", "on", "the", "index", "until", "one", "of", "them", "succeeds", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/javavm_memory.py#L272-L286
[ "def", "_apply_concretization_strategies", "(", "self", ",", "idx", ",", "strategies", ",", "action", ")", ":", "# pylint: disable=unused-argument", "for", "s", "in", "strategies", ":", "try", ":", "idxes", "=", "s", ".", "concretize", "(", "self", ",", "idx",...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
SimJavaVmMemory.concretize_store_idx
Concretizes a store index. :param idx: An expression for the index. :param strategies: A list of concretization strategies (to override the default). :param min_idx: Minimum value for a concretized index (inclusive). :param max_idx: Maximum value for a c...
angr/state_plugins/javavm_memory.py
def concretize_store_idx(self, idx, strategies=None): """ Concretizes a store index. :param idx: An expression for the index. :param strategies: A list of concretization strategies (to override the default). :param min_idx: Minimum value for a concretize...
def concretize_store_idx(self, idx, strategies=None): """ Concretizes a store index. :param idx: An expression for the index. :param strategies: A list of concretization strategies (to override the default). :param min_idx: Minimum value for a concretize...
[ "Concretizes", "a", "store", "index", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/javavm_memory.py#L288-L304
[ "def", "concretize_store_idx", "(", "self", ",", "idx", ",", "strategies", "=", "None", ")", ":", "if", "isinstance", "(", "idx", ",", "int", ")", ":", "return", "[", "idx", "]", "elif", "not", "self", ".", "state", ".", "solver", ".", "symbolic", "(...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
SimJavaVmMemory.concretize_load_idx
Concretizes a load index. :param idx: An expression for the index. :param strategies: A list of concretization strategies (to override the default). :param min_idx: Minimum value for a concretized index (inclusive). :param max_idx: Maximum value for a co...
angr/state_plugins/javavm_memory.py
def concretize_load_idx(self, idx, strategies=None): """ Concretizes a load index. :param idx: An expression for the index. :param strategies: A list of concretization strategies (to override the default). :param min_idx: Minimum value for a concretized ...
def concretize_load_idx(self, idx, strategies=None): """ Concretizes a load index. :param idx: An expression for the index. :param strategies: A list of concretization strategies (to override the default). :param min_idx: Minimum value for a concretized ...
[ "Concretizes", "a", "load", "index", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/javavm_memory.py#L306-L322
[ "def", "concretize_load_idx", "(", "self", ",", "idx", ",", "strategies", "=", "None", ")", ":", "if", "isinstance", "(", "idx", ",", "int", ")", ":", "return", "[", "idx", "]", "elif", "not", "self", ".", "state", ".", "solver", ".", "symbolic", "("...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated.copy
Make a copy of the CFG. :return: A copy of the CFG instance. :rtype: angr.analyses.CFG
angr/analyses/cfg/cfg_emulated.py
def copy(self): """ Make a copy of the CFG. :return: A copy of the CFG instance. :rtype: angr.analyses.CFG """ new_cfg = CFGEmulated.__new__(CFGEmulated) super(CFGEmulated, self).make_copy(new_cfg) new_cfg._indirect_jump_target_limit = self._indirect_jum...
def copy(self): """ Make a copy of the CFG. :return: A copy of the CFG instance. :rtype: angr.analyses.CFG """ new_cfg = CFGEmulated.__new__(CFGEmulated) super(CFGEmulated, self).make_copy(new_cfg) new_cfg._indirect_jump_target_limit = self._indirect_jum...
[ "Make", "a", "copy", "of", "the", "CFG", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L309-L335
[ "def", "copy", "(", "self", ")", ":", "new_cfg", "=", "CFGEmulated", ".", "__new__", "(", "CFGEmulated", ")", "super", "(", "CFGEmulated", ",", "self", ")", ".", "make_copy", "(", "new_cfg", ")", "new_cfg", ".", "_indirect_jump_target_limit", "=", "self", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated.resume
Resume a paused or terminated control flow graph recovery. :param iterable starts: A collection of new starts to resume from. If `starts` is None, we will resume CFG recovery from where it was paused before. :param int max_steps: The maximum number of blocks on the lon...
angr/analyses/cfg/cfg_emulated.py
def resume(self, starts=None, max_steps=None): """ Resume a paused or terminated control flow graph recovery. :param iterable starts: A collection of new starts to resume from. If `starts` is None, we will resume CFG recovery from where it was paused before. ...
def resume(self, starts=None, max_steps=None): """ Resume a paused or terminated control flow graph recovery. :param iterable starts: A collection of new starts to resume from. If `starts` is None, we will resume CFG recovery from where it was paused before. ...
[ "Resume", "a", "paused", "or", "terminated", "control", "flow", "graph", "recovery", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L337-L353
[ "def", "resume", "(", "self", ",", "starts", "=", "None", ",", "max_steps", "=", "None", ")", ":", "self", ".", "_starts", "=", "starts", "self", ".", "_max_steps", "=", "max_steps", "self", ".", "_sanitize_starts", "(", ")", "self", ".", "_analyze", "...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated.remove_cycles
Forces graph to become acyclic, removes all loop back edges and edges between overlapped loop headers and their successors.
angr/analyses/cfg/cfg_emulated.py
def remove_cycles(self): """ Forces graph to become acyclic, removes all loop back edges and edges between overlapped loop headers and their successors. """ # loop detection # only detect loops after potential graph normalization if not self._loop_back_edges: ...
def remove_cycles(self): """ Forces graph to become acyclic, removes all loop back edges and edges between overlapped loop headers and their successors. """ # loop detection # only detect loops after potential graph normalization if not self._loop_back_edges: ...
[ "Forces", "graph", "to", "become", "acyclic", "removes", "all", "loop", "back", "edges", "and", "edges", "between", "overlapped", "loop", "headers", "and", "their", "successors", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L355-L379
[ "def", "remove_cycles", "(", "self", ")", ":", "# loop detection", "# only detect loops after potential graph normalization", "if", "not", "self", ".", "_loop_back_edges", ":", "l", ".", "debug", "(", "\"Detecting loops...\"", ")", "self", ".", "_detect_loops", "(", "...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated.unroll_loops
Unroll loops for each function. The resulting CFG may still contain loops due to recursion, function calls, etc. :param int max_loop_unrolling_times: The maximum iterations of unrolling. :return: None
angr/analyses/cfg/cfg_emulated.py
def unroll_loops(self, max_loop_unrolling_times): """ Unroll loops for each function. The resulting CFG may still contain loops due to recursion, function calls, etc. :param int max_loop_unrolling_times: The maximum iterations of unrolling. :return: None """ if not isin...
def unroll_loops(self, max_loop_unrolling_times): """ Unroll loops for each function. The resulting CFG may still contain loops due to recursion, function calls, etc. :param int max_loop_unrolling_times: The maximum iterations of unrolling. :return: None """ if not isin...
[ "Unroll", "loops", "for", "each", "function", ".", "The", "resulting", "CFG", "may", "still", "contain", "loops", "due", "to", "recursion", "function", "calls", "etc", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L391-L444
[ "def", "unroll_loops", "(", "self", ",", "max_loop_unrolling_times", ")", ":", "if", "not", "isinstance", "(", "max_loop_unrolling_times", ",", "int", ")", "or", "max_loop_unrolling_times", "<", "0", ":", "raise", "AngrCFGError", "(", "'Max loop unrolling times must b...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated.force_unroll_loops
Unroll loops globally. The resulting CFG does not contain any loop, but this method is slow on large graphs. :param int max_loop_unrolling_times: The maximum iterations of unrolling. :return: None
angr/analyses/cfg/cfg_emulated.py
def force_unroll_loops(self, max_loop_unrolling_times): """ Unroll loops globally. The resulting CFG does not contain any loop, but this method is slow on large graphs. :param int max_loop_unrolling_times: The maximum iterations of unrolling. :return: None """ if not is...
def force_unroll_loops(self, max_loop_unrolling_times): """ Unroll loops globally. The resulting CFG does not contain any loop, but this method is slow on large graphs. :param int max_loop_unrolling_times: The maximum iterations of unrolling. :return: None """ if not is...
[ "Unroll", "loops", "globally", ".", "The", "resulting", "CFG", "does", "not", "contain", "any", "loop", "but", "this", "method", "is", "slow", "on", "large", "graphs", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L446-L562
[ "def", "force_unroll_loops", "(", "self", ",", "max_loop_unrolling_times", ")", ":", "if", "not", "isinstance", "(", "max_loop_unrolling_times", ",", "int", ")", "or", "max_loop_unrolling_times", "<", "0", ":", "raise", "AngrCFGError", "(", "'Max loop unrolling times ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated.immediate_dominators
Get all immediate dominators of sub graph from given node upwards. :param str start: id of the node to navigate forwards from. :param networkx.classes.digraph.DiGraph target_graph: graph to analyse, default is self.graph. :return: each node of graph as index values, with element as respective ...
angr/analyses/cfg/cfg_emulated.py
def immediate_dominators(self, start, target_graph=None): """ Get all immediate dominators of sub graph from given node upwards. :param str start: id of the node to navigate forwards from. :param networkx.classes.digraph.DiGraph target_graph: graph to analyse, default is self.graph. ...
def immediate_dominators(self, start, target_graph=None): """ Get all immediate dominators of sub graph from given node upwards. :param str start: id of the node to navigate forwards from. :param networkx.classes.digraph.DiGraph target_graph: graph to analyse, default is self.graph. ...
[ "Get", "all", "immediate", "dominators", "of", "sub", "graph", "from", "given", "node", "upwards", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L564-L574
[ "def", "immediate_dominators", "(", "self", ",", "start", ",", "target_graph", "=", "None", ")", ":", "return", "self", ".", "_immediate_dominators", "(", "start", ",", "target_graph", "=", "target_graph", ",", "reverse_graph", "=", "False", ")" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated.immediate_postdominators
Get all immediate postdominators of sub graph from given node upwards. :param str start: id of the node to navigate forwards from. :param networkx.classes.digraph.DiGraph target_graph: graph to analyse, default is self.graph. :return: each node of graph as index values, with element as respect...
angr/analyses/cfg/cfg_emulated.py
def immediate_postdominators(self, end, target_graph=None): """ Get all immediate postdominators of sub graph from given node upwards. :param str start: id of the node to navigate forwards from. :param networkx.classes.digraph.DiGraph target_graph: graph to analyse, default is self.grap...
def immediate_postdominators(self, end, target_graph=None): """ Get all immediate postdominators of sub graph from given node upwards. :param str start: id of the node to navigate forwards from. :param networkx.classes.digraph.DiGraph target_graph: graph to analyse, default is self.grap...
[ "Get", "all", "immediate", "postdominators", "of", "sub", "graph", "from", "given", "node", "upwards", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L576-L586
[ "def", "immediate_postdominators", "(", "self", ",", "end", ",", "target_graph", "=", "None", ")", ":", "return", "self", ".", "_immediate_dominators", "(", "end", ",", "target_graph", "=", "target_graph", ",", "reverse_graph", "=", "True", ")" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated.remove_fakerets
Get rid of fake returns (i.e., Ijk_FakeRet edges) from this CFG :return: None
angr/analyses/cfg/cfg_emulated.py
def remove_fakerets(self): """ Get rid of fake returns (i.e., Ijk_FakeRet edges) from this CFG :return: None """ fakeret_edges = [ (src, dst) for src, dst, data in self.graph.edges(data=True) if data['jumpkind'] == 'Ijk_FakeRet' ] self.graph.remo...
def remove_fakerets(self): """ Get rid of fake returns (i.e., Ijk_FakeRet edges) from this CFG :return: None """ fakeret_edges = [ (src, dst) for src, dst, data in self.graph.edges(data=True) if data['jumpkind'] == 'Ijk_FakeRet' ] self.graph.remo...
[ "Get", "rid", "of", "fake", "returns", "(", "i", ".", "e", ".", "Ijk_FakeRet", "edges", ")", "from", "this", "CFG" ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L588-L596
[ "def", "remove_fakerets", "(", "self", ")", ":", "fakeret_edges", "=", "[", "(", "src", ",", "dst", ")", "for", "src", ",", "dst", ",", "data", "in", "self", ".", "graph", ".", "edges", "(", "data", "=", "True", ")", "if", "data", "[", "'jumpkind'"...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated.get_topological_order
Get the topological order of a CFG Node. :param cfg_node: A CFGNode instance. :return: An integer representing its order, or None if the CFGNode does not exist in the graph.
angr/analyses/cfg/cfg_emulated.py
def get_topological_order(self, cfg_node): """ Get the topological order of a CFG Node. :param cfg_node: A CFGNode instance. :return: An integer representing its order, or None if the CFGNode does not exist in the graph. """ if not self._quasi_topological_order: ...
def get_topological_order(self, cfg_node): """ Get the topological order of a CFG Node. :param cfg_node: A CFGNode instance. :return: An integer representing its order, or None if the CFGNode does not exist in the graph. """ if not self._quasi_topological_order: ...
[ "Get", "the", "topological", "order", "of", "a", "CFG", "Node", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L598-L609
[ "def", "get_topological_order", "(", "self", ",", "cfg_node", ")", ":", "if", "not", "self", ".", "_quasi_topological_order", ":", "self", ".", "_quasi_topological_sort", "(", ")", "return", "self", ".", "_quasi_topological_order", ".", "get", "(", "cfg_node", "...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated.get_subgraph
Get a sub-graph out of a bunch of basic block addresses. :param CFGNode starting_node: The beginning of the subgraph :param iterable block_addresses: A collection of block addresses that should be included in the subgraph if there is a path between `starting_node...
angr/analyses/cfg/cfg_emulated.py
def get_subgraph(self, starting_node, block_addresses): """ Get a sub-graph out of a bunch of basic block addresses. :param CFGNode starting_node: The beginning of the subgraph :param iterable block_addresses: A collection of block addresses that should be included in the subgraph if ...
def get_subgraph(self, starting_node, block_addresses): """ Get a sub-graph out of a bunch of basic block addresses. :param CFGNode starting_node: The beginning of the subgraph :param iterable block_addresses: A collection of block addresses that should be included in the subgraph if ...
[ "Get", "a", "sub", "-", "graph", "out", "of", "a", "bunch", "of", "basic", "block", "addresses", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L611-L646
[ "def", "get_subgraph", "(", "self", ",", "starting_node", ",", "block_addresses", ")", ":", "graph", "=", "networkx", ".", "DiGraph", "(", ")", "if", "starting_node", "not", "in", "self", ".", "graph", ":", "raise", "AngrCFGError", "(", "'get_subgraph(): the s...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated.get_function_subgraph
Get a sub-graph of a certain function. :param start: The function start. Currently it should be an integer. :param max_call_depth: Call depth limit. None indicates no limit. :return: A CFG instance which is a sub-graph of self.graph
angr/analyses/cfg/cfg_emulated.py
def get_function_subgraph(self, start, max_call_depth=None): """ Get a sub-graph of a certain function. :param start: The function start. Currently it should be an integer. :param max_call_depth: Call depth limit. None indicates no limit. :return: A CFG instance which is a sub-g...
def get_function_subgraph(self, start, max_call_depth=None): """ Get a sub-graph of a certain function. :param start: The function start. Currently it should be an integer. :param max_call_depth: Call depth limit. None indicates no limit. :return: A CFG instance which is a sub-g...
[ "Get", "a", "sub", "-", "graph", "of", "a", "certain", "function", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L648-L702
[ "def", "get_function_subgraph", "(", "self", ",", "start", ",", "max_call_depth", "=", "None", ")", ":", "# FIXME: syscalls are not supported", "# FIXME: start should also take a CFGNode instance", "start_node", "=", "self", ".", "get_any_node", "(", "start", ")", "node_w...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated.deadends
Get all CFGNodes that has an out-degree of 0 :return: A list of CFGNode instances :rtype: list
angr/analyses/cfg/cfg_emulated.py
def deadends(self): """ Get all CFGNodes that has an out-degree of 0 :return: A list of CFGNode instances :rtype: list """ if self.graph is None: raise AngrCFGError('CFG hasn\'t been generated yet.') deadends = [i for i in self.graph if self.graph.o...
def deadends(self): """ Get all CFGNodes that has an out-degree of 0 :return: A list of CFGNode instances :rtype: list """ if self.graph is None: raise AngrCFGError('CFG hasn\'t been generated yet.') deadends = [i for i in self.graph if self.graph.o...
[ "Get", "all", "CFGNodes", "that", "has", "an", "out", "-", "degree", "of", "0" ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L756-L768
[ "def", "deadends", "(", "self", ")", ":", "if", "self", ".", "graph", "is", "None", ":", "raise", "AngrCFGError", "(", "'CFG hasn\\'t been generated yet.'", ")", "deadends", "=", "[", "i", "for", "i", "in", "self", ".", "graph", "if", "self", ".", "graph...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._sanitize_parameters
Perform a sanity check on parameters passed in to CFG.__init__(). An AngrCFGError is raised if any parameter fails the sanity check. :return: None
angr/analyses/cfg/cfg_emulated.py
def _sanitize_parameters(self): """ Perform a sanity check on parameters passed in to CFG.__init__(). An AngrCFGError is raised if any parameter fails the sanity check. :return: None """ # Check additional_edges if isinstance(self._additional_edges, (list, set, ...
def _sanitize_parameters(self): """ Perform a sanity check on parameters passed in to CFG.__init__(). An AngrCFGError is raised if any parameter fails the sanity check. :return: None """ # Check additional_edges if isinstance(self._additional_edges, (list, set, ...
[ "Perform", "a", "sanity", "check", "on", "parameters", "passed", "in", "to", "CFG", ".", "__init__", "()", ".", "An", "AngrCFGError", "is", "raised", "if", "any", "parameter", "fails", "the", "sanity", "check", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L776-L809
[ "def", "_sanitize_parameters", "(", "self", ")", ":", "# Check additional_edges", "if", "isinstance", "(", "self", ".", "_additional_edges", ",", "(", "list", ",", "set", ",", "tuple", ")", ")", ":", "new_dict", "=", "defaultdict", "(", "list", ")", "for", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._job_sorting_key
Get the sorting key of a CFGJob instance. :param CFGJob job: the CFGJob object. :return: An integer that determines the order of this job in the queue. :rtype: int
angr/analyses/cfg/cfg_emulated.py
def _job_sorting_key(self, job): """ Get the sorting key of a CFGJob instance. :param CFGJob job: the CFGJob object. :return: An integer that determines the order of this job in the queue. :rtype: int """ if self._base_graph is None: # we don't do so...
def _job_sorting_key(self, job): """ Get the sorting key of a CFGJob instance. :param CFGJob job: the CFGJob object. :return: An integer that determines the order of this job in the queue. :rtype: int """ if self._base_graph is None: # we don't do so...
[ "Get", "the", "sorting", "key", "of", "a", "CFGJob", "instance", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L853-L871
[ "def", "_job_sorting_key", "(", "self", ",", "job", ")", ":", "if", "self", ".", "_base_graph", "is", "None", ":", "# we don't do sorting if there is no base_graph", "return", "0", "MAX_JOBS", "=", "1000000", "if", "job", ".", "addr", "not", "in", "self", ".",...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._pre_analysis
Initialization work. Executed prior to the analysis. :return: None
angr/analyses/cfg/cfg_emulated.py
def _pre_analysis(self): """ Initialization work. Executed prior to the analysis. :return: None """ # Fill up self._starts for item in self._starts: callstack = None if isinstance(item, tuple): # (addr, jumpkind) i...
def _pre_analysis(self): """ Initialization work. Executed prior to the analysis. :return: None """ # Fill up self._starts for item in self._starts: callstack = None if isinstance(item, tuple): # (addr, jumpkind) i...
[ "Initialization", "work", ".", "Executed", "prior", "to", "the", "analysis", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L873-L904
[ "def", "_pre_analysis", "(", "self", ")", ":", "# Fill up self._starts", "for", "item", "in", "self", ".", "_starts", ":", "callstack", "=", "None", "if", "isinstance", "(", "item", ",", "tuple", ")", ":", "# (addr, jumpkind)", "ip", "=", "item", "[", "0",...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._job_queue_empty
A callback method called when the job queue is empty. :return: None
angr/analyses/cfg/cfg_emulated.py
def _job_queue_empty(self): """ A callback method called when the job queue is empty. :return: None """ self._iteratively_clean_pending_exits() while self._pending_jobs: # We don't have any exits remaining. Let's pop out a pending exit pending_j...
def _job_queue_empty(self): """ A callback method called when the job queue is empty. :return: None """ self._iteratively_clean_pending_exits() while self._pending_jobs: # We don't have any exits remaining. Let's pop out a pending exit pending_j...
[ "A", "callback", "method", "called", "when", "the", "job", "queue", "is", "empty", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L917-L934
[ "def", "_job_queue_empty", "(", "self", ")", ":", "self", ".", "_iteratively_clean_pending_exits", "(", ")", "while", "self", ".", "_pending_jobs", ":", "# We don't have any exits remaining. Let's pop out a pending exit", "pending_job", "=", "self", ".", "_get_one_pending_j...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._create_initial_state
Obtain a SimState object for a specific address Fastpath means the CFG generation will work in an IDA-like way, in which it will not try to execute every single statement in the emulator, but will just do the decoding job. This is much faster than the old way. :param int ip: The instruction po...
angr/analyses/cfg/cfg_emulated.py
def _create_initial_state(self, ip, jumpkind): """ Obtain a SimState object for a specific address Fastpath means the CFG generation will work in an IDA-like way, in which it will not try to execute every single statement in the emulator, but will just do the decoding job. This is much ...
def _create_initial_state(self, ip, jumpkind): """ Obtain a SimState object for a specific address Fastpath means the CFG generation will work in an IDA-like way, in which it will not try to execute every single statement in the emulator, but will just do the decoding job. This is much ...
[ "Obtain", "a", "SimState", "object", "for", "a", "specific", "address" ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L936-L973
[ "def", "_create_initial_state", "(", "self", ",", "ip", ",", "jumpkind", ")", ":", "jumpkind", "=", "\"Ijk_Boring\"", "if", "jumpkind", "is", "None", "else", "jumpkind", "if", "self", ".", "_initial_state", "is", "None", ":", "state", "=", "self", ".", "pr...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._get_one_pending_job
Retrieve a pending job. :return: A CFGJob instance or None
angr/analyses/cfg/cfg_emulated.py
def _get_one_pending_job(self): """ Retrieve a pending job. :return: A CFGJob instance or None """ pending_job_key, pending_job = self._pending_jobs.popitem() pending_job_state = pending_job.state pending_job_call_stack = pending_job.call_stack pending_j...
def _get_one_pending_job(self): """ Retrieve a pending job. :return: A CFGJob instance or None """ pending_job_key, pending_job = self._pending_jobs.popitem() pending_job_state = pending_job.state pending_job_call_stack = pending_job.call_stack pending_j...
[ "Retrieve", "a", "pending", "job", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L975-L1016
[ "def", "_get_one_pending_job", "(", "self", ")", ":", "pending_job_key", ",", "pending_job", "=", "self", ".", "_pending_jobs", ".", "popitem", "(", ")", "pending_job_state", "=", "pending_job", ".", "state", "pending_job_call_stack", "=", "pending_job", ".", "cal...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._process_hints
Process function hints in the binary. :return: None
angr/analyses/cfg/cfg_emulated.py
def _process_hints(self, analyzed_addrs): """ Process function hints in the binary. :return: None """ # Function hints! # Now let's see how many new functions we can get here... while self._pending_function_hints: f = self._pending_function_hints.pop...
def _process_hints(self, analyzed_addrs): """ Process function hints in the binary. :return: None """ # Function hints! # Now let's see how many new functions we can get here... while self._pending_function_hints: f = self._pending_function_hints.pop...
[ "Process", "function", "hints", "in", "the", "binary", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L1018-L1046
[ "def", "_process_hints", "(", "self", ",", "analyzed_addrs", ")", ":", "# Function hints!", "# Now let's see how many new functions we can get here...", "while", "self", ".", "_pending_function_hints", ":", "f", "=", "self", ".", "_pending_function_hints", ".", "pop", "("...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._post_analysis
Post-CFG-construction. :return: None
angr/analyses/cfg/cfg_emulated.py
def _post_analysis(self): """ Post-CFG-construction. :return: None """ self._make_completed_functions() new_changes = self._iteratively_analyze_function_features() functions_do_not_return = new_changes['functions_do_not_return'] self._update_function_cal...
def _post_analysis(self): """ Post-CFG-construction. :return: None """ self._make_completed_functions() new_changes = self._iteratively_analyze_function_features() functions_do_not_return = new_changes['functions_do_not_return'] self._update_function_cal...
[ "Post", "-", "CFG", "-", "construction", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L1048-L1068
[ "def", "_post_analysis", "(", "self", ")", ":", "self", ".", "_make_completed_functions", "(", ")", "new_changes", "=", "self", ".", "_iteratively_analyze_function_features", "(", ")", "functions_do_not_return", "=", "new_changes", "[", "'functions_do_not_return'", "]",...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._pre_job_handling
Before processing a CFGJob. Right now each block is traced at most once. If it is traced more than once, we will mark it as "should_skip" before tracing it. An AngrForwardAnalysisSkipJob exception is raised in order to skip analyzing the job. :param CFGJob job: The CFG job object. ...
angr/analyses/cfg/cfg_emulated.py
def _pre_job_handling(self, job): # pylint:disable=arguments-differ """ Before processing a CFGJob. Right now each block is traced at most once. If it is traced more than once, we will mark it as "should_skip" before tracing it. An AngrForwardAnalysisSkipJob exception is raised ...
def _pre_job_handling(self, job): # pylint:disable=arguments-differ """ Before processing a CFGJob. Right now each block is traced at most once. If it is traced more than once, we will mark it as "should_skip" before tracing it. An AngrForwardAnalysisSkipJob exception is raised ...
[ "Before", "processing", "a", "CFGJob", ".", "Right", "now", "each", "block", "is", "traced", "at", "most", "once", ".", "If", "it", "is", "traced", "more", "than", "once", "we", "will", "mark", "it", "as", "should_skip", "before", "tracing", "it", ".", ...
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L1072-L1248
[ "def", "_pre_job_handling", "(", "self", ",", "job", ")", ":", "# pylint:disable=arguments-differ", "# Extract initial info the CFGJob", "job", ".", "call_stack_suffix", "=", "job", ".", "get_call_stack_suffix", "(", ")", "job", ".", "current_function", "=", "self", "...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._get_successors
Get a collection of successors out of the current job. :param CFGJob job: The CFGJob instance. :return: A collection of successors. :rtype: list
angr/analyses/cfg/cfg_emulated.py
def _get_successors(self, job): """ Get a collection of successors out of the current job. :param CFGJob job: The CFGJob instance. :return: A collection of successors. :rtype: list """ addr = job.addr sim_successors = job.sim_succ...
def _get_successors(self, job): """ Get a collection of successors out of the current job. :param CFGJob job: The CFGJob instance. :return: A collection of successors. :rtype: list """ addr = job.addr sim_successors = job.sim_succ...
[ "Get", "a", "collection", "of", "successors", "out", "of", "the", "current", "job", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L1250-L1418
[ "def", "_get_successors", "(", "self", ",", "job", ")", ":", "addr", "=", "job", ".", "addr", "sim_successors", "=", "job", ".", "sim_successors", "cfg_node", "=", "job", ".", "cfg_node", "input_state", "=", "job", ".", "state", "func_addr", "=", "job", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._post_process_successors
Filter the list of successors :param SimState input_state: Input state. :param SimSuccessors sim_successors: The SimSuccessors instance. :param list successors: A list of successors generated after processing the current block. :return: ...
angr/analyses/cfg/cfg_emulated.py
def _post_process_successors(self, input_state, sim_successors, successors): """ Filter the list of successors :param SimState input_state: Input state. :param SimSuccessors sim_successors: The SimSuccessors instance. :param list successors: ...
def _post_process_successors(self, input_state, sim_successors, successors): """ Filter the list of successors :param SimState input_state: Input state. :param SimSuccessors sim_successors: The SimSuccessors instance. :param list successors: ...
[ "Filter", "the", "list", "of", "successors" ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L1441-L1477
[ "def", "_post_process_successors", "(", "self", ",", "input_state", ",", "sim_successors", ",", "successors", ")", ":", "if", "sim_successors", ".", "sort", "==", "'IRSB'", "and", "input_state", ".", "thumb", ":", "successors", "=", "self", ".", "_arm_thumb_filt...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._post_handle_job_debug
Post job handling: print debugging information regarding the current job. :param CFGJob job: The current CFGJob instance. :param list successors: All successors of the analysis job. :return: None
angr/analyses/cfg/cfg_emulated.py
def _post_handle_job_debug(self, job, successors): """ Post job handling: print debugging information regarding the current job. :param CFGJob job: The current CFGJob instance. :param list successors: All successors of the analysis job. :return: None """ si...
def _post_handle_job_debug(self, job, successors): """ Post job handling: print debugging information regarding the current job. :param CFGJob job: The current CFGJob instance. :param list successors: All successors of the analysis job. :return: None """ si...
[ "Post", "job", "handling", ":", "print", "debugging", "information", "regarding", "the", "current", "job", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L1479-L1520
[ "def", "_post_handle_job_debug", "(", "self", ",", "job", ",", "successors", ")", ":", "sim_successors", "=", "job", ".", "sim_successors", "call_stack_suffix", "=", "job", ".", "call_stack_suffix", "extra_info", "=", "job", ".", "extra_info", "successor_status", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._iteratively_clean_pending_exits
Iteratively update the completed functions set, analyze whether each function returns or not, and remove pending exits if the callee function does not return. We do this iteratively so that we come to a fixed point in the end. In most cases, the number of outer iteration equals to the maximum levels of ...
angr/analyses/cfg/cfg_emulated.py
def _iteratively_clean_pending_exits(self): """ Iteratively update the completed functions set, analyze whether each function returns or not, and remove pending exits if the callee function does not return. We do this iteratively so that we come to a fixed point in the end. In most cases...
def _iteratively_clean_pending_exits(self): """ Iteratively update the completed functions set, analyze whether each function returns or not, and remove pending exits if the callee function does not return. We do this iteratively so that we come to a fixed point in the end. In most cases...
[ "Iteratively", "update", "the", "completed", "functions", "set", "analyze", "whether", "each", "function", "returns", "or", "not", "and", "remove", "pending", "exits", "if", "the", "callee", "function", "does", "not", "return", ".", "We", "do", "this", "iterat...
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L1522-L1557
[ "def", "_iteratively_clean_pending_exits", "(", "self", ")", ":", "while", "True", ":", "# did we finish analyzing any function?", "# fill in self._completed_functions", "self", ".", "_make_completed_functions", "(", ")", "if", "self", ".", "_pending_jobs", ":", "# There ar...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._clean_pending_exits
Remove those pending exits if: a) they are the return exits of non-returning SimProcedures b) they are the return exits of non-returning syscalls c) they are the return exits of non-returning functions :return: True if any pending exits are removed, False otherwise :rtype: bool
angr/analyses/cfg/cfg_emulated.py
def _clean_pending_exits(self): """ Remove those pending exits if: a) they are the return exits of non-returning SimProcedures b) they are the return exits of non-returning syscalls c) they are the return exits of non-returning functions :return: True if any pending exit...
def _clean_pending_exits(self): """ Remove those pending exits if: a) they are the return exits of non-returning SimProcedures b) they are the return exits of non-returning syscalls c) they are the return exits of non-returning functions :return: True if any pending exit...
[ "Remove", "those", "pending", "exits", "if", ":", "a", ")", "they", "are", "the", "return", "exits", "of", "non", "-", "returning", "SimProcedures", "b", ")", "they", "are", "the", "return", "exits", "of", "non", "-", "returning", "syscalls", "c", ")", ...
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L1559-L1614
[ "def", "_clean_pending_exits", "(", "self", ")", ":", "pending_exits_to_remove", "=", "[", "]", "for", "block_id", ",", "pe", "in", "self", ".", "_pending_jobs", ".", "items", "(", ")", ":", "if", "pe", ".", "returning_source", "is", "None", ":", "# The or...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._handle_successor
Returns a new CFGJob instance for further analysis, or None if there is no immediate state to perform the analysis on. :param CFGJob job: The current job.
angr/analyses/cfg/cfg_emulated.py
def _handle_successor(self, job, successor, successors): """ Returns a new CFGJob instance for further analysis, or None if there is no immediate state to perform the analysis on. :param CFGJob job: The current job. """ state = successor all_successor_states = s...
def _handle_successor(self, job, successor, successors): """ Returns a new CFGJob instance for further analysis, or None if there is no immediate state to perform the analysis on. :param CFGJob job: The current job. """ state = successor all_successor_states = s...
[ "Returns", "a", "new", "CFGJob", "instance", "for", "further", "analysis", "or", "None", "if", "there", "is", "no", "immediate", "state", "to", "perform", "the", "analysis", "on", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L1635-L1821
[ "def", "_handle_successor", "(", "self", ",", "job", ",", "successor", ",", "successors", ")", ":", "state", "=", "successor", "all_successor_states", "=", "successors", "addr", "=", "job", ".", "addr", "# The PathWrapper instance to return", "pw", "=", "None", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._handle_job_without_successors
A block without successors should still be handled so it can be added to the function graph correctly. :param CFGJob job: The current job that do not have any successor. :param IRSB irsb: The related IRSB. :param insn_addrs: A list of instruction addresses of this IRSB. :return: Non...
angr/analyses/cfg/cfg_emulated.py
def _handle_job_without_successors(self, job, irsb, insn_addrs): """ A block without successors should still be handled so it can be added to the function graph correctly. :param CFGJob job: The current job that do not have any successor. :param IRSB irsb: The related IRSB. :...
def _handle_job_without_successors(self, job, irsb, insn_addrs): """ A block without successors should still be handled so it can be added to the function graph correctly. :param CFGJob job: The current job that do not have any successor. :param IRSB irsb: The related IRSB. :...
[ "A", "block", "without", "successors", "should", "still", "be", "handled", "so", "it", "can", "be", "added", "to", "the", "function", "graph", "correctly", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L1823-L1856
[ "def", "_handle_job_without_successors", "(", "self", ",", "job", ",", "irsb", ",", "insn_addrs", ")", ":", "# it's not an empty block", "# handle all conditional exits", "ins_addr", "=", "job", ".", "addr", "for", "stmt_idx", ",", "stmt", "in", "enumerate", "(", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._handle_actions
For a given state and current location of of execution, will update a function by adding the offets of appropriate actions to the stack variable or argument registers for the fnc. :param SimState state: upcoming state. :param SimSuccessors current_run: possible result states. :param kno...
angr/analyses/cfg/cfg_emulated.py
def _handle_actions(self, state, current_run, func, sp_addr, accessed_registers): """ For a given state and current location of of execution, will update a function by adding the offets of appropriate actions to the stack variable or argument registers for the fnc. :param SimState state...
def _handle_actions(self, state, current_run, func, sp_addr, accessed_registers): """ For a given state and current location of of execution, will update a function by adding the offets of appropriate actions to the stack variable or argument registers for the fnc. :param SimState state...
[ "For", "a", "given", "state", "and", "current", "location", "of", "of", "execution", "will", "update", "a", "function", "by", "adding", "the", "offets", "of", "appropriate", "actions", "to", "the", "stack", "variable", "or", "argument", "registers", "for", "...
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L1860-L1900
[ "def", "_handle_actions", "(", "self", ",", "state", ",", "current_run", ",", "func", ",", "sp_addr", ",", "accessed_registers", ")", ":", "se", "=", "state", ".", "solver", "if", "func", "is", "not", "None", "and", "sp_addr", "is", "not", "None", ":", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._update_function_transition_graph
Update transition graphs of functions in function manager based on information passed in. :param str jumpkind: Jumpkind. :param CFGNode src_node: Source CFGNode :param CFGNode dst_node: Destionation CFGNode :param int ret_addr: The theoretical return address for calls :return: N...
angr/analyses/cfg/cfg_emulated.py
def _update_function_transition_graph(self, src_node_key, dst_node_key, jumpkind='Ijk_Boring', ins_addr=None, stmt_idx=None, confirmed=None): """ Update transition graphs of functions in function manager based on information passed in. :param str jumpki...
def _update_function_transition_graph(self, src_node_key, dst_node_key, jumpkind='Ijk_Boring', ins_addr=None, stmt_idx=None, confirmed=None): """ Update transition graphs of functions in function manager based on information passed in. :param str jumpki...
[ "Update", "transition", "graphs", "of", "functions", "in", "function", "manager", "based", "on", "information", "passed", "in", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L1969-L2085
[ "def", "_update_function_transition_graph", "(", "self", ",", "src_node_key", ",", "dst_node_key", ",", "jumpkind", "=", "'Ijk_Boring'", ",", "ins_addr", "=", "None", ",", "stmt_idx", "=", "None", ",", "confirmed", "=", "None", ")", ":", "if", "dst_node_key", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._update_function_callsites
Update the callsites of functions (remove return targets) that are calling functions that are just deemed not returning. :param iterable func_addrs: A collection of functions for newly-recovered non-returning functions. :return: None
angr/analyses/cfg/cfg_emulated.py
def _update_function_callsites(self, noreturns): """ Update the callsites of functions (remove return targets) that are calling functions that are just deemed not returning. :param iterable func_addrs: A collection of functions for newly-recovered non-returning functions. :retur...
def _update_function_callsites(self, noreturns): """ Update the callsites of functions (remove return targets) that are calling functions that are just deemed not returning. :param iterable func_addrs: A collection of functions for newly-recovered non-returning functions. :retur...
[ "Update", "the", "callsites", "of", "functions", "(", "remove", "return", "targets", ")", "that", "are", "calling", "functions", "that", "are", "just", "deemed", "not", "returning", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L2087-L2107
[ "def", "_update_function_callsites", "(", "self", ",", "noreturns", ")", ":", "for", "callee_func", "in", "noreturns", ":", "# consult the callgraph to find callers of each function", "if", "callee_func", ".", "addr", "not", "in", "self", ".", "functions", ".", "callg...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._filter_insane_successors
Throw away all successors whose target doesn't make sense This method is called after we resolve an indirect jump using an unreliable method (like, not through one of the indirect jump resolvers, but through either pure concrete execution or backward slicing) to filter out the obviously incorre...
angr/analyses/cfg/cfg_emulated.py
def _filter_insane_successors(self, successors): """ Throw away all successors whose target doesn't make sense This method is called after we resolve an indirect jump using an unreliable method (like, not through one of the indirect jump resolvers, but through either pure concrete execu...
def _filter_insane_successors(self, successors): """ Throw away all successors whose target doesn't make sense This method is called after we resolve an indirect jump using an unreliable method (like, not through one of the indirect jump resolvers, but through either pure concrete execu...
[ "Throw", "away", "all", "successors", "whose", "target", "doesn", "t", "make", "sense" ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L2138-L2172
[ "def", "_filter_insane_successors", "(", "self", ",", "successors", ")", ":", "old_successors", "=", "successors", "[", ":", ":", "]", "successors", "=", "[", "]", "for", "i", ",", "suc", "in", "enumerate", "(", "old_successors", ")", ":", "if", "suc", "...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._remove_non_return_edges
Remove those return_from_call edges that actually do not return due to calling some not-returning functions. :return: None
angr/analyses/cfg/cfg_emulated.py
def _remove_non_return_edges(self): """ Remove those return_from_call edges that actually do not return due to calling some not-returning functions. :return: None """ for func in self.kb.functions.values(): graph = func.transition_graph all_return_...
def _remove_non_return_edges(self): """ Remove those return_from_call edges that actually do not return due to calling some not-returning functions. :return: None """ for func in self.kb.functions.values(): graph = func.transition_graph all_return_...
[ "Remove", "those", "return_from_call", "edges", "that", "actually", "do", "not", "return", "due", "to", "calling", "some", "not", "-", "returning", "functions", ".", ":", "return", ":", "None" ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L2174-L2203
[ "def", "_remove_non_return_edges", "(", "self", ")", ":", "for", "func", "in", "self", ".", "kb", ".", "functions", ".", "values", "(", ")", ":", "graph", "=", "func", ".", "transition_graph", "all_return_edges", "=", "[", "(", "u", ",", "v", ")", "for...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._convert_indirect_jump_targets_to_states
Convert each concrete indirect jump target into a SimState. :param job: The CFGJob instance. :param indirect_jump_targets: A collection of concrete jump targets resolved from a indirect jump. :return: A list of SimStates. :rtype: ...
angr/analyses/cfg/cfg_emulated.py
def _convert_indirect_jump_targets_to_states(job, indirect_jump_targets): """ Convert each concrete indirect jump target into a SimState. :param job: The CFGJob instance. :param indirect_jump_targets: A collection of concrete jump targets resolved from a indirect j...
def _convert_indirect_jump_targets_to_states(job, indirect_jump_targets): """ Convert each concrete indirect jump target into a SimState. :param job: The CFGJob instance. :param indirect_jump_targets: A collection of concrete jump targets resolved from a indirect j...
[ "Convert", "each", "concrete", "indirect", "jump", "target", "into", "a", "SimState", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L2214-L2230
[ "def", "_convert_indirect_jump_targets_to_states", "(", "job", ",", "indirect_jump_targets", ")", ":", "successors", "=", "[", "]", "for", "t", "in", "indirect_jump_targets", ":", "# Insert new successors", "a", "=", "job", ".", "sim_successors", ".", "all_successors"...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._try_resolving_indirect_jumps
Resolve indirect jumps specified by sim_successors.addr. :param SimSuccessors sim_successors: The SimSuccessors instance. :param CFGNode cfg_node: The CFGNode instance. :param int func_addr: Current function address. :param list successors: ...
angr/analyses/cfg/cfg_emulated.py
def _try_resolving_indirect_jumps(self, sim_successors, cfg_node, func_addr, successors, exception_info, artifacts): """ Resolve indirect jumps specified by sim_successors.addr. :param SimSuccessors sim_successors: The SimSuccessors instance. :param CFGNode cfg_node: ...
def _try_resolving_indirect_jumps(self, sim_successors, cfg_node, func_addr, successors, exception_info, artifacts): """ Resolve indirect jumps specified by sim_successors.addr. :param SimSuccessors sim_successors: The SimSuccessors instance. :param CFGNode cfg_node: ...
[ "Resolve", "indirect", "jumps", "specified", "by", "sim_successors", ".", "addr", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L2232-L2391
[ "def", "_try_resolving_indirect_jumps", "(", "self", ",", "sim_successors", ",", "cfg_node", ",", "func_addr", ",", "successors", ",", "exception_info", ",", "artifacts", ")", ":", "# Try to resolve indirect jumps with advanced backward slicing (if enabled)", "if", "sim_succe...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._backward_slice_indirect
Try to resolve an indirect jump by slicing backwards
angr/analyses/cfg/cfg_emulated.py
def _backward_slice_indirect(self, cfgnode, sim_successors, current_function_addr): """ Try to resolve an indirect jump by slicing backwards """ # TODO: make this a real indirect jump resolver under the new paradigm irsb = sim_successors.artifacts['irsb'] # shorthand l...
def _backward_slice_indirect(self, cfgnode, sim_successors, current_function_addr): """ Try to resolve an indirect jump by slicing backwards """ # TODO: make this a real indirect jump resolver under the new paradigm irsb = sim_successors.artifacts['irsb'] # shorthand l...
[ "Try", "to", "resolve", "an", "indirect", "jump", "by", "slicing", "backwards" ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L2393-L2508
[ "def", "_backward_slice_indirect", "(", "self", ",", "cfgnode", ",", "sim_successors", ",", "current_function_addr", ")", ":", "# TODO: make this a real indirect jump resolver under the new paradigm", "irsb", "=", "sim_successors", ".", "artifacts", "[", "'irsb'", "]", "# s...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._symbolically_back_traverse
Symbolically executes from ancestor nodes (2-5 times removed) finding paths of execution through the given CFGNode. :param SimSuccessors current_block: SimSuccessor with address to attempt to navigate to. :param dict block_artifacts: Container of IRSB data - specifically used for known persist...
angr/analyses/cfg/cfg_emulated.py
def _symbolically_back_traverse(self, current_block, block_artifacts, cfg_node): """ Symbolically executes from ancestor nodes (2-5 times removed) finding paths of execution through the given CFGNode. :param SimSuccessors current_block: SimSuccessor with address to attempt to navigate t...
def _symbolically_back_traverse(self, current_block, block_artifacts, cfg_node): """ Symbolically executes from ancestor nodes (2-5 times removed) finding paths of execution through the given CFGNode. :param SimSuccessors current_block: SimSuccessor with address to attempt to navigate t...
[ "Symbolically", "executes", "from", "ancestor", "nodes", "(", "2", "-", "5", "times", "removed", ")", "finding", "paths", "of", "execution", "through", "the", "given", "CFGNode", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L2510-L2639
[ "def", "_symbolically_back_traverse", "(", "self", ",", "current_block", ",", "block_artifacts", ",", "cfg_node", ")", ":", "class", "register_protector", ":", "def", "__init__", "(", "self", ",", "reg_offset", ",", "info_collection", ")", ":", "\"\"\"\n ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._get_symbolic_function_initial_state
Symbolically execute the first basic block of the specified function, then returns it. We prepares the state using the already existing state in fastpath mode (if avaiable). :param function_addr: The function address :return: A symbolic state if succeeded, None otherwise
angr/analyses/cfg/cfg_emulated.py
def _get_symbolic_function_initial_state(self, function_addr, fastpath_mode_state=None): """ Symbolically execute the first basic block of the specified function, then returns it. We prepares the state using the already existing state in fastpath mode (if avaiable). :param functi...
def _get_symbolic_function_initial_state(self, function_addr, fastpath_mode_state=None): """ Symbolically execute the first basic block of the specified function, then returns it. We prepares the state using the already existing state in fastpath mode (if avaiable). :param functi...
[ "Symbolically", "execute", "the", "first", "basic", "block", "of", "the", "specified", "function", "then", "returns", "it", ".", "We", "prepares", "the", "state", "using", "the", "already", "existing", "state", "in", "fastpath", "mode", "(", "if", "avaiable", ...
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L2641-L2696
[ "def", "_get_symbolic_function_initial_state", "(", "self", ",", "function_addr", ",", "fastpath_mode_state", "=", "None", ")", ":", "if", "function_addr", "is", "None", ":", "return", "None", "if", "function_addr", "in", "self", ".", "_symbolic_function_initial_state...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._search_for_function_hints
Scan for constants that might be used as exit targets later, and add them into pending_exits. :param SimState successor_state: A successing state. :return: A list of discovered code addresses. :rtype: list
angr/analyses/cfg/cfg_emulated.py
def _search_for_function_hints(self, successor_state): """ Scan for constants that might be used as exit targets later, and add them into pending_exits. :param SimState successor_state: A successing state. :return: A list of discovered code addresses. ...
def _search_for_function_hints(self, successor_state): """ Scan for constants that might be used as exit targets later, and add them into pending_exits. :param SimState successor_state: A successing state. :return: A list of discovered code addresses. ...
[ "Scan", "for", "constants", "that", "might", "be", "used", "as", "exit", "targets", "later", "and", "add", "them", "into", "pending_exits", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L2700-L2748
[ "def", "_search_for_function_hints", "(", "self", ",", "successor_state", ")", ":", "function_hints", "=", "[", "]", "for", "action", "in", "successor_state", ".", "history", ".", "recent_actions", ":", "if", "action", ".", "type", "==", "'reg'", "and", "actio...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._get_simsuccessors
Create the SimSuccessors instance for a block. :param int addr: Address of the block. :param CFGJob job: The CFG job instance with an input state inside. :param int current_function_addr: Address of the current function. :return: ...
angr/analyses/cfg/cfg_emulated.py
def _get_simsuccessors(self, addr, job, current_function_addr=None): """ Create the SimSuccessors instance for a block. :param int addr: Address of the block. :param CFGJob job: The CFG job instance with an input state inside. :param int current_f...
def _get_simsuccessors(self, addr, job, current_function_addr=None): """ Create the SimSuccessors instance for a block. :param int addr: Address of the block. :param CFGJob job: The CFG job instance with an input state inside. :param int current_f...
[ "Create", "the", "SimSuccessors", "instance", "for", "a", "block", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L2752-L2915
[ "def", "_get_simsuccessors", "(", "self", ",", "addr", ",", "job", ",", "current_function_addr", "=", "None", ")", ":", "exception_info", "=", "None", "state", "=", "job", ".", "state", "saved_state", "=", "job", ".", "state", "# We don't have to make a copy her...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._create_new_call_stack
Creates a new call stack, and according to the jumpkind performs appropriate actions. :param int addr: Address to create at. :param Simsuccessors all_jobs: Jobs to get stack pointer from or return address. :param CFGJob job: CFGJob to c...
angr/analyses/cfg/cfg_emulated.py
def _create_new_call_stack(self, addr, all_jobs, job, exit_target, jumpkind): """ Creates a new call stack, and according to the jumpkind performs appropriate actions. :param int addr: Address to create at. :param Simsuccessors all_jobs: Jobs to get s...
def _create_new_call_stack(self, addr, all_jobs, job, exit_target, jumpkind): """ Creates a new call stack, and according to the jumpkind performs appropriate actions. :param int addr: Address to create at. :param Simsuccessors all_jobs: Jobs to get s...
[ "Creates", "a", "new", "call", "stack", "and", "according", "to", "the", "jumpkind", "performs", "appropriate", "actions", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L2917-L3017
[ "def", "_create_new_call_stack", "(", "self", ",", "addr", ",", "all_jobs", ",", "job", ",", "exit_target", ",", "jumpkind", ")", ":", "if", "self", ".", "_is_call_jumpkind", "(", "jumpkind", ")", ":", "new_call_stack", "=", "job", ".", "call_stack_copy", "(...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._create_cfgnode
Create a context-sensitive CFGNode instance for a specific block. :param SimSuccessors sim_successors: The SimSuccessors object. :param CallStack call_stack_suffix: The call stack. :param int func_addr: Address of the current function. :param Bloc...
angr/analyses/cfg/cfg_emulated.py
def _create_cfgnode(self, sim_successors, call_stack, func_addr, block_id=None, depth=None, exception_info=None): """ Create a context-sensitive CFGNode instance for a specific block. :param SimSuccessors sim_successors: The SimSuccessors object. :param CallStack call_stack_suff...
def _create_cfgnode(self, sim_successors, call_stack, func_addr, block_id=None, depth=None, exception_info=None): """ Create a context-sensitive CFGNode instance for a specific block. :param SimSuccessors sim_successors: The SimSuccessors object. :param CallStack call_stack_suff...
[ "Create", "a", "context", "-", "sensitive", "CFGNode", "instance", "for", "a", "specific", "block", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L3019-L3085
[ "def", "_create_cfgnode", "(", "self", ",", "sim_successors", ",", "call_stack", ",", "func_addr", ",", "block_id", "=", "None", ",", "depth", "=", "None", ",", "exception_info", "=", "None", ")", ":", "sa", "=", "sim_successors", ".", "artifacts", "# shorth...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._detect_loops
Loop detection. :param func loop_callback: A callback function for each detected loop backedge. :return: None
angr/analyses/cfg/cfg_emulated.py
def _detect_loops(self, loop_callback=None): """ Loop detection. :param func loop_callback: A callback function for each detected loop backedge. :return: None """ loop_finder = self.project.analyses.LoopFinder(kb=self.kb, normalize=False, fail_fast=self._fail_fast) ...
def _detect_loops(self, loop_callback=None): """ Loop detection. :param func loop_callback: A callback function for each detected loop backedge. :return: None """ loop_finder = self.project.analyses.LoopFinder(kb=self.kb, normalize=False, fail_fast=self._fail_fast) ...
[ "Loop", "detection", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L3089-L3108
[ "def", "_detect_loops", "(", "self", ",", "loop_callback", "=", "None", ")", ":", "loop_finder", "=", "self", ".", "project", ".", "analyses", ".", "LoopFinder", "(", "kb", "=", "self", ".", "kb", ",", "normalize", "=", "False", ",", "fail_fast", "=", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._immediate_dominators
Get all immediate dominators of sub graph from given node upwards. :param str node: id of the node to navigate forwards from. :param networkx.classes.digraph.DiGraph target_graph: graph to analyse, default is self.graph. :param bool reverse_graph: Whether the target graph should be reversed bef...
angr/analyses/cfg/cfg_emulated.py
def _immediate_dominators(self, node, target_graph=None, reverse_graph=False): """ Get all immediate dominators of sub graph from given node upwards. :param str node: id of the node to navigate forwards from. :param networkx.classes.digraph.DiGraph target_graph: graph to analyse, defaul...
def _immediate_dominators(self, node, target_graph=None, reverse_graph=False): """ Get all immediate dominators of sub graph from given node upwards. :param str node: id of the node to navigate forwards from. :param networkx.classes.digraph.DiGraph target_graph: graph to analyse, defaul...
[ "Get", "all", "immediate", "dominators", "of", "sub", "graph", "from", "given", "node", "upwards", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L3212-L3269
[ "def", "_immediate_dominators", "(", "self", ",", "node", ",", "target_graph", "=", "None", ",", "reverse_graph", "=", "False", ")", ":", "if", "target_graph", "is", "None", ":", "target_graph", "=", "self", ".", "graph", "if", "node", "not", "in", "target...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._is_indirect_jump
Determine if this SimIRSB has an indirect jump as its exit
angr/analyses/cfg/cfg_emulated.py
def _is_indirect_jump(_, sim_successors): """ Determine if this SimIRSB has an indirect jump as its exit """ if sim_successors.artifacts['irsb_direct_next']: # It's a direct jump return False default_jumpkind = sim_successors.artifacts['irsb_default_jump...
def _is_indirect_jump(_, sim_successors): """ Determine if this SimIRSB has an indirect jump as its exit """ if sim_successors.artifacts['irsb_direct_next']: # It's a direct jump return False default_jumpkind = sim_successors.artifacts['irsb_default_jump...
[ "Determine", "if", "this", "SimIRSB", "has", "an", "indirect", "jump", "as", "its", "exit" ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L3276-L3290
[ "def", "_is_indirect_jump", "(", "_", ",", "sim_successors", ")", ":", "if", "sim_successors", ".", "artifacts", "[", "'irsb_direct_next'", "]", ":", "# It's a direct jump", "return", "False", "default_jumpkind", "=", "sim_successors", ".", "artifacts", "[", "'irsb_...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._is_address_executable
Check if the specific address is in one of the executable ranges. :param int address: The address :return: True if it's in an executable range, False otherwise
angr/analyses/cfg/cfg_emulated.py
def _is_address_executable(self, address): """ Check if the specific address is in one of the executable ranges. :param int address: The address :return: True if it's in an executable range, False otherwise """ for r in self._executable_address_ranges: if r[...
def _is_address_executable(self, address): """ Check if the specific address is in one of the executable ranges. :param int address: The address :return: True if it's in an executable range, False otherwise """ for r in self._executable_address_ranges: if r[...
[ "Check", "if", "the", "specific", "address", "is", "in", "one", "of", "the", "executable", "ranges", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L3342-L3353
[ "def", "_is_address_executable", "(", "self", ",", "address", ")", ":", "for", "r", "in", "self", ".", "_executable_address_ranges", ":", "if", "r", "[", "0", "]", "<=", "address", "<", "r", "[", "1", "]", ":", "return", "True", "return", "False" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._get_callsites
Get where a specific function is called. :param function_address: Address of the target function :return: A list of CFGNodes whose exits include a call/jump to the given function
angr/analyses/cfg/cfg_emulated.py
def _get_callsites(self, function_address): """ Get where a specific function is called. :param function_address: Address of the target function :return: A list of CFGNodes whose exits include a call/jump to the given function """ all_predecessors =...
def _get_callsites(self, function_address): """ Get where a specific function is called. :param function_address: Address of the target function :return: A list of CFGNodes whose exits include a call/jump to the given function """ all_predecessors =...
[ "Get", "where", "a", "specific", "function", "is", "called", ".", ":", "param", "function_address", ":", "Address", "of", "the", "target", "function", ":", "return", ":", "A", "list", "of", "CFGNodes", "whose", "exits", "include", "a", "call", "/", "jump",...
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L3367-L3381
[ "def", "_get_callsites", "(", "self", ",", "function_address", ")", ":", "all_predecessors", "=", "[", "]", "nodes", "=", "self", ".", "get_all_nodes", "(", "function_address", ")", "for", "n", "in", "nodes", ":", "predecessors", "=", "list", "(", "self", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._get_nx_paths
Get the possible (networkx) simple paths between two nodes or addresses corresponding to nodes. Input: addresses or node instances Return: a list of lists of nodes representing paths.
angr/analyses/cfg/cfg_emulated.py
def _get_nx_paths(self, begin, end): """ Get the possible (networkx) simple paths between two nodes or addresses corresponding to nodes. Input: addresses or node instances Return: a list of lists of nodes representing paths. """ if isinstance(begin, int) and isins...
def _get_nx_paths(self, begin, end): """ Get the possible (networkx) simple paths between two nodes or addresses corresponding to nodes. Input: addresses or node instances Return: a list of lists of nodes representing paths. """ if isinstance(begin, int) and isins...
[ "Get", "the", "possible", "(", "networkx", ")", "simple", "paths", "between", "two", "nodes", "or", "addresses", "corresponding", "to", "nodes", ".", "Input", ":", "addresses", "or", "node", "instances", "Return", ":", "a", "list", "of", "lists", "of", "no...
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L3383-L3401
[ "def", "_get_nx_paths", "(", "self", ",", "begin", ",", "end", ")", ":", "if", "isinstance", "(", "begin", ",", "int", ")", "and", "isinstance", "(", "end", ",", "int", ")", ":", "n_begin", "=", "self", ".", "get_any_node", "(", "begin", ")", "n_end"...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._quasi_topological_sort
Perform a quasi-topological sort on an already constructed CFG graph (a networkx DiGraph) :return: None
angr/analyses/cfg/cfg_emulated.py
def _quasi_topological_sort(self): """ Perform a quasi-topological sort on an already constructed CFG graph (a networkx DiGraph) :return: None """ # Clear the existing sorting result self._quasi_topological_order = {} ctr = self._graph.number_of_nodes() ...
def _quasi_topological_sort(self): """ Perform a quasi-topological sort on an already constructed CFG graph (a networkx DiGraph) :return: None """ # Clear the existing sorting result self._quasi_topological_order = {} ctr = self._graph.number_of_nodes() ...
[ "Perform", "a", "quasi", "-", "topological", "sort", "on", "an", "already", "constructed", "CFG", "graph", "(", "a", "networkx", "DiGraph", ")" ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L3403-L3425
[ "def", "_quasi_topological_sort", "(", "self", ")", ":", "# Clear the existing sorting result", "self", ".", "_quasi_topological_order", "=", "{", "}", "ctr", "=", "self", ".", "_graph", ".", "number_of_nodes", "(", ")", "for", "ep", "in", "self", ".", "_entry_p...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
CFGEmulated._reset_state_mode
Reset the state mode to the given mode, and apply the custom state options specified with this analysis. :param state: The state to work with. :param str mode: The state mode. :return: None
angr/analyses/cfg/cfg_emulated.py
def _reset_state_mode(self, state, mode): """ Reset the state mode to the given mode, and apply the custom state options specified with this analysis. :param state: The state to work with. :param str mode: The state mode. :return: None """ state.set_m...
def _reset_state_mode(self, state, mode): """ Reset the state mode to the given mode, and apply the custom state options specified with this analysis. :param state: The state to work with. :param str mode: The state mode. :return: None """ state.set_m...
[ "Reset", "the", "state", "mode", "to", "the", "given", "mode", "and", "apply", "the", "custom", "state", "options", "specified", "with", "this", "analysis", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cfg/cfg_emulated.py#L3427-L3438
[ "def", "_reset_state_mode", "(", "self", ",", "state", ",", "mode", ")", ":", "state", ".", "set_mode", "(", "mode", ")", "state", ".", "options", "|=", "self", ".", "_state_add_options", "state", ".", "options", "=", "state", ".", "options", ".", "diffe...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
SymbolManager.label_got
Mark a certain label as assigned (to an instruction or a block of data). :param int addr: The address of the label. :param angr.analyses.reassembler.Label label: The label that is just assigned. :return: None
angr/analyses/reassembler.py
def label_got(self, addr, label): """ Mark a certain label as assigned (to an instruction or a block of data). :param int addr: The address of the label. :param angr.analyses.reassembler.Label label: The label that is just assigned. :return: None ...
def label_got(self, addr, label): """ Mark a certain label as assigned (to an instruction or a block of data). :param int addr: The address of the label. :param angr.analyses.reassembler.Label label: The label that is just assigned. :return: None ...
[ "Mark", "a", "certain", "label", "as", "assigned", "(", "to", "an", "instruction", "or", "a", "block", "of", "data", ")", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/reassembler.py#L398-L409
[ "def", "label_got", "(", "self", ",", "addr", ",", "label", ")", ":", "if", "label", "in", "self", ".", "addr_to_label", "[", "addr", "]", ":", "label", ".", "assigned", "=", "True" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Operand._imm_to_ptr
Try to classify an immediate as a pointer. :param int imm: The immediate to test. :param int operand_type: Operand type of this operand, can either be IMM or MEM. :param str mnemonic: Mnemonic of the instruction that this operand belongs to. :return: A tuple of (is code reference, is da...
angr/analyses/reassembler.py
def _imm_to_ptr(self, imm, operand_type, mnemonic): # pylint:disable=no-self-use,unused-argument """ Try to classify an immediate as a pointer. :param int imm: The immediate to test. :param int operand_type: Operand type of this operand, can either be IMM or MEM. :param str mne...
def _imm_to_ptr(self, imm, operand_type, mnemonic): # pylint:disable=no-self-use,unused-argument """ Try to classify an immediate as a pointer. :param int imm: The immediate to test. :param int operand_type: Operand type of this operand, can either be IMM or MEM. :param str mne...
[ "Try", "to", "classify", "an", "immediate", "as", "a", "pointer", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/reassembler.py#L625-L667
[ "def", "_imm_to_ptr", "(", "self", ",", "imm", ",", "operand_type", ",", "mnemonic", ")", ":", "# pylint:disable=no-self-use,unused-argument", "is_coderef", ",", "is_dataref", "=", "False", ",", "False", "baseaddr", "=", "None", "if", "not", "is_coderef", "and", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Procedure.name
Get function name from the labels of the very first block. :return: Function name if there is any, None otherwise :rtype: string
angr/analyses/reassembler.py
def name(self): """ Get function name from the labels of the very first block. :return: Function name if there is any, None otherwise :rtype: string """ if self._name is not None: return self._name if not self.blocks: return None ...
def name(self): """ Get function name from the labels of the very first block. :return: Function name if there is any, None otherwise :rtype: string """ if self._name is not None: return self._name if not self.blocks: return None ...
[ "Get", "function", "name", "from", "the", "labels", "of", "the", "very", "first", "block", ".", ":", "return", ":", "Function", "name", "if", "there", "is", "any", "None", "otherwise", ":", "rtype", ":", "string" ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/reassembler.py#L967-L991
[ "def", "name", "(", "self", ")", ":", "if", "self", ".", "_name", "is", "not", "None", ":", "return", "self", ".", "_name", "if", "not", "self", ".", "blocks", ":", "return", "None", "if", "not", "self", ".", "blocks", "[", "0", "]", ".", "instru...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Procedure.is_plt
If this function is a PLT entry or not. :return: True if this function is a PLT entry, False otherwise :rtype: bool
angr/analyses/reassembler.py
def is_plt(self): """ If this function is a PLT entry or not. :return: True if this function is a PLT entry, False otherwise :rtype: bool """ if self.section == ".plt": return True if not self.blocks: return False initial_block =...
def is_plt(self): """ If this function is a PLT entry or not. :return: True if this function is a PLT entry, False otherwise :rtype: bool """ if self.section == ".plt": return True if not self.blocks: return False initial_block =...
[ "If", "this", "function", "is", "a", "PLT", "entry", "or", "not", ".", ":", "return", ":", "True", "if", "this", "function", "is", "a", "PLT", "entry", "False", "otherwise", ":", "rtype", ":", "bool" ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/reassembler.py#L994-L1022
[ "def", "is_plt", "(", "self", ")", ":", "if", "self", ".", "section", "==", "\".plt\"", ":", "return", "True", "if", "not", "self", ".", "blocks", ":", "return", "False", "initial_block", "=", "next", "(", "(", "b", "for", "b", "in", "self", ".", "...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Procedure.assembly
Get the assembly manifest of the procedure. :param comments: :param symbolized: :return: A list of tuples (address, basic block assembly), ordered by basic block addresses :rtype: list
angr/analyses/reassembler.py
def assembly(self, comments=False, symbolized=True): """ Get the assembly manifest of the procedure. :param comments: :param symbolized: :return: A list of tuples (address, basic block assembly), ordered by basic block addresses :rtype: list """ assembly...
def assembly(self, comments=False, symbolized=True): """ Get the assembly manifest of the procedure. :param comments: :param symbolized: :return: A list of tuples (address, basic block assembly), ordered by basic block addresses :rtype: list """ assembly...
[ "Get", "the", "assembly", "manifest", "of", "the", "procedure", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/reassembler.py#L1043-L1081
[ "def", "assembly", "(", "self", ",", "comments", "=", "False", ",", "symbolized", "=", "True", ")", ":", "assembly", "=", "[", "]", "header", "=", "\"\\t.section\\t{section}\\n\\t.align\\t{alignment}\\n\"", ".", "format", "(", "section", "=", "self", ".", "sec...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Procedure.instruction_addresses
Get all instruction addresses in the binary. :return: A list of sorted instruction addresses. :rtype: list
angr/analyses/reassembler.py
def instruction_addresses(self): """ Get all instruction addresses in the binary. :return: A list of sorted instruction addresses. :rtype: list """ addrs = [ ] for b in sorted(self.blocks, key=lambda x: x.addr): # type: BasicBlock addrs.extend(b.ins...
def instruction_addresses(self): """ Get all instruction addresses in the binary. :return: A list of sorted instruction addresses. :rtype: list """ addrs = [ ] for b in sorted(self.blocks, key=lambda x: x.addr): # type: BasicBlock addrs.extend(b.ins...
[ "Get", "all", "instruction", "addresses", "in", "the", "binary", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/reassembler.py#L1083-L1095
[ "def", "instruction_addresses", "(", "self", ")", ":", "addrs", "=", "[", "]", "for", "b", "in", "sorted", "(", "self", ".", "blocks", ",", "key", "=", "lambda", "x", ":", "x", ".", "addr", ")", ":", "# type: BasicBlock", "addrs", ".", "extend", "(",...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Procedure._output_function_label
Determines if we want to output the function label in assembly. We output the function label only when the original instruction does not output the function label. :return: True if we should output the function label, False otherwise. :rtype: bool
angr/analyses/reassembler.py
def _output_function_label(self): """ Determines if we want to output the function label in assembly. We output the function label only when the original instruction does not output the function label. :return: True if we should output the function label, False otherwise. :rtype...
def _output_function_label(self): """ Determines if we want to output the function label in assembly. We output the function label only when the original instruction does not output the function label. :return: True if we should output the function label, False otherwise. :rtype...
[ "Determines", "if", "we", "want", "to", "output", "the", "function", "label", "in", "assembly", ".", "We", "output", "the", "function", "label", "only", "when", "the", "original", "instruction", "does", "not", "output", "the", "function", "label", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/reassembler.py#L1117-L1138
[ "def", "_output_function_label", "(", "self", ")", ":", "if", "self", ".", "asm_code", ":", "return", "True", "if", "not", "self", ".", "blocks", ":", "return", "True", "the_block", "=", "next", "(", "(", "b", "for", "b", "in", "self", ".", "blocks", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Data.shrink
Reduce the size of this block :param int new_size: The new size :return: None
angr/analyses/reassembler.py
def shrink(self, new_size): """ Reduce the size of this block :param int new_size: The new size :return: None """ self.size = new_size if self.sort == 'string': self.null_terminated = False # string without the null byte terminator self._...
def shrink(self, new_size): """ Reduce the size of this block :param int new_size: The new size :return: None """ self.size = new_size if self.sort == 'string': self.null_terminated = False # string without the null byte terminator self._...
[ "Reduce", "the", "size", "of", "this", "block" ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/reassembler.py#L1196-L1221
[ "def", "shrink", "(", "self", ",", "new_size", ")", ":", "self", ".", "size", "=", "new_size", "if", "self", ".", "sort", "==", "'string'", ":", "self", ".", "null_terminated", "=", "False", "# string without the null byte terminator", "self", ".", "_content",...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Data.desymbolize
We believe this was a pointer and symbolized it before. Now we want to desymbolize it. The following actions are performed: - Reload content from memory - Mark the sort as 'unknown' :return: None
angr/analyses/reassembler.py
def desymbolize(self): """ We believe this was a pointer and symbolized it before. Now we want to desymbolize it. The following actions are performed: - Reload content from memory - Mark the sort as 'unknown' :return: None """ self.sort = 'unknown' ...
def desymbolize(self): """ We believe this was a pointer and symbolized it before. Now we want to desymbolize it. The following actions are performed: - Reload content from memory - Mark the sort as 'unknown' :return: None """ self.sort = 'unknown' ...
[ "We", "believe", "this", "was", "a", "pointer", "and", "symbolized", "it", "before", ".", "Now", "we", "want", "to", "desymbolize", "it", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/reassembler.py#L1223-L1236
[ "def", "desymbolize", "(", "self", ")", ":", "self", ".", "sort", "=", "'unknown'", "content", "=", "self", ".", "binary", ".", "fast_memory_load", "(", "self", ".", "addr", ",", "self", ".", "size", ",", "bytes", ")", "self", ".", "content", "=", "[...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Reassembler.main_executable_region_limbos_contain
Sometimes there exists a pointer that points to a few bytes before the beginning of a section, or a few bytes after the beginning of the section. We take care of that here. :param int addr: The address to check. :return: A 2-tuple of (bool, the closest base address) :rtype: tuple
angr/analyses/reassembler.py
def main_executable_region_limbos_contain(self, addr): """ Sometimes there exists a pointer that points to a few bytes before the beginning of a section, or a few bytes after the beginning of the section. We take care of that here. :param int addr: The address to check. :return:...
def main_executable_region_limbos_contain(self, addr): """ Sometimes there exists a pointer that points to a few bytes before the beginning of a section, or a few bytes after the beginning of the section. We take care of that here. :param int addr: The address to check. :return:...
[ "Sometimes", "there", "exists", "a", "pointer", "that", "points", "to", "a", "few", "bytes", "before", "the", "beginning", "of", "a", "section", "or", "a", "few", "bytes", "after", "the", "beginning", "of", "the", "section", ".", "We", "take", "care", "o...
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/reassembler.py#L1821-L1848
[ "def", "main_executable_region_limbos_contain", "(", "self", ",", "addr", ")", ":", "TOLERANCE", "=", "64", "closest_region", "=", "None", "least_limbo", "=", "None", "for", "start", ",", "end", "in", "self", ".", "main_executable_regions", ":", "if", "start", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Reassembler.main_nonexecutable_region_limbos_contain
Sometimes there exists a pointer that points to a few bytes before the beginning of a section, or a few bytes after the beginning of the section. We take care of that here. :param int addr: The address to check. :return: A 2-tuple of (bool, the closest base address) :rtype: tuple
angr/analyses/reassembler.py
def main_nonexecutable_region_limbos_contain(self, addr, tolerance_before=64, tolerance_after=64): """ Sometimes there exists a pointer that points to a few bytes before the beginning of a section, or a few bytes after the beginning of the section. We take care of that here. :param int ...
def main_nonexecutable_region_limbos_contain(self, addr, tolerance_before=64, tolerance_after=64): """ Sometimes there exists a pointer that points to a few bytes before the beginning of a section, or a few bytes after the beginning of the section. We take care of that here. :param int ...
[ "Sometimes", "there", "exists", "a", "pointer", "that", "points", "to", "a", "few", "bytes", "before", "the", "beginning", "of", "a", "section", "or", "a", "few", "bytes", "after", "the", "beginning", "of", "the", "section", ".", "We", "take", "care", "o...
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/reassembler.py#L1862-L1887
[ "def", "main_nonexecutable_region_limbos_contain", "(", "self", ",", "addr", ",", "tolerance_before", "=", "64", ",", "tolerance_after", "=", "64", ")", ":", "closest_region", "=", "None", "least_limbo", "=", "None", "for", "start", ",", "end", "in", "self", "...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Reassembler.add_label
Add a new label to the symbol manager. :param str name: Name of the label. :param int addr: Address of the label. :return: None
angr/analyses/reassembler.py
def add_label(self, name, addr): """ Add a new label to the symbol manager. :param str name: Name of the label. :param int addr: Address of the label. :return: None """ # set the label self._symbolization_needed = True self.symbol_manager.new_la...
def add_label(self, name, addr): """ Add a new label to the symbol manager. :param str name: Name of the label. :param int addr: Address of the label. :return: None """ # set the label self._symbolization_needed = True self.symbol_manager.new_la...
[ "Add", "a", "new", "label", "to", "the", "symbol", "manager", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/reassembler.py#L1950-L1962
[ "def", "add_label", "(", "self", ",", "name", ",", "addr", ")", ":", "# set the label", "self", ".", "_symbolization_needed", "=", "True", "self", ".", "symbol_manager", ".", "new_label", "(", "addr", ",", "name", "=", "name", ",", "force", "=", "True", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Reassembler.insert_asm
Insert some assembly code at the specific address. There must be an instruction starting at that address. :param int addr: Address of insertion :param str asm_code: The assembly code to insert :return: None
angr/analyses/reassembler.py
def insert_asm(self, addr, asm_code, before_label=False): """ Insert some assembly code at the specific address. There must be an instruction starting at that address. :param int addr: Address of insertion :param str asm_code: The assembly code to insert :return: None ""...
def insert_asm(self, addr, asm_code, before_label=False): """ Insert some assembly code at the specific address. There must be an instruction starting at that address. :param int addr: Address of insertion :param str asm_code: The assembly code to insert :return: None ""...
[ "Insert", "some", "assembly", "code", "at", "the", "specific", "address", ".", "There", "must", "be", "an", "instruction", "starting", "at", "that", "address", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/reassembler.py#L1964-L1976
[ "def", "insert_asm", "(", "self", ",", "addr", ",", "asm_code", ",", "before_label", "=", "False", ")", ":", "if", "before_label", ":", "self", ".", "_inserted_asm_before_label", "[", "addr", "]", ".", "append", "(", "asm_code", ")", "else", ":", "self", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Reassembler.append_procedure
Add a new procedure with specific name and assembly code. :param str name: The name of the new procedure. :param str asm_code: The assembly code of the procedure :return: None
angr/analyses/reassembler.py
def append_procedure(self, name, asm_code): """ Add a new procedure with specific name and assembly code. :param str name: The name of the new procedure. :param str asm_code: The assembly code of the procedure :return: None """ proc = Procedure(self, name=name, ...
def append_procedure(self, name, asm_code): """ Add a new procedure with specific name and assembly code. :param str name: The name of the new procedure. :param str asm_code: The assembly code of the procedure :return: None """ proc = Procedure(self, name=name, ...
[ "Add", "a", "new", "procedure", "with", "specific", "name", "and", "assembly", "code", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/reassembler.py#L1978-L1988
[ "def", "append_procedure", "(", "self", ",", "name", ",", "asm_code", ")", ":", "proc", "=", "Procedure", "(", "self", ",", "name", "=", "name", ",", "asm_code", "=", "asm_code", ")", "self", ".", "procedures", ".", "append", "(", "proc", ")" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Reassembler.append_data
Append a new data entry into the binary with specific name, content, and size. :param str name: Name of the data entry. Will be used as the label. :param bytes initial_content: The initial content of the data entry. :param int size: Size of the data entry. :param bool readonly: If the d...
angr/analyses/reassembler.py
def append_data(self, name, initial_content, size, readonly=False, sort="unknown"): # pylint:disable=unused-argument """ Append a new data entry into the binary with specific name, content, and size. :param str name: Name of the data entry. Will be used as the label. :param bytes initi...
def append_data(self, name, initial_content, size, readonly=False, sort="unknown"): # pylint:disable=unused-argument """ Append a new data entry into the binary with specific name, content, and size. :param str name: Name of the data entry. Will be used as the label. :param bytes initi...
[ "Append", "a", "new", "data", "entry", "into", "the", "binary", "with", "specific", "name", "content", "and", "size", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/reassembler.py#L1990-L2017
[ "def", "append_data", "(", "self", ",", "name", ",", "initial_content", ",", "size", ",", "readonly", "=", "False", ",", "sort", "=", "\"unknown\"", ")", ":", "# pylint:disable=unused-argument", "if", "readonly", ":", "section_name", "=", "\".rodata\"", "else", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Reassembler.remove_cgc_attachments
Remove CGC attachments. :return: True if CGC attachments are found and removed, False otherwise :rtype: bool
angr/analyses/reassembler.py
def remove_cgc_attachments(self): """ Remove CGC attachments. :return: True if CGC attachments are found and removed, False otherwise :rtype: bool """ cgc_package_list = None cgc_extended_application = None for data in self.data: if data.sor...
def remove_cgc_attachments(self): """ Remove CGC attachments. :return: True if CGC attachments are found and removed, False otherwise :rtype: bool """ cgc_package_list = None cgc_extended_application = None for data in self.data: if data.sor...
[ "Remove", "CGC", "attachments", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/reassembler.py#L2136-L2245
[ "def", "remove_cgc_attachments", "(", "self", ")", ":", "cgc_package_list", "=", "None", "cgc_extended_application", "=", "None", "for", "data", "in", "self", ".", "data", ":", "if", "data", ".", "sort", "==", "'cgc-package-list'", ":", "cgc_package_list", "=", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Reassembler.remove_unnecessary_stuff
Remove unnecessary functions and data :return: None
angr/analyses/reassembler.py
def remove_unnecessary_stuff(self): """ Remove unnecessary functions and data :return: None """ glibc_functions_blacklist = { '_start', '_init', '_fini', '__gmon_start__', '__do_global_dtors_aux', 'frame_du...
def remove_unnecessary_stuff(self): """ Remove unnecessary functions and data :return: None """ glibc_functions_blacklist = { '_start', '_init', '_fini', '__gmon_start__', '__do_global_dtors_aux', 'frame_du...
[ "Remove", "unnecessary", "functions", "and", "data" ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/reassembler.py#L2247-L2309
[ "def", "remove_unnecessary_stuff", "(", "self", ")", ":", "glibc_functions_blacklist", "=", "{", "'_start'", ",", "'_init'", ",", "'_fini'", ",", "'__gmon_start__'", ",", "'__do_global_dtors_aux'", ",", "'frame_dummy'", ",", "'atexit'", ",", "'deregister_tm_clones'", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
train
Reassembler._initialize
Initialize the binary. :return: None
angr/analyses/reassembler.py
def _initialize(self): """ Initialize the binary. :return: None """ # figure out section alignments for section in self.project.loader.main_object.sections: in_segment = False for segment in self.project.loader.main_object.segments: ...
def _initialize(self): """ Initialize the binary. :return: None """ # figure out section alignments for section in self.project.loader.main_object.sections: in_segment = False for segment in self.project.loader.main_object.segments: ...
[ "Initialize", "the", "binary", "." ]
angr/angr
python
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/reassembler.py#L2315-L2560
[ "def", "_initialize", "(", "self", ")", ":", "# figure out section alignments", "for", "section", "in", "self", ".", "project", ".", "loader", ".", "main_object", ".", "sections", ":", "in_segment", "=", "False", "for", "segment", "in", "self", ".", "project",...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40