repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
angr/angr
angr/simos/linux.py
SimLinux.initialize_segment_register_x64
def initialize_segment_register_x64(self, state, concrete_target): """ Set the fs register in the angr to the value of the fs register in the concrete process :param state: state which will be modified :param concrete_target: concrete target that will be used to read t...
python
def initialize_segment_register_x64(self, state, concrete_target): """ Set the fs register in the angr to the value of the fs register in the concrete process :param state: state which will be modified :param concrete_target: concrete target that will be used to read t...
[ "def", "initialize_segment_register_x64", "(", "self", ",", "state", ",", "concrete_target", ")", ":", "_l", ".", "debug", "(", "\"Synchronizing fs segment register\"", ")", "state", ".", "regs", ".", "fs", "=", "self", ".", "_read_fs_register_x64", "(", "concrete...
Set the fs register in the angr to the value of the fs register in the concrete process :param state: state which will be modified :param concrete_target: concrete target that will be used to read the fs register :return: None
[ "Set", "the", "fs", "register", "in", "the", "angr", "to", "the", "value", "of", "the", "fs", "register", "in", "the", "concrete", "process" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/simos/linux.py#L348-L357
train
Initialize the fs register in the angr to the value of the fs register in the concrete target.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/simos/linux.py
SimLinux.initialize_gdt_x86
def initialize_gdt_x86(self,state,concrete_target): """ Create a GDT in the state memory and populate the segment registers. Rehook the vsyscall address using the real value in the concrete process memory :param state: state which will be modified :param concrete_t...
python
def initialize_gdt_x86(self,state,concrete_target): """ Create a GDT in the state memory and populate the segment registers. Rehook the vsyscall address using the real value in the concrete process memory :param state: state which will be modified :param concrete_t...
[ "def", "initialize_gdt_x86", "(", "self", ",", "state", ",", "concrete_target", ")", ":", "_l", ".", "debug", "(", "\"Creating fake Global Descriptor Table and synchronizing gs segment register\"", ")", "gs", "=", "self", ".", "_read_gs_register_x86", "(", "concrete_targe...
Create a GDT in the state memory and populate the segment registers. Rehook the vsyscall address using the real value in the concrete process memory :param state: state which will be modified :param concrete_target: concrete target that will be used to read the fs register ...
[ "Create", "a", "GDT", "in", "the", "state", "memory", "and", "populate", "the", "segment", "registers", ".", "Rehook", "the", "vsyscall", "address", "using", "the", "real", "value", "in", "the", "concrete", "process", "memory" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/simos/linux.py#L359-L378
train
Create a GDT in the state memory and populate the segment registers.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/cfg/cfg_node.py
CFGNode.merge
def merge(self, other): """ Merges this node with the other, returning a new node that spans the both. """ new_node = self.copy() new_node.size += other.size new_node.instruction_addrs += other.instruction_addrs # FIXME: byte_string should never be none, but it is...
python
def merge(self, other): """ Merges this node with the other, returning a new node that spans the both. """ new_node = self.copy() new_node.size += other.size new_node.instruction_addrs += other.instruction_addrs # FIXME: byte_string should never be none, but it is...
[ "def", "merge", "(", "self", ",", "other", ")", ":", "new_node", "=", "self", ".", "copy", "(", ")", "new_node", ".", "size", "+=", "other", ".", "size", "new_node", ".", "instruction_addrs", "+=", "other", ".", "instruction_addrs", "# FIXME: byte_string sho...
Merges this node with the other, returning a new node that spans the both.
[ "Merges", "this", "node", "with", "the", "other", "returning", "a", "new", "node", "that", "spans", "the", "both", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/cfg/cfg_node.py#L246-L259
train
Merges this node with the other node returning a new node that spans the both.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/engines/soot/expressions/newArray.py
SimSootExpr_NewArray.new_array
def new_array(state, element_type, size): """ Allocates a new array in memory and returns the reference to the base. """ size_bounded = SimSootExpr_NewArray._bound_array_size(state, size) # return the reference of the array base # => elements getting lazy initialized in t...
python
def new_array(state, element_type, size): """ Allocates a new array in memory and returns the reference to the base. """ size_bounded = SimSootExpr_NewArray._bound_array_size(state, size) # return the reference of the array base # => elements getting lazy initialized in t...
[ "def", "new_array", "(", "state", ",", "element_type", ",", "size", ")", ":", "size_bounded", "=", "SimSootExpr_NewArray", ".", "_bound_array_size", "(", "state", ",", "size", ")", "# return the reference of the array base", "# => elements getting lazy initialized in the ja...
Allocates a new array in memory and returns the reference to the base.
[ "Allocates", "a", "new", "array", "in", "memory", "and", "returns", "the", "reference", "to", "the", "base", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/soot/expressions/newArray.py#L17-L26
train
Allocates a new array in memory and returns the reference to the base.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/decompiler/structurer.py
Structurer._convert_claripy_bool_ast
def _convert_claripy_bool_ast(self, cond): """ Convert recovered reaching conditions from claripy ASTs to ailment Expressions :return: None """ if isinstance(cond, ailment.Expr.Expression): return cond if cond.op == "BoolS" and claripy.is_true(cond): ...
python
def _convert_claripy_bool_ast(self, cond): """ Convert recovered reaching conditions from claripy ASTs to ailment Expressions :return: None """ if isinstance(cond, ailment.Expr.Expression): return cond if cond.op == "BoolS" and claripy.is_true(cond): ...
[ "def", "_convert_claripy_bool_ast", "(", "self", ",", "cond", ")", ":", "if", "isinstance", "(", "cond", ",", "ailment", ".", "Expr", ".", "Expression", ")", ":", "return", "cond", "if", "cond", ".", "op", "==", "\"BoolS\"", "and", "claripy", ".", "is_tr...
Convert recovered reaching conditions from claripy ASTs to ailment Expressions :return: None
[ "Convert", "recovered", "reaching", "conditions", "from", "claripy", "ASTs", "to", "ailment", "Expressions" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/decompiler/structurer.py#L552-L606
train
Converts recovered reaching conditions from claripy ASTs to ailment Expressions
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/decompiler/structurer.py
Structurer._extract_jump_targets
def _extract_jump_targets(stmt): """ Extract goto targets from a Jump or a ConditionalJump statement. :param stmt: The statement to analyze. :return: A list of known concrete jump targets. :rtype: list """ targets = [ ] # FIXME: We are...
python
def _extract_jump_targets(stmt): """ Extract goto targets from a Jump or a ConditionalJump statement. :param stmt: The statement to analyze. :return: A list of known concrete jump targets. :rtype: list """ targets = [ ] # FIXME: We are...
[ "def", "_extract_jump_targets", "(", "stmt", ")", ":", "targets", "=", "[", "]", "# FIXME: We are assuming all jump targets are concrete targets. They may not be.", "if", "isinstance", "(", "stmt", ",", "ailment", ".", "Stmt", ".", "Jump", ")", ":", "targets", ".", ...
Extract goto targets from a Jump or a ConditionalJump statement. :param stmt: The statement to analyze. :return: A list of known concrete jump targets. :rtype: list
[ "Extract", "goto", "targets", "from", "a", "Jump", "or", "a", "ConditionalJump", "statement", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/decompiler/structurer.py#L838-L857
train
Extracts concrete jump targets from a Jump or ConditionalJump statement.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/heap/heap_libc.py
SimHeapLibc.malloc
def malloc(self, sim_size): """ A somewhat faithful implementation of libc `malloc`. :param sim_size: the amount of memory (in bytes) to be allocated :returns: the address of the allocation, or a NULL pointer if the allocation failed """ raise NotImplementedError(...
python
def malloc(self, sim_size): """ A somewhat faithful implementation of libc `malloc`. :param sim_size: the amount of memory (in bytes) to be allocated :returns: the address of the allocation, or a NULL pointer if the allocation failed """ raise NotImplementedError(...
[ "def", "malloc", "(", "self", ",", "sim_size", ")", ":", "raise", "NotImplementedError", "(", "\"%s not implemented for %s\"", "%", "(", "self", ".", "malloc", ".", "__func__", ".", "__name__", ",", "self", ".", "__class__", ".", "__name__", ")", ")" ]
A somewhat faithful implementation of libc `malloc`. :param sim_size: the amount of memory (in bytes) to be allocated :returns: the address of the allocation, or a NULL pointer if the allocation failed
[ "A", "somewhat", "faithful", "implementation", "of", "libc", "malloc", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/heap/heap_libc.py#L8-L16
train
A somewhat faithful implementation of libc malloc.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/heap/heap_libc.py
SimHeapLibc.free
def free(self, ptr): #pylint:disable=unused-argument """ A somewhat faithful implementation of libc `free`. :param ptr: the location in memory to be freed """ raise NotImplementedError("%s not implemented for %s" % (self.free.__func__.__name__, ...
python
def free(self, ptr): #pylint:disable=unused-argument """ A somewhat faithful implementation of libc `free`. :param ptr: the location in memory to be freed """ raise NotImplementedError("%s not implemented for %s" % (self.free.__func__.__name__, ...
[ "def", "free", "(", "self", ",", "ptr", ")", ":", "#pylint:disable=unused-argument", "raise", "NotImplementedError", "(", "\"%s not implemented for %s\"", "%", "(", "self", ".", "free", ".", "__func__", ".", "__name__", ",", "self", ".", "__class__", ".", "__nam...
A somewhat faithful implementation of libc `free`. :param ptr: the location in memory to be freed
[ "A", "somewhat", "faithful", "implementation", "of", "libc", "free", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/heap/heap_libc.py#L18-L25
train
A somewhat faithful implementation of libc free.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/heap/heap_libc.py
SimHeapLibc.calloc
def calloc(self, sim_nmemb, sim_size): """ A somewhat faithful implementation of libc `calloc`. :param sim_nmemb: the number of elements to allocated :param sim_size: the size of each element (in bytes) :returns: the address of the allocation, or a NULL pointer if the a...
python
def calloc(self, sim_nmemb, sim_size): """ A somewhat faithful implementation of libc `calloc`. :param sim_nmemb: the number of elements to allocated :param sim_size: the size of each element (in bytes) :returns: the address of the allocation, or a NULL pointer if the a...
[ "def", "calloc", "(", "self", ",", "sim_nmemb", ",", "sim_size", ")", ":", "raise", "NotImplementedError", "(", "\"%s not implemented for %s\"", "%", "(", "self", ".", "calloc", ".", "__func__", ".", "__name__", ",", "self", ".", "__class__", ".", "__name__", ...
A somewhat faithful implementation of libc `calloc`. :param sim_nmemb: the number of elements to allocated :param sim_size: the size of each element (in bytes) :returns: the address of the allocation, or a NULL pointer if the allocation failed
[ "A", "somewhat", "faithful", "implementation", "of", "libc", "calloc", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/heap/heap_libc.py#L27-L36
train
A somewhat faithful implementation of libc. calloc.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/heap/heap_libc.py
SimHeapLibc.realloc
def realloc(self, ptr, size): """ A somewhat faithful implementation of libc `realloc`. :param ptr: the location in memory to be reallocated :param size: the new size desired for the allocation :returns: the address of the allocation, or a NULL pointer if the allocation was ...
python
def realloc(self, ptr, size): """ A somewhat faithful implementation of libc `realloc`. :param ptr: the location in memory to be reallocated :param size: the new size desired for the allocation :returns: the address of the allocation, or a NULL pointer if the allocation was ...
[ "def", "realloc", "(", "self", ",", "ptr", ",", "size", ")", ":", "raise", "NotImplementedError", "(", "\"%s not implemented for %s\"", "%", "(", "self", ".", "realloc", ".", "__func__", ".", "__name__", ",", "self", ".", "__class__", ".", "__name__", ")", ...
A somewhat faithful implementation of libc `realloc`. :param ptr: the location in memory to be reallocated :param size: the new size desired for the allocation :returns: the address of the allocation, or a NULL pointer if the allocation was freed or if no new allocation ...
[ "A", "somewhat", "faithful", "implementation", "of", "libc", "realloc", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/heap/heap_libc.py#L38-L48
train
A very fast implementation of libc realloc.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/gdb.py
GDB.set_stack
def set_stack(self, stack_dump, stack_top): """ Stack dump is a dump of the stack from gdb, i.e. the result of the following gdb command : ``dump binary memory [stack_dump] [begin_addr] [end_addr]`` We set the stack to the same addresses as the gdb session to avoid pointers corruption....
python
def set_stack(self, stack_dump, stack_top): """ Stack dump is a dump of the stack from gdb, i.e. the result of the following gdb command : ``dump binary memory [stack_dump] [begin_addr] [end_addr]`` We set the stack to the same addresses as the gdb session to avoid pointers corruption....
[ "def", "set_stack", "(", "self", ",", "stack_dump", ",", "stack_top", ")", ":", "data", "=", "self", ".", "_read_data", "(", "stack_dump", ")", "self", ".", "real_stack_top", "=", "stack_top", "addr", "=", "stack_top", "-", "len", "(", "data", ")", "# Ad...
Stack dump is a dump of the stack from gdb, i.e. the result of the following gdb command : ``dump binary memory [stack_dump] [begin_addr] [end_addr]`` We set the stack to the same addresses as the gdb session to avoid pointers corruption. :param stack_dump: The dump file. :param stac...
[ "Stack", "dump", "is", "a", "dump", "of", "the", "stack", "from", "gdb", "i", ".", "e", ".", "the", "result", "of", "the", "following", "gdb", "command", ":" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/gdb.py#L33-L49
train
Set the stack dump of the current session.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/gdb.py
GDB.set_heap
def set_heap(self, heap_dump, heap_base): """ Heap dump is a dump of the heap from gdb, i.e. the result of the following gdb command: ``dump binary memory [stack_dump] [begin] [end]`` :param heap_dump: The dump file. :param heap_base: The start address of the heap i...
python
def set_heap(self, heap_dump, heap_base): """ Heap dump is a dump of the heap from gdb, i.e. the result of the following gdb command: ``dump binary memory [stack_dump] [begin] [end]`` :param heap_dump: The dump file. :param heap_base: The start address of the heap i...
[ "def", "set_heap", "(", "self", ",", "heap_dump", ",", "heap_base", ")", ":", "# We set the heap at the same addresses as the gdb session to avoid pointer corruption.", "data", "=", "self", ".", "_read_data", "(", "heap_dump", ")", "self", ".", "state", ".", "heap", "...
Heap dump is a dump of the heap from gdb, i.e. the result of the following gdb command: ``dump binary memory [stack_dump] [begin] [end]`` :param heap_dump: The dump file. :param heap_base: The start address of the heap in the gdb session.
[ "Heap", "dump", "is", "a", "dump", "of", "the", "heap", "from", "gdb", "i", ".", "e", ".", "the", "result", "of", "the", "following", "gdb", "command", ":" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/gdb.py#L51-L67
train
Set the heap dump to the given base address.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/gdb.py
GDB.set_data
def set_data(self, addr, data_dump): """ Update any data range (most likely use is the data segments of loaded objects) """ data = self._read_data(data_dump) l.info("Set data from 0x%x to %#x", addr, addr+len(data)) self._write(addr, data)
python
def set_data(self, addr, data_dump): """ Update any data range (most likely use is the data segments of loaded objects) """ data = self._read_data(data_dump) l.info("Set data from 0x%x to %#x", addr, addr+len(data)) self._write(addr, data)
[ "def", "set_data", "(", "self", ",", "addr", ",", "data_dump", ")", ":", "data", "=", "self", ".", "_read_data", "(", "data_dump", ")", "l", ".", "info", "(", "\"Set data from 0x%x to %#x\"", ",", "addr", ",", "addr", "+", "len", "(", "data", ")", ")",...
Update any data range (most likely use is the data segments of loaded objects)
[ "Update", "any", "data", "range", "(", "most", "likely", "use", "is", "the", "data", "segments", "of", "loaded", "objects", ")" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/gdb.py#L69-L75
train
Set the data of the current object to the given address.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/gdb.py
GDB.set_regs
def set_regs(self, regs_dump): """ Initialize register values within the state :param regs_dump: The output of ``info registers`` in gdb. """ if self.real_stack_top == 0 and self.adjust_stack is True: raise SimStateError("You need to set the stack first, or set" ...
python
def set_regs(self, regs_dump): """ Initialize register values within the state :param regs_dump: The output of ``info registers`` in gdb. """ if self.real_stack_top == 0 and self.adjust_stack is True: raise SimStateError("You need to set the stack first, or set" ...
[ "def", "set_regs", "(", "self", ",", "regs_dump", ")", ":", "if", "self", ".", "real_stack_top", "==", "0", "and", "self", ".", "adjust_stack", "is", "True", ":", "raise", "SimStateError", "(", "\"You need to set the stack first, or set\"", "\"adjust_stack to False....
Initialize register values within the state :param regs_dump: The output of ``info registers`` in gdb.
[ "Initialize", "register", "values", "within", "the", "state" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/gdb.py#L77-L101
train
Initialize the state registers within the state object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/gdb.py
GDB._adjust_regs
def _adjust_regs(self): """ Adjust bp and sp w.r.t. stack difference between GDB session and angr. This matches sp and bp registers, but there is a high risk of pointers inconsistencies. """ if not self.adjust_stack: return bp = self.state.arch.register_names...
python
def _adjust_regs(self): """ Adjust bp and sp w.r.t. stack difference between GDB session and angr. This matches sp and bp registers, but there is a high risk of pointers inconsistencies. """ if not self.adjust_stack: return bp = self.state.arch.register_names...
[ "def", "_adjust_regs", "(", "self", ")", ":", "if", "not", "self", ".", "adjust_stack", ":", "return", "bp", "=", "self", ".", "state", ".", "arch", ".", "register_names", "[", "self", ".", "state", ".", "arch", ".", "bp_offset", "]", "sp", "=", "sel...
Adjust bp and sp w.r.t. stack difference between GDB session and angr. This matches sp and bp registers, but there is a high risk of pointers inconsistencies.
[ "Adjust", "bp", "and", "sp", "w", ".", "r", ".", "t", ".", "stack", "difference", "between", "GDB", "session", "and", "angr", ".", "This", "matches", "sp", "and", "bp", "registers", "but", "there", "is", "a", "high", "risk", "of", "pointers", "inconsis...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/gdb.py#L103-L118
train
Adjust sp and bp registers w. r. t. stack difference between GDB session and angr.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/loopfinder.py
LoopFinder._parse_loop_graph
def _parse_loop_graph(self, subg, bigg): """ Create a Loop object for a strongly connected graph, and any strongly connected subgraphs, if possible. :param subg: A strongly connected subgraph. :param bigg: The graph which subg is a subgraph of. :return: A l...
python
def _parse_loop_graph(self, subg, bigg): """ Create a Loop object for a strongly connected graph, and any strongly connected subgraphs, if possible. :param subg: A strongly connected subgraph. :param bigg: The graph which subg is a subgraph of. :return: A l...
[ "def", "_parse_loop_graph", "(", "self", ",", "subg", ",", "bigg", ")", ":", "loop_body_nodes", "=", "list", "(", "subg", ".", "nodes", "(", ")", ")", "[", ":", "]", "entry_edges", "=", "[", "]", "break_edges", "=", "[", "]", "continue_edges", "=", "...
Create a Loop object for a strongly connected graph, and any strongly connected subgraphs, if possible. :param subg: A strongly connected subgraph. :param bigg: The graph which subg is a subgraph of. :return: A list of Loop objects, some of which may be inside others, ...
[ "Create", "a", "Loop", "object", "for", "a", "strongly", "connected", "graph", "and", "any", "strongly", "connected", "subgraphs", "if", "possible", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/loopfinder.py#L61-L150
train
Parse a strongly connected graph and return a list of Loop objects.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/loopfinder.py
LoopFinder._parse_loops_from_graph
def _parse_loops_from_graph(self, graph): """ Return all Loop instances that can be extracted from a graph. :param graph: The graph to analyze. :return: A list of all the Loop instances that were found in the graph. """ outtop = [] outall = [] f...
python
def _parse_loops_from_graph(self, graph): """ Return all Loop instances that can be extracted from a graph. :param graph: The graph to analyze. :return: A list of all the Loop instances that were found in the graph. """ outtop = [] outall = [] f...
[ "def", "_parse_loops_from_graph", "(", "self", ",", "graph", ")", ":", "outtop", "=", "[", "]", "outall", "=", "[", "]", "for", "subg", "in", "networkx", ".", "strongly_connected_component_subgraphs", "(", "graph", ")", ":", "if", "len", "(", "subg", ".", ...
Return all Loop instances that can be extracted from a graph. :param graph: The graph to analyze. :return: A list of all the Loop instances that were found in the graph.
[ "Return", "all", "Loop", "instances", "that", "can", "be", "extracted", "from", "a", "graph", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/loopfinder.py#L152-L170
train
Returns a list of Loop instances that can be extracted from a graph.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/engines/soot/values/instancefieldref.py
SimSootValue_InstanceFieldRef.get_ref
def get_ref(cls, state, obj_alloc_id, field_class_name, field_name, field_type): """ Resolve the field within the given state. """ # resolve field field_class = state.javavm_classloader.get_class(field_class_name) field_id = resolve_field(state, field_class, field_name, f...
python
def get_ref(cls, state, obj_alloc_id, field_class_name, field_name, field_type): """ Resolve the field within the given state. """ # resolve field field_class = state.javavm_classloader.get_class(field_class_name) field_id = resolve_field(state, field_class, field_name, f...
[ "def", "get_ref", "(", "cls", ",", "state", ",", "obj_alloc_id", ",", "field_class_name", ",", "field_name", ",", "field_type", ")", ":", "# resolve field", "field_class", "=", "state", ".", "javavm_classloader", ".", "get_class", "(", "field_class_name", ")", "...
Resolve the field within the given state.
[ "Resolve", "the", "field", "within", "the", "given", "state", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/soot/values/instancefieldref.py#L36-L44
train
Resolve the field within the given state.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
_euclidean_dist
def _euclidean_dist(vector_a, vector_b): """ :param vector_a: A list of numbers. :param vector_b: A list of numbers. :returns: The euclidean distance between the two vectors. """ dist = 0 for (x, y) in zip(vector_a, vector_b): dist += (x-y)*(x-y) return math.sqrt(...
python
def _euclidean_dist(vector_a, vector_b): """ :param vector_a: A list of numbers. :param vector_b: A list of numbers. :returns: The euclidean distance between the two vectors. """ dist = 0 for (x, y) in zip(vector_a, vector_b): dist += (x-y)*(x-y) return math.sqrt(...
[ "def", "_euclidean_dist", "(", "vector_a", ",", "vector_b", ")", ":", "dist", "=", "0", "for", "(", "x", ",", "y", ")", "in", "zip", "(", "vector_a", ",", "vector_b", ")", ":", "dist", "+=", "(", "x", "-", "y", ")", "*", "(", "x", "-", "y", "...
:param vector_a: A list of numbers. :param vector_b: A list of numbers. :returns: The euclidean distance between the two vectors.
[ ":", "param", "vector_a", ":", "A", "list", "of", "numbers", ".", ":", "param", "vector_b", ":", "A", "list", "of", "numbers", ".", ":", "returns", ":", "The", "euclidean", "distance", "between", "the", "two", "vectors", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L44-L53
train
Calculates the euclidean distance between two lists of numbers.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
_get_closest_matches
def _get_closest_matches(input_attributes, target_attributes): """ :param input_attributes: First dictionary of objects to attribute tuples. :param target_attributes: Second dictionary of blocks to attribute tuples. :returns: A dictionary of objects in the input_attributes to the ...
python
def _get_closest_matches(input_attributes, target_attributes): """ :param input_attributes: First dictionary of objects to attribute tuples. :param target_attributes: Second dictionary of blocks to attribute tuples. :returns: A dictionary of objects in the input_attributes to the ...
[ "def", "_get_closest_matches", "(", "input_attributes", ",", "target_attributes", ")", ":", "closest_matches", "=", "{", "}", "# for each object in the first set find the objects with the closest target attributes", "for", "a", "in", "input_attributes", ":", "best_dist", "=", ...
:param input_attributes: First dictionary of objects to attribute tuples. :param target_attributes: Second dictionary of blocks to attribute tuples. :returns: A dictionary of objects in the input_attributes to the closest objects in the target_attributes.
[ ":", "param", "input_attributes", ":", "First", "dictionary", "of", "objects", "to", "attribute", "tuples", ".", ":", "param", "target_attributes", ":", "Second", "dictionary", "of", "blocks", "to", "attribute", "tuples", ".", ":", "returns", ":", "A", "dictio...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L56-L78
train
Returns a dictionary of objects in the input_attributes to the closest objects in the target_attributes.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
_levenshtein_distance
def _levenshtein_distance(s1, s2): """ :param s1: A list or string :param s2: Another list or string :returns: The levenshtein distance between the two """ if len(s1) > len(s2): s1, s2 = s2, s1 distances = range(len(s1) + 1) for index2, num2 in enumerate(s2): new_dis...
python
def _levenshtein_distance(s1, s2): """ :param s1: A list or string :param s2: Another list or string :returns: The levenshtein distance between the two """ if len(s1) > len(s2): s1, s2 = s2, s1 distances = range(len(s1) + 1) for index2, num2 in enumerate(s2): new_dis...
[ "def", "_levenshtein_distance", "(", "s1", ",", "s2", ")", ":", "if", "len", "(", "s1", ")", ">", "len", "(", "s2", ")", ":", "s1", ",", "s2", "=", "s2", ",", "s1", "distances", "=", "range", "(", "len", "(", "s1", ")", "+", "1", ")", "for", ...
:param s1: A list or string :param s2: Another list or string :returns: The levenshtein distance between the two
[ ":", "param", "s1", ":", "A", "list", "or", "string", ":", "param", "s2", ":", "Another", "list", "or", "string", ":", "returns", ":", "The", "levenshtein", "distance", "between", "the", "two" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L82-L101
train
Returns the Levenshtein distance between two lists or strings
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
_normalized_levenshtein_distance
def _normalized_levenshtein_distance(s1, s2, acceptable_differences): """ This function calculates the levenshtein distance but allows for elements in the lists to be different by any number in the set acceptable_differences. :param s1: A list. :param s2: A...
python
def _normalized_levenshtein_distance(s1, s2, acceptable_differences): """ This function calculates the levenshtein distance but allows for elements in the lists to be different by any number in the set acceptable_differences. :param s1: A list. :param s2: A...
[ "def", "_normalized_levenshtein_distance", "(", "s1", ",", "s2", ",", "acceptable_differences", ")", ":", "if", "len", "(", "s1", ")", ">", "len", "(", "s2", ")", ":", "s1", ",", "s2", "=", "s2", ",", "s1", "acceptable_differences", "=", "set", "(", "-...
This function calculates the levenshtein distance but allows for elements in the lists to be different by any number in the set acceptable_differences. :param s1: A list. :param s2: Another list. :param acceptable_differences: A set of numbers. If (s2[i]-s1[i]...
[ "This", "function", "calculates", "the", "levenshtein", "distance", "but", "allows", "for", "elements", "in", "the", "lists", "to", "be", "different", "by", "any", "number", "in", "the", "set", "acceptable_differences", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L104-L128
train
This function calculates the levenshtein distance between two lists.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
_is_better_match
def _is_better_match(x, y, matched_a, matched_b, attributes_dict_a, attributes_dict_b): """ :param x: The first element of a possible match. :param y: The second element of a possible match. :param matched_a: The current matches for the first set. :param...
python
def _is_better_match(x, y, matched_a, matched_b, attributes_dict_a, attributes_dict_b): """ :param x: The first element of a possible match. :param y: The second element of a possible match. :param matched_a: The current matches for the first set. :param...
[ "def", "_is_better_match", "(", "x", ",", "y", ",", "matched_a", ",", "matched_b", ",", "attributes_dict_a", ",", "attributes_dict_b", ")", ":", "attributes_x", "=", "attributes_dict_a", "[", "x", "]", "attributes_y", "=", "attributes_dict_b", "[", "y", "]", "...
:param x: The first element of a possible match. :param y: The second element of a possible match. :param matched_a: The current matches for the first set. :param matched_b: The current matches for the second set. :param attributes_dict_a: The at...
[ ":", "param", "x", ":", "The", "first", "element", "of", "a", "possible", "match", ".", ":", "param", "y", ":", "The", "second", "element", "of", "a", "possible", "match", ".", ":", "param", "matched_a", ":", "The", "current", "matches", "for", "the", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L131-L151
train
Returns True if the two sets have the same attributes.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
differing_constants
def differing_constants(block_a, block_b): """ Compares two basic blocks and finds all the constants that differ from the first block to the second. :param block_a: The first block to compare. :param block_b: The second block to compare. :returns: Returns a list of differing constants in the ...
python
def differing_constants(block_a, block_b): """ Compares two basic blocks and finds all the constants that differ from the first block to the second. :param block_a: The first block to compare. :param block_b: The second block to compare. :returns: Returns a list of differing constants in the ...
[ "def", "differing_constants", "(", "block_a", ",", "block_b", ")", ":", "statements_a", "=", "[", "s", "for", "s", "in", "block_a", ".", "vex", ".", "statements", "if", "s", ".", "tag", "!=", "\"Ist_IMark\"", "]", "+", "[", "block_a", ".", "vex", ".", ...
Compares two basic blocks and finds all the constants that differ from the first block to the second. :param block_a: The first block to compare. :param block_b: The second block to compare. :returns: Returns a list of differing constants in the form of ConstantChange, which has the offset in the ...
[ "Compares", "two", "basic", "blocks", "and", "finds", "all", "the", "constants", "that", "differ", "from", "the", "first", "block", "to", "the", "second", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L154-L193
train
Compares two basic blocks and returns all the constants that differ from the first block to the second block.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
FunctionDiff.probably_identical
def probably_identical(self): """ :returns: Whether or not these two functions are identical. """ if len(self._unmatched_blocks_from_a | self._unmatched_blocks_from_b) > 0: return False for (a, b) in self._block_matches: if not self.blocks_probably_identic...
python
def probably_identical(self): """ :returns: Whether or not these two functions are identical. """ if len(self._unmatched_blocks_from_a | self._unmatched_blocks_from_b) > 0: return False for (a, b) in self._block_matches: if not self.blocks_probably_identic...
[ "def", "probably_identical", "(", "self", ")", ":", "if", "len", "(", "self", ".", "_unmatched_blocks_from_a", "|", "self", ".", "_unmatched_blocks_from_b", ")", ">", "0", ":", "return", "False", "for", "(", "a", ",", "b", ")", "in", "self", ".", "_block...
:returns: Whether or not these two functions are identical.
[ ":", "returns", ":", "Whether", "or", "not", "these", "two", "functions", "are", "identical", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L368-L377
train
Returns True if all the two functions are identical.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
FunctionDiff.identical_blocks
def identical_blocks(self): """ :returns: A list of block matches which appear to be identical """ identical_blocks = [] for (block_a, block_b) in self._block_matches: if self.blocks_probably_identical(block_a, block_b): identical_blocks.append((block_...
python
def identical_blocks(self): """ :returns: A list of block matches which appear to be identical """ identical_blocks = [] for (block_a, block_b) in self._block_matches: if self.blocks_probably_identical(block_a, block_b): identical_blocks.append((block_...
[ "def", "identical_blocks", "(", "self", ")", ":", "identical_blocks", "=", "[", "]", "for", "(", "block_a", ",", "block_b", ")", "in", "self", ".", "_block_matches", ":", "if", "self", ".", "blocks_probably_identical", "(", "block_a", ",", "block_b", ")", ...
:returns: A list of block matches which appear to be identical
[ ":", "returns", ":", "A", "list", "of", "block", "matches", "which", "appear", "to", "be", "identical" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L380-L388
train
Returns a list of all the identical blocks in the cache.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
FunctionDiff.differing_blocks
def differing_blocks(self): """ :returns: A list of block matches which appear to differ """ differing_blocks = [] for (block_a, block_b) in self._block_matches: if not self.blocks_probably_identical(block_a, block_b): differing_blocks.append((block_a,...
python
def differing_blocks(self): """ :returns: A list of block matches which appear to differ """ differing_blocks = [] for (block_a, block_b) in self._block_matches: if not self.blocks_probably_identical(block_a, block_b): differing_blocks.append((block_a,...
[ "def", "differing_blocks", "(", "self", ")", ":", "differing_blocks", "=", "[", "]", "for", "(", "block_a", ",", "block_b", ")", "in", "self", ".", "_block_matches", ":", "if", "not", "self", ".", "blocks_probably_identical", "(", "block_a", ",", "block_b", ...
:returns: A list of block matches which appear to differ
[ ":", "returns", ":", "A", "list", "of", "block", "matches", "which", "appear", "to", "differ" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L391-L399
train
Returns a list of all blocks which appear to differ in the same entry.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
FunctionDiff.blocks_with_differing_constants
def blocks_with_differing_constants(self): """ :return: A list of block matches which appear to differ """ differing_blocks = [] diffs = dict() for (block_a, block_b) in self._block_matches: if self.blocks_probably_identical(block_a, block_b) and \ ...
python
def blocks_with_differing_constants(self): """ :return: A list of block matches which appear to differ """ differing_blocks = [] diffs = dict() for (block_a, block_b) in self._block_matches: if self.blocks_probably_identical(block_a, block_b) and \ ...
[ "def", "blocks_with_differing_constants", "(", "self", ")", ":", "differing_blocks", "=", "[", "]", "diffs", "=", "dict", "(", ")", "for", "(", "block_a", ",", "block_b", ")", "in", "self", ".", "_block_matches", ":", "if", "self", ".", "blocks_probably_iden...
:return: A list of block matches which appear to differ
[ ":", "return", ":", "A", "list", "of", "block", "matches", "which", "appear", "to", "differ" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L402-L416
train
Returns a list of blocks which appear to differ in the same function.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
FunctionDiff.block_similarity
def block_similarity(self, block_a, block_b): """ :param block_a: The first block address. :param block_b: The second block address. :returns: The similarity of the basic blocks, normalized for the base address of the block and function call addresses. ...
python
def block_similarity(self, block_a, block_b): """ :param block_a: The first block address. :param block_b: The second block address. :returns: The similarity of the basic blocks, normalized for the base address of the block and function call addresses. ...
[ "def", "block_similarity", "(", "self", ",", "block_a", ",", "block_b", ")", ":", "# handle sim procedure blocks", "if", "self", ".", "_project_a", ".", "is_hooked", "(", "block_a", ")", "and", "self", ".", "_project_b", ".", "is_hooked", "(", "block_b", ")", ...
:param block_a: The first block address. :param block_b: The second block address. :returns: The similarity of the basic blocks, normalized for the base address of the block and function call addresses.
[ ":", "param", "block_a", ":", "The", "first", "block", "address", ".", ":", "param", "block_b", ":", "The", "second", "block", "address", ".", ":", "returns", ":", "The", "similarity", "of", "the", "basic", "blocks", "normalized", "for", "the", "base", "...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L435-L492
train
Compute the similarity of two basic blocks.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
FunctionDiff.blocks_probably_identical
def blocks_probably_identical(self, block_a, block_b, check_constants=False): """ :param block_a: The first block address. :param block_b: The second block address. :param check_constants: Whether or not to require matching constants in blocks. :returns: ...
python
def blocks_probably_identical(self, block_a, block_b, check_constants=False): """ :param block_a: The first block address. :param block_b: The second block address. :param check_constants: Whether or not to require matching constants in blocks. :returns: ...
[ "def", "blocks_probably_identical", "(", "self", ",", "block_a", ",", "block_b", ",", "check_constants", "=", "False", ")", ":", "# handle sim procedure blocks", "if", "self", ".", "_project_a", ".", "is_hooked", "(", "block_a", ")", "and", "self", ".", "_projec...
:param block_a: The first block address. :param block_b: The second block address. :param check_constants: Whether or not to require matching constants in blocks. :returns: Whether or not the blocks appear to be identical.
[ ":", "param", "block_a", ":", "The", "first", "block", "address", ".", ":", "param", "block_b", ":", "The", "second", "block", "address", ".", ":", "param", "check_constants", ":", "Whether", "or", "not", "to", "require", "matching", "constants", "in", "bl...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L494-L557
train
Checks if two blocks are identical.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
FunctionDiff._compute_block_attributes
def _compute_block_attributes(function): """ :param function: A normalized function object. :returns: A dictionary of basic block addresses to tuples of attributes. """ # The attributes we use are the distance form function start, distance from function exit and whet...
python
def _compute_block_attributes(function): """ :param function: A normalized function object. :returns: A dictionary of basic block addresses to tuples of attributes. """ # The attributes we use are the distance form function start, distance from function exit and whet...
[ "def", "_compute_block_attributes", "(", "function", ")", ":", "# The attributes we use are the distance form function start, distance from function exit and whether", "# or not it has a subfunction call", "distances_from_start", "=", "FunctionDiff", ".", "_distances_from_function_start", ...
:param function: A normalized function object. :returns: A dictionary of basic block addresses to tuples of attributes.
[ ":", "param", "function", ":", "A", "normalized", "function", "object", ".", ":", "returns", ":", "A", "dictionary", "of", "basic", "block", "addresses", "to", "tuples", "of", "attributes", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L567-L590
train
Compute the basic block attributes for a given function.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
FunctionDiff._distances_from_function_exit
def _distances_from_function_exit(function): """ :param function: A normalized Function object. :returns: A dictionary of basic block addresses and their distance to the exit of the function. """ reverse_graph = function.graph.reverse() # we aren't guaranteed...
python
def _distances_from_function_exit(function): """ :param function: A normalized Function object. :returns: A dictionary of basic block addresses and their distance to the exit of the function. """ reverse_graph = function.graph.reverse() # we aren't guaranteed...
[ "def", "_distances_from_function_exit", "(", "function", ")", ":", "reverse_graph", "=", "function", ".", "graph", ".", "reverse", "(", ")", "# we aren't guaranteed to have an exit from the function so explicitly add the node", "reverse_graph", ".", "add_node", "(", "\"start\...
:param function: A normalized Function object. :returns: A dictionary of basic block addresses and their distance to the exit of the function.
[ ":", "param", "function", ":", "A", "normalized", "Function", "object", ".", ":", "returns", ":", "A", "dictionary", "of", "basic", "block", "addresses", "and", "their", "distance", "to", "the", "exit", "of", "the", "function", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L602-L631
train
Returns a dictionary of basic block addresses and their distance to the exit of the function.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
FunctionDiff._compute_diff
def _compute_diff(self): """ Computes the diff of the functions and saves the result. """ # get the attributes for all blocks l.debug("Computing diff of functions: %s, %s", ("%#x" % self._function_a.startpoint.addr) if self._function_a.startpoint is not None else ...
python
def _compute_diff(self): """ Computes the diff of the functions and saves the result. """ # get the attributes for all blocks l.debug("Computing diff of functions: %s, %s", ("%#x" % self._function_a.startpoint.addr) if self._function_a.startpoint is not None else ...
[ "def", "_compute_diff", "(", "self", ")", ":", "# get the attributes for all blocks", "l", ".", "debug", "(", "\"Computing diff of functions: %s, %s\"", ",", "(", "\"%#x\"", "%", "self", ".", "_function_a", ".", "startpoint", ".", "addr", ")", "if", "self", ".", ...
Computes the diff of the functions and saves the result.
[ "Computes", "the", "diff", "of", "the", "functions", "and", "saves", "the", "result", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L633-L713
train
Compute the diff between the functions and saves the result.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
FunctionDiff._get_block_matches
def _get_block_matches(self, attributes_a, attributes_b, filter_set_a=None, filter_set_b=None, delta=(0, 0, 0), tiebreak_with_block_similarity=False): """ :param attributes_a: A dict of blocks to their attributes :param attributes_b: A dict of blocks to their att...
python
def _get_block_matches(self, attributes_a, attributes_b, filter_set_a=None, filter_set_b=None, delta=(0, 0, 0), tiebreak_with_block_similarity=False): """ :param attributes_a: A dict of blocks to their attributes :param attributes_b: A dict of blocks to their att...
[ "def", "_get_block_matches", "(", "self", ",", "attributes_a", ",", "attributes_b", ",", "filter_set_a", "=", "None", ",", "filter_set_b", "=", "None", ",", "delta", "=", "(", "0", ",", "0", ",", "0", ")", ",", "tiebreak_with_block_similarity", "=", "False",...
:param attributes_a: A dict of blocks to their attributes :param attributes_b: A dict of blocks to their attributes The following parameters are optional. :param filter_set_a: A set to limit attributes_a to the blocks in this set. :param filter_set_b: A set to limit attribu...
[ ":", "param", "attributes_a", ":", "A", "dict", "of", "blocks", "to", "their", "attributes", ":", "param", "attributes_b", ":", "A", "dict", "of", "blocks", "to", "their", "attributes" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L734-L805
train
Get the set of attributes that are in the set and the closest matches.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
BinDiff.functions_probably_identical
def functions_probably_identical(self, func_a_addr, func_b_addr, check_consts=False): """ Compare two functions and return True if they appear identical. :param func_a_addr: The address of the first function (in the first binary). :param func_b_addr: The address of the second function (...
python
def functions_probably_identical(self, func_a_addr, func_b_addr, check_consts=False): """ Compare two functions and return True if they appear identical. :param func_a_addr: The address of the first function (in the first binary). :param func_b_addr: The address of the second function (...
[ "def", "functions_probably_identical", "(", "self", ",", "func_a_addr", ",", "func_b_addr", ",", "check_consts", "=", "False", ")", ":", "if", "self", ".", "cfg_a", ".", "project", ".", "is_hooked", "(", "func_a_addr", ")", "and", "self", ".", "cfg_b", ".", ...
Compare two functions and return True if they appear identical. :param func_a_addr: The address of the first function (in the first binary). :param func_b_addr: The address of the second function (in the second binary). :returns: Whether or not the functions appear to be identical.
[ "Compare", "two", "functions", "and", "return", "True", "if", "they", "appear", "identical", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L878-L893
train
Compare two functions and return True if they appear identical.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
BinDiff.identical_functions
def identical_functions(self): """ :returns: A list of function matches that appear to be identical """ identical_funcs = [] for (func_a, func_b) in self.function_matches: if self.functions_probably_identical(func_a, func_b): identical_funcs.append((fu...
python
def identical_functions(self): """ :returns: A list of function matches that appear to be identical """ identical_funcs = [] for (func_a, func_b) in self.function_matches: if self.functions_probably_identical(func_a, func_b): identical_funcs.append((fu...
[ "def", "identical_functions", "(", "self", ")", ":", "identical_funcs", "=", "[", "]", "for", "(", "func_a", ",", "func_b", ")", "in", "self", ".", "function_matches", ":", "if", "self", ".", "functions_probably_identical", "(", "func_a", ",", "func_b", ")",...
:returns: A list of function matches that appear to be identical
[ ":", "returns", ":", "A", "list", "of", "function", "matches", "that", "appear", "to", "be", "identical" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L896-L904
train
Returns a list of function matches that appear to be identical to the entry point.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
BinDiff.differing_functions
def differing_functions(self): """ :returns: A list of function matches that appear to differ """ different_funcs = [] for (func_a, func_b) in self.function_matches: if not self.functions_probably_identical(func_a, func_b): different_funcs.append((func...
python
def differing_functions(self): """ :returns: A list of function matches that appear to differ """ different_funcs = [] for (func_a, func_b) in self.function_matches: if not self.functions_probably_identical(func_a, func_b): different_funcs.append((func...
[ "def", "differing_functions", "(", "self", ")", ":", "different_funcs", "=", "[", "]", "for", "(", "func_a", ",", "func_b", ")", "in", "self", ".", "function_matches", ":", "if", "not", "self", ".", "functions_probably_identical", "(", "func_a", ",", "func_b...
:returns: A list of function matches that appear to differ
[ ":", "returns", ":", "A", "list", "of", "function", "matches", "that", "appear", "to", "differ" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L907-L915
train
Returns a list of functions that appear to differ in the same resource.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
BinDiff.differing_functions_with_consts
def differing_functions_with_consts(self): """ :return: A list of function matches that appear to differ including just by constants """ different_funcs = [] for (func_a, func_b) in self.function_matches: if not self.functions_probably_identical(func_a, func_b, check_...
python
def differing_functions_with_consts(self): """ :return: A list of function matches that appear to differ including just by constants """ different_funcs = [] for (func_a, func_b) in self.function_matches: if not self.functions_probably_identical(func_a, func_b, check_...
[ "def", "differing_functions_with_consts", "(", "self", ")", ":", "different_funcs", "=", "[", "]", "for", "(", "func_a", ",", "func_b", ")", "in", "self", ".", "function_matches", ":", "if", "not", "self", ".", "functions_probably_identical", "(", "func_a", ",...
:return: A list of function matches that appear to differ including just by constants
[ ":", "return", ":", "A", "list", "of", "function", "matches", "that", "appear", "to", "differ", "including", "just", "by", "constants" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L917-L925
train
Returns a list of functions that appear to differ including just by constants.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
BinDiff.differing_blocks
def differing_blocks(self): """ :returns: A list of block matches that appear to differ """ differing_blocks = [] for (func_a, func_b) in self.function_matches: differing_blocks.extend(self.get_function_diff(func_a, func_b).differing_blocks) return differing_b...
python
def differing_blocks(self): """ :returns: A list of block matches that appear to differ """ differing_blocks = [] for (func_a, func_b) in self.function_matches: differing_blocks.extend(self.get_function_diff(func_a, func_b).differing_blocks) return differing_b...
[ "def", "differing_blocks", "(", "self", ")", ":", "differing_blocks", "=", "[", "]", "for", "(", "func_a", ",", "func_b", ")", "in", "self", ".", "function_matches", ":", "differing_blocks", ".", "extend", "(", "self", ".", "get_function_diff", "(", "func_a"...
:returns: A list of block matches that appear to differ
[ ":", "returns", ":", "A", "list", "of", "block", "matches", "that", "appear", "to", "differ" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L928-L935
train
Returns a list of all the blocks that appear to differ in the same entry.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
BinDiff.identical_blocks
def identical_blocks(self): """ :return A list of all block matches that appear to be identical """ identical_blocks = [] for (func_a, func_b) in self.function_matches: identical_blocks.extend(self.get_function_diff(func_a, func_b).identical_blocks) return ide...
python
def identical_blocks(self): """ :return A list of all block matches that appear to be identical """ identical_blocks = [] for (func_a, func_b) in self.function_matches: identical_blocks.extend(self.get_function_diff(func_a, func_b).identical_blocks) return ide...
[ "def", "identical_blocks", "(", "self", ")", ":", "identical_blocks", "=", "[", "]", "for", "(", "func_a", ",", "func_b", ")", "in", "self", ".", "function_matches", ":", "identical_blocks", ".", "extend", "(", "self", ".", "get_function_diff", "(", "func_a"...
:return A list of all block matches that appear to be identical
[ ":", "return", "A", "list", "of", "all", "block", "matches", "that", "appear", "to", "be", "identical" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L938-L945
train
A list of all block matches that appear to be identical
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
BinDiff.blocks_with_differing_constants
def blocks_with_differing_constants(self): """ :return: A dict of block matches with differing constants to the tuple of constants """ diffs = dict() for (func_a, func_b) in self.function_matches: diffs.update(self.get_function_diff(func_a, func_b).blocks_with_differi...
python
def blocks_with_differing_constants(self): """ :return: A dict of block matches with differing constants to the tuple of constants """ diffs = dict() for (func_a, func_b) in self.function_matches: diffs.update(self.get_function_diff(func_a, func_b).blocks_with_differi...
[ "def", "blocks_with_differing_constants", "(", "self", ")", ":", "diffs", "=", "dict", "(", ")", "for", "(", "func_a", ",", "func_b", ")", "in", "self", ".", "function_matches", ":", "diffs", ".", "update", "(", "self", ".", "get_function_diff", "(", "func...
:return: A dict of block matches with differing constants to the tuple of constants
[ ":", "return", ":", "A", "dict", "of", "block", "matches", "with", "differing", "constants", "to", "the", "tuple", "of", "constants" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L948-L955
train
A dict of block matches with differing constants to the tuple of constants
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
BinDiff.get_function_diff
def get_function_diff(self, function_addr_a, function_addr_b): """ :param function_addr_a: The address of the first function (in the first binary) :param function_addr_b: The address of the second function (in the second binary) :returns: the FunctionDiff of the two functions """...
python
def get_function_diff(self, function_addr_a, function_addr_b): """ :param function_addr_a: The address of the first function (in the first binary) :param function_addr_b: The address of the second function (in the second binary) :returns: the FunctionDiff of the two functions """...
[ "def", "get_function_diff", "(", "self", ",", "function_addr_a", ",", "function_addr_b", ")", ":", "pair", "=", "(", "function_addr_a", ",", "function_addr_b", ")", "if", "pair", "not", "in", "self", ".", "_function_diffs", ":", "function_a", "=", "self", ".",...
:param function_addr_a: The address of the first function (in the first binary) :param function_addr_b: The address of the second function (in the second binary) :returns: the FunctionDiff of the two functions
[ ":", "param", "function_addr_a", ":", "The", "address", "of", "the", "first", "function", "(", "in", "the", "first", "binary", ")", ":", "param", "function_addr_b", ":", "The", "address", "of", "the", "second", "function", "(", "in", "the", "second", "bina...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L962-L973
train
Returns the FunctionDiff object for the two functions in the binary.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
BinDiff._compute_function_attributes
def _compute_function_attributes(cfg): """ :param cfg: An angr CFG object :returns: a dictionary of function addresses to tuples of attributes """ # the attributes we use are the number of basic blocks, number of edges, and number of subfunction calls attributes = dict...
python
def _compute_function_attributes(cfg): """ :param cfg: An angr CFG object :returns: a dictionary of function addresses to tuples of attributes """ # the attributes we use are the number of basic blocks, number of edges, and number of subfunction calls attributes = dict...
[ "def", "_compute_function_attributes", "(", "cfg", ")", ":", "# the attributes we use are the number of basic blocks, number of edges, and number of subfunction calls", "attributes", "=", "dict", "(", ")", "all_funcs", "=", "set", "(", "cfg", ".", "kb", ".", "callgraph", "....
:param cfg: An angr CFG object :returns: a dictionary of function addresses to tuples of attributes
[ ":", "param", "cfg", ":", "An", "angr", "CFG", "object", ":", "returns", ":", "a", "dictionary", "of", "function", "addresses", "to", "tuples", "of", "attributes" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L976-L1001
train
Compute the attributes of the functions in the object store.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/bindiff.py
BinDiff._get_function_matches
def _get_function_matches(attributes_a, attributes_b, filter_set_a=None, filter_set_b=None): """ :param attributes_a: A dict of functions to their attributes :param attributes_b: A dict of functions to their attributes The following parameters are optional. :param filter_...
python
def _get_function_matches(attributes_a, attributes_b, filter_set_a=None, filter_set_b=None): """ :param attributes_a: A dict of functions to their attributes :param attributes_b: A dict of functions to their attributes The following parameters are optional. :param filter_...
[ "def", "_get_function_matches", "(", "attributes_a", ",", "attributes_b", ",", "filter_set_a", "=", "None", ",", "filter_set_b", "=", "None", ")", ":", "# get the attributes that are in the sets", "if", "filter_set_a", "is", "None", ":", "filtered_attributes_a", "=", ...
:param attributes_a: A dict of functions to their attributes :param attributes_b: A dict of functions to their attributes The following parameters are optional. :param filter_set_a: A set to limit attributes_a to the functions in this set. :param filter_set_b: A set to limi...
[ ":", "param", "attributes_a", ":", "A", "dict", "of", "functions", "to", "their", "attributes", ":", "param", "attributes_b", ":", "A", "dict", "of", "functions", "to", "their", "attributes" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/bindiff.py#L1171-L1205
train
Returns a list of tuples of matching functions.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/project.py
load_shellcode
def load_shellcode(shellcode, arch, start_offset=0, load_address=0): """ Load a new project based on a string of raw bytecode. :param shellcode: The data to load :param arch: The name of the arch to use, or an archinfo class :param start_offset: The offset into the data to start...
python
def load_shellcode(shellcode, arch, start_offset=0, load_address=0): """ Load a new project based on a string of raw bytecode. :param shellcode: The data to load :param arch: The name of the arch to use, or an archinfo class :param start_offset: The offset into the data to start...
[ "def", "load_shellcode", "(", "shellcode", ",", "arch", ",", "start_offset", "=", "0", ",", "load_address", "=", "0", ")", ":", "return", "Project", "(", "BytesIO", "(", "shellcode", ")", ",", "main_opts", "=", "{", "'backend'", ":", "'blob'", ",", "'arc...
Load a new project based on a string of raw bytecode. :param shellcode: The data to load :param arch: The name of the arch to use, or an archinfo class :param start_offset: The offset into the data to start analysis (default 0) :param load_address: The address to place the data i...
[ "Load", "a", "new", "project", "based", "on", "a", "string", "of", "raw", "bytecode", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/project.py#L17-L34
train
Load a new project based on a string of raw bytecode.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/project.py
Project._register_object
def _register_object(self, obj, sim_proc_arch): """ This scans through an objects imports and hooks them with simprocedures from our library whenever possible """ # Step 1: get the set of libraries we are allowed to use to resolve unresolved symbols missing_libs = [] for...
python
def _register_object(self, obj, sim_proc_arch): """ This scans through an objects imports and hooks them with simprocedures from our library whenever possible """ # Step 1: get the set of libraries we are allowed to use to resolve unresolved symbols missing_libs = [] for...
[ "def", "_register_object", "(", "self", ",", "obj", ",", "sim_proc_arch", ")", ":", "# Step 1: get the set of libraries we are allowed to use to resolve unresolved symbols", "missing_libs", "=", "[", "]", "for", "lib_name", "in", "self", ".", "loader", ".", "missing_depen...
This scans through an objects imports and hooks them with simprocedures from our library whenever possible
[ "This", "scans", "through", "an", "objects", "imports", "and", "hooks", "them", "with", "simprocedures", "from", "our", "library", "whenever", "possible" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/project.py#L231-L340
train
This function scans through an object imports and hooks them with simprocedures from our library and adds the needed libraries to the object if they don t have any.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/project.py
Project._guess_simprocedure
def _guess_simprocedure(self, f, hint): """ Does symbol name `f` exist as a SIM_PROCEDURE? If so, return it, else return None. Narrows down the set of libraries to search based on hint. Part of the hack to enable Binary Ninja support. Remove if _register_objects() stops using it. ...
python
def _guess_simprocedure(self, f, hint): """ Does symbol name `f` exist as a SIM_PROCEDURE? If so, return it, else return None. Narrows down the set of libraries to search based on hint. Part of the hack to enable Binary Ninja support. Remove if _register_objects() stops using it. ...
[ "def", "_guess_simprocedure", "(", "self", ",", "f", ",", "hint", ")", ":", "# First, filter the SIM_LIBRARIES to a reasonable subset based on the hint", "hinted_libs", "=", "[", "]", "if", "hint", "==", "\"win\"", ":", "hinted_libs", "=", "filter", "(", "lambda", "...
Does symbol name `f` exist as a SIM_PROCEDURE? If so, return it, else return None. Narrows down the set of libraries to search based on hint. Part of the hack to enable Binary Ninja support. Remove if _register_objects() stops using it.
[ "Does", "symbol", "name", "f", "exist", "as", "a", "SIM_PROCEDURE?", "If", "so", "return", "it", "else", "return", "None", ".", "Narrows", "down", "the", "set", "of", "libraries", "to", "search", "based", "on", "hint", ".", "Part", "of", "the", "hack", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/project.py#L342-L361
train
Guesses the SimProcedure for a symbol name f.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/project.py
Project._check_user_blacklists
def _check_user_blacklists(self, f): """ Has symbol name `f` been marked for exclusion by any of the user parameters? """ return not self._should_use_sim_procedures or \ f in self._exclude_sim_procedures_list or \ f in self._ignore_functions or \ ...
python
def _check_user_blacklists(self, f): """ Has symbol name `f` been marked for exclusion by any of the user parameters? """ return not self._should_use_sim_procedures or \ f in self._exclude_sim_procedures_list or \ f in self._ignore_functions or \ ...
[ "def", "_check_user_blacklists", "(", "self", ",", "f", ")", ":", "return", "not", "self", ".", "_should_use_sim_procedures", "or", "f", "in", "self", ".", "_exclude_sim_procedures_list", "or", "f", "in", "self", ".", "_ignore_functions", "or", "(", "self", "....
Has symbol name `f` been marked for exclusion by any of the user parameters?
[ "Has", "symbol", "name", "f", "been", "marked", "for", "exclusion", "by", "any", "of", "the", "user", "parameters?" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/project.py#L363-L371
train
Check if the user has blacklisted the given symbol name f.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/project.py
Project.hook
def hook(self, addr, hook=None, length=0, kwargs=None, replace=False): """ Hook a section of code with a custom function. This is used internally to provide symbolic summaries of library functions, and can be used to instrument execution or to modify control flow. When hook is n...
python
def hook(self, addr, hook=None, length=0, kwargs=None, replace=False): """ Hook a section of code with a custom function. This is used internally to provide symbolic summaries of library functions, and can be used to instrument execution or to modify control flow. When hook is n...
[ "def", "hook", "(", "self", ",", "addr", ",", "hook", "=", "None", ",", "length", "=", "0", ",", "kwargs", "=", "None", ",", "replace", "=", "False", ")", ":", "if", "hook", "is", "None", ":", "# if we haven't been passed a thing to hook with, assume we're b...
Hook a section of code with a custom function. This is used internally to provide symbolic summaries of library functions, and can be used to instrument execution or to modify control flow. When hook is not specified, it returns a function decorator that allows easy hooking. Usage:: ...
[ "Hook", "a", "section", "of", "code", "with", "a", "custom", "function", ".", "This", "is", "used", "internally", "to", "provide", "symbolic", "summaries", "of", "library", "functions", "and", "can", "be", "used", "to", "instrument", "execution", "or", "to",...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/project.py#L385-L436
train
A function to hook a set of library functions at a specific address.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/project.py
Project.hooked_by
def hooked_by(self, addr): """ Returns the current hook for `addr`. :param addr: An address. :returns: None if the address is not hooked. """ if not self.is_hooked(addr): l.warning("Address %s is not hooked", self._addr_to_str(addr)) return N...
python
def hooked_by(self, addr): """ Returns the current hook for `addr`. :param addr: An address. :returns: None if the address is not hooked. """ if not self.is_hooked(addr): l.warning("Address %s is not hooked", self._addr_to_str(addr)) return N...
[ "def", "hooked_by", "(", "self", ",", "addr", ")", ":", "if", "not", "self", ".", "is_hooked", "(", "addr", ")", ":", "l", ".", "warning", "(", "\"Address %s is not hooked\"", ",", "self", ".", "_addr_to_str", "(", "addr", ")", ")", "return", "None", "...
Returns the current hook for `addr`. :param addr: An address. :returns: None if the address is not hooked.
[ "Returns", "the", "current", "hook", "for", "addr", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/project.py#L447-L460
train
Returns the current hook for addr.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/project.py
Project.unhook
def unhook(self, addr): """ Remove a hook. :param addr: The address of the hook. """ if not self.is_hooked(addr): l.warning("Address %s not hooked", self._addr_to_str(addr)) return del self._sim_procedures[addr]
python
def unhook(self, addr): """ Remove a hook. :param addr: The address of the hook. """ if not self.is_hooked(addr): l.warning("Address %s not hooked", self._addr_to_str(addr)) return del self._sim_procedures[addr]
[ "def", "unhook", "(", "self", ",", "addr", ")", ":", "if", "not", "self", ".", "is_hooked", "(", "addr", ")", ":", "l", ".", "warning", "(", "\"Address %s not hooked\"", ",", "self", ".", "_addr_to_str", "(", "addr", ")", ")", "return", "del", "self", ...
Remove a hook. :param addr: The address of the hook.
[ "Remove", "a", "hook", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/project.py#L462-L472
train
Removes a hook from the list of functions that are hooked at the given address.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/project.py
Project.hook_symbol
def hook_symbol(self, symbol_name, simproc, kwargs=None, replace=None): """ Resolve a dependency in a binary. Looks up the address of the given symbol, and then hooks that address. If the symbol was not available in the loaded libraries, this address may be provided by the CLE externs ob...
python
def hook_symbol(self, symbol_name, simproc, kwargs=None, replace=None): """ Resolve a dependency in a binary. Looks up the address of the given symbol, and then hooks that address. If the symbol was not available in the loaded libraries, this address may be provided by the CLE externs ob...
[ "def", "hook_symbol", "(", "self", ",", "symbol_name", ",", "simproc", ",", "kwargs", "=", "None", ",", "replace", "=", "None", ")", ":", "if", "type", "(", "symbol_name", ")", "is", "not", "int", ":", "sym", "=", "self", ".", "loader", ".", "find_sy...
Resolve a dependency in a binary. Looks up the address of the given symbol, and then hooks that address. If the symbol was not available in the loaded libraries, this address may be provided by the CLE externs object. Additionally, if instead of a symbol name you provide an address, some secret...
[ "Resolve", "a", "dependency", "in", "a", "binary", ".", "Looks", "up", "the", "address", "of", "the", "given", "symbol", "and", "then", "hooks", "that", "address", ".", "If", "the", "symbol", "was", "not", "available", "in", "the", "loaded", "libraries", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/project.py#L474-L522
train
Resolve a dependency in a binary and hook it with the actual version of the module.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/project.py
Project.is_symbol_hooked
def is_symbol_hooked(self, symbol_name): """ Check if a symbol is already hooked. :param str symbol_name: Name of the symbol. :return: True if the symbol can be resolved and is hooked, False otherwise. :rtype: bool """ sym = self.loader.find_symbol(symbol_name) ...
python
def is_symbol_hooked(self, symbol_name): """ Check if a symbol is already hooked. :param str symbol_name: Name of the symbol. :return: True if the symbol can be resolved and is hooked, False otherwise. :rtype: bool """ sym = self.loader.find_symbol(symbol_name) ...
[ "def", "is_symbol_hooked", "(", "self", ",", "symbol_name", ")", ":", "sym", "=", "self", ".", "loader", ".", "find_symbol", "(", "symbol_name", ")", "if", "sym", "is", "None", ":", "l", ".", "warning", "(", "\"Could not find symbol %s\"", ",", "symbol_name"...
Check if a symbol is already hooked. :param str symbol_name: Name of the symbol. :return: True if the symbol can be resolved and is hooked, False otherwise. :rtype: bool
[ "Check", "if", "a", "symbol", "is", "already", "hooked", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/project.py#L524-L537
train
Check if a symbol is already hooked.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/project.py
Project.unhook_symbol
def unhook_symbol(self, symbol_name): """ Remove the hook on a symbol. This function will fail if the symbol is provided by the extern object, as that would result in a state where analysis would be unable to cope with a call to this symbol. """ sym = self.loader.find_sym...
python
def unhook_symbol(self, symbol_name): """ Remove the hook on a symbol. This function will fail if the symbol is provided by the extern object, as that would result in a state where analysis would be unable to cope with a call to this symbol. """ sym = self.loader.find_sym...
[ "def", "unhook_symbol", "(", "self", ",", "symbol_name", ")", ":", "sym", "=", "self", ".", "loader", ".", "find_symbol", "(", "symbol_name", ")", "if", "sym", "is", "None", ":", "l", ".", "warning", "(", "\"Could not find symbol %s\"", ",", "symbol_name", ...
Remove the hook on a symbol. This function will fail if the symbol is provided by the extern object, as that would result in a state where analysis would be unable to cope with a call to this symbol.
[ "Remove", "the", "hook", "on", "a", "symbol", ".", "This", "function", "will", "fail", "if", "the", "symbol", "is", "provided", "by", "the", "extern", "object", "as", "that", "would", "result", "in", "a", "state", "where", "analysis", "would", "be", "una...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/project.py#L539-L556
train
Unhook a hook on a symbol.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/project.py
Project.rehook_symbol
def rehook_symbol(self, new_address, symbol_name): """ Move the hook for a symbol to a specific address :param new_address: the new address that will trigger the SimProc execution :param symbol_name: the name of the symbol (f.i. strcmp ) :return: None """ new_sim_...
python
def rehook_symbol(self, new_address, symbol_name): """ Move the hook for a symbol to a specific address :param new_address: the new address that will trigger the SimProc execution :param symbol_name: the name of the symbol (f.i. strcmp ) :return: None """ new_sim_...
[ "def", "rehook_symbol", "(", "self", ",", "new_address", ",", "symbol_name", ")", ":", "new_sim_procedures", "=", "{", "}", "for", "key_address", ",", "simproc_obj", "in", "self", ".", "_sim_procedures", ".", "items", "(", ")", ":", "if", "simproc_obj", ".",...
Move the hook for a symbol to a specific address :param new_address: the new address that will trigger the SimProc execution :param symbol_name: the name of the symbol (f.i. strcmp ) :return: None
[ "Move", "the", "hook", "for", "a", "symbol", "to", "a", "specific", "address", ":", "param", "new_address", ":", "the", "new", "address", "that", "will", "trigger", "the", "SimProc", "execution", ":", "param", "symbol_name", ":", "the", "name", "of", "the"...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/project.py#L558-L572
train
Move the hook for a specific symbol to a specific address
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/project.py
Project.execute
def execute(self, *args, **kwargs): """ This function is a symbolic execution helper in the simple style supported by triton and manticore. It designed to be run after setting up hooks (see Project.hook), in which the symbolic state can be checked. This function can be r...
python
def execute(self, *args, **kwargs): """ This function is a symbolic execution helper in the simple style supported by triton and manticore. It designed to be run after setting up hooks (see Project.hook), in which the symbolic state can be checked. This function can be r...
[ "def", "execute", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "args", ":", "state", "=", "args", "[", "0", "]", "else", ":", "state", "=", "self", ".", "factory", ".", "full_init_state", "(", "*", "*", "kwargs", ")", ...
This function is a symbolic execution helper in the simple style supported by triton and manticore. It designed to be run after setting up hooks (see Project.hook), in which the symbolic state can be checked. This function can be run in three different ways: - When run with...
[ "This", "function", "is", "a", "symbolic", "execution", "helper", "in", "the", "simple", "style", "supported", "by", "triton", "and", "manticore", ".", "It", "designed", "to", "be", "run", "after", "setting", "up", "hooks", "(", "see", "Project", ".", "hoo...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/project.py#L578-L605
train
This function is a simple style symbolic execution helper that returns a simulation manager that is ready to be used to execute the entry point.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/project.py
Project._hook_decorator
def _hook_decorator(self, addr, length=0, kwargs=None): """ Return a function decorator that allows easy hooking. Please refer to hook() for its usage. :return: The function decorator. """ def hook_decorator(func): self.hook(addr, func, length=length, kwargs=kwargs)...
python
def _hook_decorator(self, addr, length=0, kwargs=None): """ Return a function decorator that allows easy hooking. Please refer to hook() for its usage. :return: The function decorator. """ def hook_decorator(func): self.hook(addr, func, length=length, kwargs=kwargs)...
[ "def", "_hook_decorator", "(", "self", ",", "addr", ",", "length", "=", "0", ",", "kwargs", "=", "None", ")", ":", "def", "hook_decorator", "(", "func", ")", ":", "self", ".", "hook", "(", "addr", ",", "func", ",", "length", "=", "length", ",", "kw...
Return a function decorator that allows easy hooking. Please refer to hook() for its usage. :return: The function decorator.
[ "Return", "a", "function", "decorator", "that", "allows", "easy", "hooking", ".", "Please", "refer", "to", "hook", "()", "for", "its", "usage", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/project.py#L617-L628
train
A decorator that allows easy hooking of the current object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/project.py
Project.is_java_project
def is_java_project(self): """ Indicates if the project's main binary is a Java Archive. """ if self._is_java_project is None: self._is_java_project = isinstance(self.arch, ArchSoot) return self._is_java_project
python
def is_java_project(self): """ Indicates if the project's main binary is a Java Archive. """ if self._is_java_project is None: self._is_java_project = isinstance(self.arch, ArchSoot) return self._is_java_project
[ "def", "is_java_project", "(", "self", ")", ":", "if", "self", ".", "_is_java_project", "is", "None", ":", "self", ".", "_is_java_project", "=", "isinstance", "(", "self", ".", "arch", ",", "ArchSoot", ")", "return", "self", ".", "_is_java_project" ]
Indicates if the project's main binary is a Java Archive.
[ "Indicates", "if", "the", "project", "s", "main", "binary", "is", "a", "Java", "Archive", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/project.py#L701-L707
train
Indicates if the project s main binary is a Java Archive.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/project.py
Project.is_java_jni_project
def is_java_jni_project(self): """ Indicates if the project's main binary is a Java Archive, which interacts during its execution with native libraries (via JNI). """ if self._is_java_jni_project is None: self._is_java_jni_project = isinstance(self.arch, ArchSoot) and...
python
def is_java_jni_project(self): """ Indicates if the project's main binary is a Java Archive, which interacts during its execution with native libraries (via JNI). """ if self._is_java_jni_project is None: self._is_java_jni_project = isinstance(self.arch, ArchSoot) and...
[ "def", "is_java_jni_project", "(", "self", ")", ":", "if", "self", ".", "_is_java_jni_project", "is", "None", ":", "self", ".", "_is_java_jni_project", "=", "isinstance", "(", "self", ".", "arch", ",", "ArchSoot", ")", "and", "self", ".", "simos", ".", "is...
Indicates if the project's main binary is a Java Archive, which interacts during its execution with native libraries (via JNI).
[ "Indicates", "if", "the", "project", "s", "main", "binary", "is", "a", "Java", "Archive", "which", "interacts", "during", "its", "execution", "with", "native", "libraries", "(", "via", "JNI", ")", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/project.py#L710-L717
train
Indicates if the project s main binary is a Java Archive which contains native libraries.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/misc/plugins.py
PluginHub.register_preset
def register_preset(cls, name, preset): """ Register a preset instance with the class of the hub it corresponds to. This allows individual plugin objects to automatically register themselves with a preset by using a classmethod of their own with only the name of the preset to register wi...
python
def register_preset(cls, name, preset): """ Register a preset instance with the class of the hub it corresponds to. This allows individual plugin objects to automatically register themselves with a preset by using a classmethod of their own with only the name of the preset to register wi...
[ "def", "register_preset", "(", "cls", ",", "name", ",", "preset", ")", ":", "if", "cls", ".", "_presets", "is", "None", ":", "cls", ".", "_presets", "=", "{", "}", "cls", ".", "_presets", "[", "name", "]", "=", "preset" ]
Register a preset instance with the class of the hub it corresponds to. This allows individual plugin objects to automatically register themselves with a preset by using a classmethod of their own with only the name of the preset to register with.
[ "Register", "a", "preset", "instance", "with", "the", "class", "of", "the", "hub", "it", "corresponds", "to", ".", "This", "allows", "individual", "plugin", "objects", "to", "automatically", "register", "themselves", "with", "a", "preset", "by", "using", "a", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/misc/plugins.py#L42-L50
train
Register a preset instance with the class of the hub.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/misc/plugins.py
PluginHub.use_plugin_preset
def use_plugin_preset(self, preset): """ Apply a preset to the hub. If there was a previously active preset, discard it. Preset can be either the string name of a preset or a PluginPreset instance. """ if isinstance(preset, str): try: preset = self._p...
python
def use_plugin_preset(self, preset): """ Apply a preset to the hub. If there was a previously active preset, discard it. Preset can be either the string name of a preset or a PluginPreset instance. """ if isinstance(preset, str): try: preset = self._p...
[ "def", "use_plugin_preset", "(", "self", ",", "preset", ")", ":", "if", "isinstance", "(", "preset", ",", "str", ")", ":", "try", ":", "preset", "=", "self", ".", "_presets", "[", "preset", "]", "except", "(", "AttributeError", ",", "KeyError", ")", ":...
Apply a preset to the hub. If there was a previously active preset, discard it. Preset can be either the string name of a preset or a PluginPreset instance.
[ "Apply", "a", "preset", "to", "the", "hub", ".", "If", "there", "was", "a", "previously", "active", "preset", "discard", "it", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/misc/plugins.py#L109-L129
train
Apply a preset to the hub.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/misc/plugins.py
PluginHub.discard_plugin_preset
def discard_plugin_preset(self): """ Discard the current active preset. Will release any active plugins that could have come from the old preset. """ if self.has_plugin_preset: for name, plugin in list(self._active_plugins.items()): if id(plugin) in self._prov...
python
def discard_plugin_preset(self): """ Discard the current active preset. Will release any active plugins that could have come from the old preset. """ if self.has_plugin_preset: for name, plugin in list(self._active_plugins.items()): if id(plugin) in self._prov...
[ "def", "discard_plugin_preset", "(", "self", ")", ":", "if", "self", ".", "has_plugin_preset", ":", "for", "name", ",", "plugin", "in", "list", "(", "self", ".", "_active_plugins", ".", "items", "(", ")", ")", ":", "if", "id", "(", "plugin", ")", "in",...
Discard the current active preset. Will release any active plugins that could have come from the old preset.
[ "Discard", "the", "current", "active", "preset", ".", "Will", "release", "any", "active", "plugins", "that", "could", "have", "come", "from", "the", "old", "preset", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/misc/plugins.py#L131-L140
train
Discard the current active preset. Will release any plugins that were previously provided by the old preset. Will release any plugins that were previously provided by the old preset. Will release any plugins that were previously provided by the old preset.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/misc/plugins.py
PluginHub.get_plugin
def get_plugin(self, name): """ Get the plugin named ``name``. If no such plugin is currently active, try to activate a new one using the current preset. """ if name in self._active_plugins: return self._active_plugins[name] elif self.has_plugin_preset: ...
python
def get_plugin(self, name): """ Get the plugin named ``name``. If no such plugin is currently active, try to activate a new one using the current preset. """ if name in self._active_plugins: return self._active_plugins[name] elif self.has_plugin_preset: ...
[ "def", "get_plugin", "(", "self", ",", "name", ")", ":", "if", "name", "in", "self", ".", "_active_plugins", ":", "return", "self", ".", "_active_plugins", "[", "name", "]", "elif", "self", ".", "has_plugin_preset", ":", "plugin_cls", "=", "self", ".", "...
Get the plugin named ``name``. If no such plugin is currently active, try to activate a new one using the current preset.
[ "Get", "the", "plugin", "named", "name", ".", "If", "no", "such", "plugin", "is", "currently", "active", "try", "to", "activate", "a", "new", "one", "using", "the", "current", "preset", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/misc/plugins.py#L146-L165
train
Get the named plugin.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/misc/plugins.py
PluginHub.register_plugin
def register_plugin(self, name, plugin): """ Add a new plugin ``plugin`` with name ``name`` to the active plugins. """ if self.has_plugin(name): self.release_plugin(name) self._active_plugins[name] = plugin setattr(self, name, plugin) return plugin
python
def register_plugin(self, name, plugin): """ Add a new plugin ``plugin`` with name ``name`` to the active plugins. """ if self.has_plugin(name): self.release_plugin(name) self._active_plugins[name] = plugin setattr(self, name, plugin) return plugin
[ "def", "register_plugin", "(", "self", ",", "name", ",", "plugin", ")", ":", "if", "self", ".", "has_plugin", "(", "name", ")", ":", "self", ".", "release_plugin", "(", "name", ")", "self", ".", "_active_plugins", "[", "name", "]", "=", "plugin", "seta...
Add a new plugin ``plugin`` with name ``name`` to the active plugins.
[ "Add", "a", "new", "plugin", "plugin", "with", "name", "name", "to", "the", "active", "plugins", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/misc/plugins.py#L181-L189
train
Register a new plugin with the given name.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/misc/plugins.py
PluginHub.release_plugin
def release_plugin(self, name): """ Deactivate and remove the plugin with name ``name``. """ plugin = self._active_plugins[name] if id(plugin) in self._provided_by_preset: self._provided_by_preset.remove(id(plugin)) del self._active_plugins[name] dela...
python
def release_plugin(self, name): """ Deactivate and remove the plugin with name ``name``. """ plugin = self._active_plugins[name] if id(plugin) in self._provided_by_preset: self._provided_by_preset.remove(id(plugin)) del self._active_plugins[name] dela...
[ "def", "release_plugin", "(", "self", ",", "name", ")", ":", "plugin", "=", "self", ".", "_active_plugins", "[", "name", "]", "if", "id", "(", "plugin", ")", "in", "self", ".", "_provided_by_preset", ":", "self", ".", "_provided_by_preset", ".", "remove", ...
Deactivate and remove the plugin with name ``name``.
[ "Deactivate", "and", "remove", "the", "plugin", "with", "name", "name", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/misc/plugins.py#L191-L200
train
Deactivate and remove the plugin with name name.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/misc/plugins.py
PluginPreset.copy
def copy(self): """ Return a copy of self. """ cls = self.__class__ result = cls.__new__(cls) result._default_plugins = dict(self._default_plugins) # pylint:disable=protected-access return result
python
def copy(self): """ Return a copy of self. """ cls = self.__class__ result = cls.__new__(cls) result._default_plugins = dict(self._default_plugins) # pylint:disable=protected-access return result
[ "def", "copy", "(", "self", ")", ":", "cls", "=", "self", ".", "__class__", "result", "=", "cls", ".", "__new__", "(", "cls", ")", "result", ".", "_default_plugins", "=", "dict", "(", "self", ".", "_default_plugins", ")", "# pylint:disable=protected-access",...
Return a copy of self.
[ "Return", "a", "copy", "of", "self", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/misc/plugins.py#L249-L256
train
Return a copy of self.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/exploration_techniques/tracer.py
Tracer._grab_concretization_results
def _grab_concretization_results(cls, state): """ Grabs the concretized result so we can add the constraint ourselves. """ # only grab ones that match the constrained addrs if cls._should_add_constraints(state): addr = state.inspect.address_concretization_expr ...
python
def _grab_concretization_results(cls, state): """ Grabs the concretized result so we can add the constraint ourselves. """ # only grab ones that match the constrained addrs if cls._should_add_constraints(state): addr = state.inspect.address_concretization_expr ...
[ "def", "_grab_concretization_results", "(", "cls", ",", "state", ")", ":", "# only grab ones that match the constrained addrs", "if", "cls", ".", "_should_add_constraints", "(", "state", ")", ":", "addr", "=", "state", ".", "inspect", ".", "address_concretization_expr",...
Grabs the concretized result so we can add the constraint ourselves.
[ "Grabs", "the", "concretized", "result", "so", "we", "can", "add", "the", "constraint", "ourselves", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/exploration_techniques/tracer.py#L459-L470
train
Grabs the concretized result so we can add the constraint ourselves.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/exploration_techniques/tracer.py
Tracer._should_add_constraints
def _should_add_constraints(cls, state): """ Check to see if the current address concretization variable is any of the registered constrained_addrs we want to allow concretization for """ expr = state.inspect.address_concretization_expr hit_indices = cls._to_indices(state...
python
def _should_add_constraints(cls, state): """ Check to see if the current address concretization variable is any of the registered constrained_addrs we want to allow concretization for """ expr = state.inspect.address_concretization_expr hit_indices = cls._to_indices(state...
[ "def", "_should_add_constraints", "(", "cls", ",", "state", ")", ":", "expr", "=", "state", ".", "inspect", ".", "address_concretization_expr", "hit_indices", "=", "cls", ".", "_to_indices", "(", "state", ",", "expr", ")", "for", "action", "in", "state", "."...
Check to see if the current address concretization variable is any of the registered constrained_addrs we want to allow concretization for
[ "Check", "to", "see", "if", "the", "current", "address", "concretization", "variable", "is", "any", "of", "the", "registered", "constrained_addrs", "we", "want", "to", "allow", "concretization", "for" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/exploration_techniques/tracer.py#L482-L494
train
Check to see if the current concretization variable is any of the constrained_addrs we want to allow concretization for
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/heap/heap_brk.py
SimHeapBrk.allocate
def allocate(self, sim_size): """ The actual allocation primitive for this heap implementation. Increases the position of the break to allocate space. Has no guards against the heap growing too large. :param sim_size: a size specifying how much to increase the break pointer by :...
python
def allocate(self, sim_size): """ The actual allocation primitive for this heap implementation. Increases the position of the break to allocate space. Has no guards against the heap growing too large. :param sim_size: a size specifying how much to increase the break pointer by :...
[ "def", "allocate", "(", "self", ",", "sim_size", ")", ":", "size", "=", "self", ".", "_conc_alloc_size", "(", "sim_size", ")", "addr", "=", "self", ".", "state", ".", "heap", ".", "heap_location", "self", ".", "state", ".", "heap", ".", "heap_location", ...
The actual allocation primitive for this heap implementation. Increases the position of the break to allocate space. Has no guards against the heap growing too large. :param sim_size: a size specifying how much to increase the break pointer by :returns: a pointer to the previous break position,...
[ "The", "actual", "allocation", "primitive", "for", "this", "heap", "implementation", ".", "Increases", "the", "position", "of", "the", "break", "to", "allocate", "space", ".", "Has", "no", "guards", "against", "the", "heap", "growing", "too", "large", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/heap/heap_brk.py#L31-L43
train
Allocates memory for the current heap entry.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/heap/heap_brk.py
SimHeapBrk.release
def release(self, sim_size): """ The memory release primitive for this heap implementation. Decreases the position of the break to deallocate space. Guards against releasing beyond the initial heap base. :param sim_size: a size specifying how much to decrease the break pointer by (may b...
python
def release(self, sim_size): """ The memory release primitive for this heap implementation. Decreases the position of the break to deallocate space. Guards against releasing beyond the initial heap base. :param sim_size: a size specifying how much to decrease the break pointer by (may b...
[ "def", "release", "(", "self", ",", "sim_size", ")", ":", "requested", "=", "self", ".", "_conc_alloc_size", "(", "sim_size", ")", "used", "=", "self", ".", "heap_location", "-", "self", ".", "heap_base", "released", "=", "requested", "if", "requested", "<...
The memory release primitive for this heap implementation. Decreases the position of the break to deallocate space. Guards against releasing beyond the initial heap base. :param sim_size: a size specifying how much to decrease the break pointer by (may be symbolic or not)
[ "The", "memory", "release", "primitive", "for", "this", "heap", "implementation", ".", "Decreases", "the", "position", "of", "the", "break", "to", "deallocate", "space", ".", "Guards", "against", "releasing", "beyond", "the", "initial", "heap", "base", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/heap/heap_brk.py#L45-L56
train
This is the memory release primitive for this heap implementation.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/utils/library.py
get_function_name
def get_function_name(s): """ Get the function name from a C-style function declaration string. :param str s: A C-style function declaration string. :return: The function name. :rtype: str """ s = s.strip() if s.startswith("__attribute__"): # Remove "__attribute__ ((...
python
def get_function_name(s): """ Get the function name from a C-style function declaration string. :param str s: A C-style function declaration string. :return: The function name. :rtype: str """ s = s.strip() if s.startswith("__attribute__"): # Remove "__attribute__ ((...
[ "def", "get_function_name", "(", "s", ")", ":", "s", "=", "s", ".", "strip", "(", ")", "if", "s", ".", "startswith", "(", "\"__attribute__\"", ")", ":", "# Remove \"__attribute__ ((foobar))\"", "if", "\"))\"", "not", "in", "s", ":", "raise", "ValueError", ...
Get the function name from a C-style function declaration string. :param str s: A C-style function declaration string. :return: The function name. :rtype: str
[ "Get", "the", "function", "name", "from", "a", "C", "-", "style", "function", "declaration", "string", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/utils/library.py#L5-L36
train
Get the function name from a C - style function declaration string.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/utils/library.py
convert_cproto_to_py
def convert_cproto_to_py(c_decl): """ Convert a C-style function declaration string to its corresponding SimTypes-based Python representation. :param str c_decl: The C-style function declaration string. :return: A tuple of the function name, the prototype, and a stri...
python
def convert_cproto_to_py(c_decl): """ Convert a C-style function declaration string to its corresponding SimTypes-based Python representation. :param str c_decl: The C-style function declaration string. :return: A tuple of the function name, the prototype, and a stri...
[ "def", "convert_cproto_to_py", "(", "c_decl", ")", ":", "s", "=", "[", "]", "try", ":", "s", ".", "append", "(", "'# %s'", "%", "c_decl", ")", "# comment string", "parsed", "=", "parse_file", "(", "c_decl", ")", "parsed_decl", "=", "parsed", "[", "0", ...
Convert a C-style function declaration string to its corresponding SimTypes-based Python representation. :param str c_decl: The C-style function declaration string. :return: A tuple of the function name, the prototype, and a string representing the ...
[ "Convert", "a", "C", "-", "style", "function", "declaration", "string", "to", "its", "corresponding", "SimTypes", "-", "based", "Python", "representation", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/utils/library.py#L39-L73
train
Converts a C - style function declaration string to its corresponding SimTypes - based Python representation.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/heap/heap_ptmalloc.py
PTChunk.set_size
def set_size(self, size, is_free=None): #pylint:disable=arguments-differ """ Use this to set the size on a chunk. When the chunk is new (such as when a free chunk is shrunk to form an allocated chunk and a remainder free chunk) it is recommended that the is_free hint be used since setting the ...
python
def set_size(self, size, is_free=None): #pylint:disable=arguments-differ """ Use this to set the size on a chunk. When the chunk is new (such as when a free chunk is shrunk to form an allocated chunk and a remainder free chunk) it is recommended that the is_free hint be used since setting the ...
[ "def", "set_size", "(", "self", ",", "size", ",", "is_free", "=", "None", ")", ":", "#pylint:disable=arguments-differ", "self", ".", "_set_leading_size", "(", "size", ")", "next_chunk", "=", "self", ".", "next_chunk", "(", ")", "if", "is_free", "is", "not", ...
Use this to set the size on a chunk. When the chunk is new (such as when a free chunk is shrunk to form an allocated chunk and a remainder free chunk) it is recommended that the is_free hint be used since setting the size depends on the chunk's freeness, and vice versa. :param size: size of the...
[ "Use", "this", "to", "set", "the", "size", "on", "a", "chunk", ".", "When", "the", "chunk", "is", "new", "(", "such", "as", "when", "a", "free", "chunk", "is", "shrunk", "to", "form", "an", "allocated", "chunk", "and", "a", "remainder", "free", "chun...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/heap/heap_ptmalloc.py#L64-L82
train
Set the size of the an arbitrary number of entries in the cache.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/heap/heap_ptmalloc.py
PTChunk.set_prev_freeness
def set_prev_freeness(self, is_free): """ Sets (or unsets) the flag controlling whether the previous chunk is free. :param is_free: if True, sets the previous chunk to be free; if False, sets it to be allocated """ level = silence_logger() size_field = self.state.memory....
python
def set_prev_freeness(self, is_free): """ Sets (or unsets) the flag controlling whether the previous chunk is free. :param is_free: if True, sets the previous chunk to be free; if False, sets it to be allocated """ level = silence_logger() size_field = self.state.memory....
[ "def", "set_prev_freeness", "(", "self", ",", "is_free", ")", ":", "level", "=", "silence_logger", "(", ")", "size_field", "=", "self", ".", "state", ".", "memory", ".", "load", "(", "self", ".", "base", "+", "self", ".", "_chunk_size_t_size", ",", "self...
Sets (or unsets) the flag controlling whether the previous chunk is free. :param is_free: if True, sets the previous chunk to be free; if False, sets it to be allocated
[ "Sets", "(", "or", "unsets", ")", "the", "flag", "controlling", "whether", "the", "previous", "chunk", "is", "free", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/heap/heap_ptmalloc.py#L84-L96
train
Sets the flag controlling whether the previous chunk is free.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/heap/heap_ptmalloc.py
PTChunk.is_prev_free
def is_prev_free(self): """ Returns a concrete state of the flag indicating whether the previous chunk is free or not. Issues a warning if that flag is symbolic and has multiple solutions, and then assumes that the previous chunk is free. :returns: True if the previous chunk is free; Fa...
python
def is_prev_free(self): """ Returns a concrete state of the flag indicating whether the previous chunk is free or not. Issues a warning if that flag is symbolic and has multiple solutions, and then assumes that the previous chunk is free. :returns: True if the previous chunk is free; Fa...
[ "def", "is_prev_free", "(", "self", ")", ":", "flag", "=", "self", ".", "state", ".", "memory", ".", "load", "(", "self", ".", "base", "+", "self", ".", "_chunk_size_t_size", ",", "self", ".", "_chunk_size_t_size", ")", "&", "CHUNK_P_MASK", "def", "sym_f...
Returns a concrete state of the flag indicating whether the previous chunk is free or not. Issues a warning if that flag is symbolic and has multiple solutions, and then assumes that the previous chunk is free. :returns: True if the previous chunk is free; False otherwise
[ "Returns", "a", "concrete", "state", "of", "the", "flag", "indicating", "whether", "the", "previous", "chunk", "is", "free", "or", "not", ".", "Issues", "a", "warning", "if", "that", "flag", "is", "symbolic", "and", "has", "multiple", "solutions", "and", "...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/heap/heap_ptmalloc.py#L98-L112
train
Returns a concrete state of the flag indicating whether the previous chunk is free.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/heap/heap_ptmalloc.py
PTChunk.prev_size
def prev_size(self): """ Returns the size of the previous chunk, masking off what would be the flag bits if it were in the actual size field. Performs NO CHECKING to determine whether the previous chunk size is valid (for example, when the previous chunk is not free, its size cannot be d...
python
def prev_size(self): """ Returns the size of the previous chunk, masking off what would be the flag bits if it were in the actual size field. Performs NO CHECKING to determine whether the previous chunk size is valid (for example, when the previous chunk is not free, its size cannot be d...
[ "def", "prev_size", "(", "self", ")", ":", "return", "self", ".", "state", ".", "memory", ".", "load", "(", "self", ".", "base", ",", "self", ".", "_chunk_size_t_size", ")", "&", "~", "CHUNK_FLAGS_MASK" ]
Returns the size of the previous chunk, masking off what would be the flag bits if it were in the actual size field. Performs NO CHECKING to determine whether the previous chunk size is valid (for example, when the previous chunk is not free, its size cannot be determined).
[ "Returns", "the", "size", "of", "the", "previous", "chunk", "masking", "off", "what", "would", "be", "the", "flag", "bits", "if", "it", "were", "in", "the", "actual", "size", "field", ".", "Performs", "NO", "CHECKING", "to", "determine", "whether", "the", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/heap/heap_ptmalloc.py#L114-L120
train
Returns the size of the previous chunk.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/heap/heap_ptmalloc.py
PTChunk.next_chunk
def next_chunk(self): """ Returns the chunk immediately following (and adjacent to) this one, if it exists. :returns: The following chunk, or None if applicable """ def sym_base_handler(base): l.warning("A computed chunk base is symbolic; maximizing it") ...
python
def next_chunk(self): """ Returns the chunk immediately following (and adjacent to) this one, if it exists. :returns: The following chunk, or None if applicable """ def sym_base_handler(base): l.warning("A computed chunk base is symbolic; maximizing it") ...
[ "def", "next_chunk", "(", "self", ")", ":", "def", "sym_base_handler", "(", "base", ")", ":", "l", ".", "warning", "(", "\"A computed chunk base is symbolic; maximizing it\"", ")", "return", "self", ".", "state", ".", "solver", ".", "max_int", "(", "base", ")"...
Returns the chunk immediately following (and adjacent to) this one, if it exists. :returns: The following chunk, or None if applicable
[ "Returns", "the", "chunk", "immediately", "following", "(", "and", "adjacent", "to", ")", "this", "one", "if", "it", "exists", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/heap/heap_ptmalloc.py#L143-L158
train
Returns the next chunk in the PT.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/heap/heap_ptmalloc.py
PTChunk.prev_chunk
def prev_chunk(self): """ Returns the chunk immediately prior (and adjacent) to this one, if that chunk is free. If the prior chunk is not free, then its base cannot be located and this method raises an error. :returns: If possible, the previous chunk; otherwise, raises an error ...
python
def prev_chunk(self): """ Returns the chunk immediately prior (and adjacent) to this one, if that chunk is free. If the prior chunk is not free, then its base cannot be located and this method raises an error. :returns: If possible, the previous chunk; otherwise, raises an error ...
[ "def", "prev_chunk", "(", "self", ")", ":", "if", "self", ".", "is_prev_free", "(", ")", ":", "return", "PTChunk", "(", "self", ".", "base", "-", "self", ".", "prev_size", "(", ")", ",", "self", ".", "state", ")", "else", ":", "raise", "SimHeapError"...
Returns the chunk immediately prior (and adjacent) to this one, if that chunk is free. If the prior chunk is not free, then its base cannot be located and this method raises an error. :returns: If possible, the previous chunk; otherwise, raises an error
[ "Returns", "the", "chunk", "immediately", "prior", "(", "and", "adjacent", ")", "to", "this", "one", "if", "that", "chunk", "is", "free", ".", "If", "the", "prior", "chunk", "is", "not", "free", "then", "its", "base", "cannot", "be", "located", "and", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/heap/heap_ptmalloc.py#L160-L170
train
Returns the chunk immediately prior to this one.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/heap/heap_ptmalloc.py
PTChunk.fwd_chunk
def fwd_chunk(self): """ Returns the chunk following this chunk in the list of free chunks. If this chunk is not free, then it resides in no such list and this method raises an error. :returns: If possible, the forward chunk; otherwise, raises an error """ if self.is_fre...
python
def fwd_chunk(self): """ Returns the chunk following this chunk in the list of free chunks. If this chunk is not free, then it resides in no such list and this method raises an error. :returns: If possible, the forward chunk; otherwise, raises an error """ if self.is_fre...
[ "def", "fwd_chunk", "(", "self", ")", ":", "if", "self", ".", "is_free", "(", ")", ":", "base", "=", "self", ".", "state", ".", "memory", ".", "load", "(", "self", ".", "base", "+", "2", "*", "self", ".", "_chunk_size_t_size", ",", "self", ".", "...
Returns the chunk following this chunk in the list of free chunks. If this chunk is not free, then it resides in no such list and this method raises an error. :returns: If possible, the forward chunk; otherwise, raises an error
[ "Returns", "the", "chunk", "following", "this", "chunk", "in", "the", "list", "of", "free", "chunks", ".", "If", "this", "chunk", "is", "not", "free", "then", "it", "resides", "in", "no", "such", "list", "and", "this", "method", "raises", "an", "error", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/heap/heap_ptmalloc.py#L172-L183
train
Returns the chunk following this chunk in the list of free chunks.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/heap/heap_ptmalloc.py
SimHeapPTMalloc.chunk_from_mem
def chunk_from_mem(self, ptr): """ Given a pointer to a user payload, return the base of the chunk associated with that payload (i.e. the chunk pointer). Returns None if ptr is null. :param ptr: a pointer to the base of a user payload in the heap :returns: a pointer to the base ...
python
def chunk_from_mem(self, ptr): """ Given a pointer to a user payload, return the base of the chunk associated with that payload (i.e. the chunk pointer). Returns None if ptr is null. :param ptr: a pointer to the base of a user payload in the heap :returns: a pointer to the base ...
[ "def", "chunk_from_mem", "(", "self", ",", "ptr", ")", ":", "if", "self", ".", "state", ".", "solver", ".", "symbolic", "(", "ptr", ")", ":", "try", ":", "ptr", "=", "self", ".", "state", ".", "solver", ".", "eval_one", "(", "ptr", ")", "except", ...
Given a pointer to a user payload, return the base of the chunk associated with that payload (i.e. the chunk pointer). Returns None if ptr is null. :param ptr: a pointer to the base of a user payload in the heap :returns: a pointer to the base of the associated heap chunk, or None if ptr is nul...
[ "Given", "a", "pointer", "to", "a", "user", "payload", "return", "the", "base", "of", "the", "chunk", "associated", "with", "that", "payload", "(", "i", ".", "e", ".", "the", "chunk", "pointer", ")", ".", "Returns", "None", "if", "ptr", "is", "null", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/heap/heap_ptmalloc.py#L263-L279
train
Given a pointer to a user payload return the base of the chunk associated with that payload. Returns None if the user payload is null.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/heap/heap_ptmalloc.py
SimHeapPTMalloc._find_bck
def _find_bck(self, chunk): """ Simply finds the free chunk that would be the backwards chunk relative to the chunk at ptr. Hence, the free head and all other metadata are unaltered by this function. """ cur = self.free_head_chunk if cur is None: return None ...
python
def _find_bck(self, chunk): """ Simply finds the free chunk that would be the backwards chunk relative to the chunk at ptr. Hence, the free head and all other metadata are unaltered by this function. """ cur = self.free_head_chunk if cur is None: return None ...
[ "def", "_find_bck", "(", "self", ",", "chunk", ")", ":", "cur", "=", "self", ".", "free_head_chunk", "if", "cur", "is", "None", ":", "return", "None", "fwd", "=", "cur", ".", "fwd_chunk", "(", ")", "if", "cur", "==", "fwd", ":", "return", "cur", "#...
Simply finds the free chunk that would be the backwards chunk relative to the chunk at ptr. Hence, the free head and all other metadata are unaltered by this function.
[ "Simply", "finds", "the", "free", "chunk", "that", "would", "be", "the", "backwards", "chunk", "relative", "to", "the", "chunk", "at", "ptr", ".", "Hence", "the", "free", "head", "and", "all", "other", "metadata", "are", "unaltered", "by", "this", "functio...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/heap/heap_ptmalloc.py#L281-L302
train
Find the free chunk that would be the backwards chunk relative to the chunk at ptr.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/heap/heap_ptmalloc.py
SimHeapPTMalloc._set_final_freeness
def _set_final_freeness(self, flag): """ Sets the freedom of the final chunk. Since no proper chunk follows the final chunk, the heap itself manages this. Nonetheless, for now it is implemented as if an additional chunk followed the final chunk. """ if flag: self.stat...
python
def _set_final_freeness(self, flag): """ Sets the freedom of the final chunk. Since no proper chunk follows the final chunk, the heap itself manages this. Nonetheless, for now it is implemented as if an additional chunk followed the final chunk. """ if flag: self.stat...
[ "def", "_set_final_freeness", "(", "self", ",", "flag", ")", ":", "if", "flag", ":", "self", ".", "state", ".", "memory", ".", "store", "(", "self", ".", "heap_base", "+", "self", ".", "heap_size", "-", "self", ".", "_chunk_size_t_size", ",", "~", "CHU...
Sets the freedom of the final chunk. Since no proper chunk follows the final chunk, the heap itself manages this. Nonetheless, for now it is implemented as if an additional chunk followed the final chunk.
[ "Sets", "the", "freedom", "of", "the", "final", "chunk", ".", "Since", "no", "proper", "chunk", "follows", "the", "final", "chunk", "the", "heap", "itself", "manages", "this", ".", "Nonetheless", "for", "now", "it", "is", "implemented", "as", "if", "an", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/heap/heap_ptmalloc.py#L304-L312
train
Sets the freedom of the final chunk.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/heap/heap_ptmalloc.py
SimHeapPTMalloc._make_chunk_size
def _make_chunk_size(self, req_size): """ Takes an allocation size as requested by the user and modifies it to be a suitable chunk size. """ size = req_size size += 2 * self._chunk_size_t_size # Two size fields size = self._chunk_min_size if size < self._chunk_min_size e...
python
def _make_chunk_size(self, req_size): """ Takes an allocation size as requested by the user and modifies it to be a suitable chunk size. """ size = req_size size += 2 * self._chunk_size_t_size # Two size fields size = self._chunk_min_size if size < self._chunk_min_size e...
[ "def", "_make_chunk_size", "(", "self", ",", "req_size", ")", ":", "size", "=", "req_size", "size", "+=", "2", "*", "self", ".", "_chunk_size_t_size", "# Two size fields", "size", "=", "self", ".", "_chunk_min_size", "if", "size", "<", "self", ".", "_chunk_m...
Takes an allocation size as requested by the user and modifies it to be a suitable chunk size.
[ "Takes", "an", "allocation", "size", "as", "requested", "by", "the", "user", "and", "modifies", "it", "to", "be", "a", "suitable", "chunk", "size", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/heap/heap_ptmalloc.py#L314-L323
train
Makes a suitable chunk size for the given allocation size.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/engines/soot/values/strref.py
SimSootValue_StringRef.new_string
def new_string(state, value): """ Allocate and initialize a new string in the context of the state passed. The method returns the reference to the newly allocated string :param state: angr state where we want to allocate the string :type SimState :param value: value of ...
python
def new_string(state, value): """ Allocate and initialize a new string in the context of the state passed. The method returns the reference to the newly allocated string :param state: angr state where we want to allocate the string :type SimState :param value: value of ...
[ "def", "new_string", "(", "state", ",", "value", ")", ":", "str_ref", "=", "SimSootValue_StringRef", "(", "state", ".", "memory", ".", "get_new_uuid", "(", ")", ")", "state", ".", "memory", ".", "store", "(", "str_ref", ",", "value", ")", "return", "str_...
Allocate and initialize a new string in the context of the state passed. The method returns the reference to the newly allocated string :param state: angr state where we want to allocate the string :type SimState :param value: value of the string to initialize :type claripy.Str...
[ "Allocate", "and", "initialize", "a", "new", "string", "in", "the", "context", "of", "the", "state", "passed", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/soot/values/strref.py#L26-L41
train
Allocate and initialize a new string in the context of the state passed.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/procedures/libc/strtol.py
strtol.strtol_inner
def strtol_inner(s, state, region, base, signed, read_length=None): """ :param s: the string address/offset :param state: SimState :param region: memory, file, etc :param base: the base to use to interpret the number note: all numbers may start with +/- and base 16 may st...
python
def strtol_inner(s, state, region, base, signed, read_length=None): """ :param s: the string address/offset :param state: SimState :param region: memory, file, etc :param base: the base to use to interpret the number note: all numbers may start with +/- and base 16 may st...
[ "def", "strtol_inner", "(", "s", ",", "state", ",", "region", ",", "base", ",", "signed", ",", "read_length", "=", "None", ")", ":", "# sanity check", "if", "base", "<", "2", "or", "base", ">", "36", ":", "raise", "SimProcedureError", "(", "\"base should...
:param s: the string address/offset :param state: SimState :param region: memory, file, etc :param base: the base to use to interpret the number note: all numbers may start with +/- and base 16 may start with 0x :param signed: boolean, true means the result will be signed, otherw...
[ ":", "param", "s", ":", "the", "string", "address", "/", "offset", ":", "param", "state", ":", "SimState", ":", "param", "region", ":", "memory", "file", "etc", ":", "param", "base", ":", "the", "base", "to", "use", "to", "interpret", "the", "number", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/libc/strtol.py#L15-L55
train
Internal function to parse a string in the specified region.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/procedures/libc/strtol.py
strtol._load_num_with_prefix
def _load_num_with_prefix(prefix, addr, region, state, base, signed, read_length=None): """ loads a number from addr, and returns a condition that addr must start with the prefix """ length = len(prefix) read_length = (read_length-length) if read_length else None conditio...
python
def _load_num_with_prefix(prefix, addr, region, state, base, signed, read_length=None): """ loads a number from addr, and returns a condition that addr must start with the prefix """ length = len(prefix) read_length = (read_length-length) if read_length else None conditio...
[ "def", "_load_num_with_prefix", "(", "prefix", ",", "addr", ",", "region", ",", "state", ",", "base", ",", "signed", ",", "read_length", "=", "None", ")", ":", "length", "=", "len", "(", "prefix", ")", "read_length", "=", "(", "read_length", "-", "length...
loads a number from addr, and returns a condition that addr must start with the prefix
[ "loads", "a", "number", "from", "addr", "and", "returns", "a", "condition", "that", "addr", "must", "start", "with", "the", "prefix" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/libc/strtol.py#L58-L75
train
Loads a number from addr and returns a condition that the prefix matches the current base.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/procedures/libc/strtol.py
strtol._string_to_int
def _string_to_int(s, state, region, base, signed, read_length=None): """ reads values from s and generates the symbolic number that it would equal the first char is either a number in the given base, or the result is 0 expression indicates whether or not it was successful """ ...
python
def _string_to_int(s, state, region, base, signed, read_length=None): """ reads values from s and generates the symbolic number that it would equal the first char is either a number in the given base, or the result is 0 expression indicates whether or not it was successful """ ...
[ "def", "_string_to_int", "(", "s", ",", "state", ",", "region", ",", "base", ",", "signed", ",", "read_length", "=", "None", ")", ":", "# if length wasn't provided, read the maximum bytes", "length", "=", "state", ".", "libc", ".", "max_strtol_len", "if", "read_...
reads values from s and generates the symbolic number that it would equal the first char is either a number in the given base, or the result is 0 expression indicates whether or not it was successful
[ "reads", "values", "from", "s", "and", "generates", "the", "symbolic", "number", "that", "it", "would", "equal", "the", "first", "char", "is", "either", "a", "number", "in", "the", "given", "base", "or", "the", "result", "is", "0", "expression", "indicates...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/libc/strtol.py#L78-L149
train
Reads a string and generates a symbolic number that is equal to the value of the current entry in the given region.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/procedures/libc/strtol.py
strtol._char_to_val
def _char_to_val(char, base): """ converts a symbolic char to a number in the given base returns expression, result expression is a symbolic boolean indicating whether or not it was a valid number result is the value """ cases = [] # 0-9 max_digit ...
python
def _char_to_val(char, base): """ converts a symbolic char to a number in the given base returns expression, result expression is a symbolic boolean indicating whether or not it was a valid number result is the value """ cases = [] # 0-9 max_digit ...
[ "def", "_char_to_val", "(", "char", ",", "base", ")", ":", "cases", "=", "[", "]", "# 0-9", "max_digit", "=", "claripy", ".", "BVV", "(", "b\"9\"", ")", "min_digit", "=", "claripy", ".", "BVV", "(", "b\"0\"", ")", "if", "base", "<", "10", ":", "max...
converts a symbolic char to a number in the given base returns expression, result expression is a symbolic boolean indicating whether or not it was a valid number result is the value
[ "converts", "a", "symbolic", "char", "to", "a", "number", "in", "the", "given", "base", "returns", "expression", "result", "expression", "is", "a", "symbolic", "boolean", "indicating", "whether", "or", "not", "it", "was", "a", "valid", "number", "result", "i...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/libc/strtol.py#L152-L186
train
Convert a symbolic char to a number in the given base.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/procedures/stubs/format_parser.py
FormatString.replace
def replace(self, startpos, args): """ Implement printf - based on the stored format specifier information, format the values from the arg getter function `args` into a string. :param startpos: The index of the first argument to be used by the first element of the format string :...
python
def replace(self, startpos, args): """ Implement printf - based on the stored format specifier information, format the values from the arg getter function `args` into a string. :param startpos: The index of the first argument to be used by the first element of the format string :...
[ "def", "replace", "(", "self", ",", "startpos", ",", "args", ")", ":", "argpos", "=", "startpos", "string", "=", "None", "for", "component", "in", "self", ".", "components", ":", "# if this is just concrete data", "if", "isinstance", "(", "component", ",", "...
Implement printf - based on the stored format specifier information, format the values from the arg getter function `args` into a string. :param startpos: The index of the first argument to be used by the first element of the format string :param args: A function which, given an argum...
[ "Implement", "printf", "-", "based", "on", "the", "stored", "format", "specifier", "information", "format", "the", "values", "from", "the", "arg", "getter", "function", "args", "into", "a", "string", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/stubs/format_parser.py#L54-L113
train
Implement printf - based on the stored format specifier information.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/procedures/stubs/format_parser.py
FormatString.interpret
def interpret(self, startpos, args, addr=None, simfd=None): """ implement scanf - extract formatted data from memory or a file according to the stored format specifiers and store them into the pointers extracted from `args`. :param startpos: The index of the first argument correspond...
python
def interpret(self, startpos, args, addr=None, simfd=None): """ implement scanf - extract formatted data from memory or a file according to the stored format specifiers and store them into the pointers extracted from `args`. :param startpos: The index of the first argument correspond...
[ "def", "interpret", "(", "self", ",", "startpos", ",", "args", ",", "addr", "=", "None", ",", "simfd", "=", "None", ")", ":", "if", "simfd", "is", "not", "None", "and", "isinstance", "(", "simfd", ".", "read_storage", ",", "SimPackets", ")", ":", "ar...
implement scanf - extract formatted data from memory or a file according to the stored format specifiers and store them into the pointers extracted from `args`. :param startpos: The index of the first argument corresponding to the first format element :param args: A function which, gi...
[ "implement", "scanf", "-", "extract", "formatted", "data", "from", "memory", "or", "a", "file", "according", "to", "the", "stored", "format", "specifiers", "and", "store", "them", "into", "the", "pointers", "extracted", "from", "args", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/stubs/format_parser.py#L115-L298
train
Interpret the format of the format element in memory or a file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/procedures/stubs/format_parser.py
FormatParser._mod_spec
def _mod_spec(self): """ Modified length specifiers: mapping between length modifiers and conversion specifiers. This generates all the possibilities, i.e. hhd, etc. """ mod_spec={} for mod, sizes in self.int_len_mod.items(): for conv in self.int_sign['signe...
python
def _mod_spec(self): """ Modified length specifiers: mapping between length modifiers and conversion specifiers. This generates all the possibilities, i.e. hhd, etc. """ mod_spec={} for mod, sizes in self.int_len_mod.items(): for conv in self.int_sign['signe...
[ "def", "_mod_spec", "(", "self", ")", ":", "mod_spec", "=", "{", "}", "for", "mod", ",", "sizes", "in", "self", ".", "int_len_mod", ".", "items", "(", ")", ":", "for", "conv", "in", "self", ".", "int_sign", "[", "'signed'", "]", ":", "mod_spec", "[...
Modified length specifiers: mapping between length modifiers and conversion specifiers. This generates all the possibilities, i.e. hhd, etc.
[ "Modified", "length", "specifiers", ":", "mapping", "between", "length", "modifiers", "and", "conversion", "specifiers", ".", "This", "generates", "all", "the", "possibilities", "i", ".", "e", ".", "hhd", "etc", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/stubs/format_parser.py#L396-L411
train
Returns a dictionary of modified length modifiers and conversion specifiers.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/procedures/stubs/format_parser.py
FormatParser._all_spec
def _all_spec(self): """ All specifiers and their lengths. """ base = self._mod_spec for spec in self.basic_spec: base[spec] = self.basic_spec[spec] return base
python
def _all_spec(self): """ All specifiers and their lengths. """ base = self._mod_spec for spec in self.basic_spec: base[spec] = self.basic_spec[spec] return base
[ "def", "_all_spec", "(", "self", ")", ":", "base", "=", "self", ".", "_mod_spec", "for", "spec", "in", "self", ".", "basic_spec", ":", "base", "[", "spec", "]", "=", "self", ".", "basic_spec", "[", "spec", "]", "return", "base" ]
All specifiers and their lengths.
[ "All", "specifiers", "and", "their", "lengths", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/stubs/format_parser.py#L414-L424
train
Return a dictionary of all the specifiers and their lengths.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/procedures/stubs/format_parser.py
FormatParser._match_spec
def _match_spec(self, nugget): """ match the string `nugget` to a format specifier. """ # TODO: handle positional modifiers and other similar format string tricks. all_spec = self._all_spec # iterate through nugget throwing away anything which is an int # TODO st...
python
def _match_spec(self, nugget): """ match the string `nugget` to a format specifier. """ # TODO: handle positional modifiers and other similar format string tricks. all_spec = self._all_spec # iterate through nugget throwing away anything which is an int # TODO st...
[ "def", "_match_spec", "(", "self", ",", "nugget", ")", ":", "# TODO: handle positional modifiers and other similar format string tricks.", "all_spec", "=", "self", ".", "_all_spec", "# iterate through nugget throwing away anything which is an int", "# TODO store this in a size variable...
match the string `nugget` to a format specifier.
[ "match", "the", "string", "nugget", "to", "a", "format", "specifier", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/stubs/format_parser.py#L429-L475
train
Match the string nugget to a format specifier.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/procedures/stubs/format_parser.py
FormatParser._get_fmt
def _get_fmt(self, fmt): """ Extract the actual formats from the format string `fmt`. :param list fmt: A list of format chars. :returns: a FormatString object """ # iterate over the format string looking for format specifiers components = [ ] i = 0 ...
python
def _get_fmt(self, fmt): """ Extract the actual formats from the format string `fmt`. :param list fmt: A list of format chars. :returns: a FormatString object """ # iterate over the format string looking for format specifiers components = [ ] i = 0 ...
[ "def", "_get_fmt", "(", "self", ",", "fmt", ")", ":", "# iterate over the format string looking for format specifiers", "components", "=", "[", "]", "i", "=", "0", "while", "i", "<", "len", "(", "fmt", ")", ":", "if", "type", "(", "fmt", "[", "i", "]", "...
Extract the actual formats from the format string `fmt`. :param list fmt: A list of format chars. :returns: a FormatString object
[ "Extract", "the", "actual", "formats", "from", "the", "format", "string", "fmt", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/stubs/format_parser.py#L477-L515
train
Extract the actual formats from the format string fmt.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/procedures/stubs/format_parser.py
FormatParser._parse
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 ...
python
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", ")", ":", "fmtstr_ptr", "=", "self", ".", "arg", "(", "fmt_idx", ")", "if", "self", ".", "state", ".", "solver", ".", "symbolic", "(", "fmtstr_ptr", ")", ":", "raise", "SimProcedureError", "(", "\"Symbolic po...
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.
[ "Parse", "format", "strings", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/stubs/format_parser.py#L539-L582
train
Parse a format string.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/unicorn_engine.py
Unicorn._process_value
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...
python
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", ")", ":", "if", "len", "(", "d", ".", "annotations", ")", ":", "l", ".", "debug", "(", "\"Blocking annotated AST.\"", ")", "return", "None", "elif", "not", "d", ".", "symbolic", ":", "r...
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
[ "Pre", "-", "process", "an", "AST", "for", "insertion", "into", "unicorn", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/unicorn_engine.py#L657-L684
train
Pre - process an AST for insertion into Unicorn.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/unicorn_engine.py
Unicorn._hook_mem_unmapped
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...
python
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", "# FIXME check angr hooks at `address`", "if", "size_ext...
This callback is called when unicorn needs to access data that's not yet present in memory.
[ "This", "callback", "is", "called", "when", "unicorn", "needs", "to", "access", "data", "that", "s", "not", "yet", "present", "in", "memory", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/unicorn_engine.py#L686-L758
train
Internal hook for unicorn s mem_unmapped method.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/unicorn_engine.py
Unicorn.set_regs
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_...
python
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", ")", ":", "uc", "=", "self", ".", "uc", "if", "self", ".", "state", ".", "arch", ".", "qemu_name", "==", "'x86_64'", ":", "fs", "=", "self", ".", "state", ".", "solver", ".", "eval", "(", "self", ".", "state", ".",...
setting unicorn registers
[ "setting", "unicorn", "registers" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/unicorn_engine.py#L1079-L1163
train
set the unicorn registers
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/unicorn_engine.py
Unicorn.get_regs
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...
python
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", ")", ":", "# 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",...
loading registers from unicorn
[ "loading", "registers", "from", "unicorn" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/unicorn_engine.py#L1215-L1316
train
load the unicorn registers into the state. regs attribute
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/unicorn_engine.py
Unicorn._check_registers
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...
python
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", ")", ":", "for", "r", "in", "self", ".", "state", ".", "arch", ".", "uc_regs", ".", "keys", "(", ")", ":", "v", "=", "getattr", "(", "self", ".", "state", ".", "regs", ",", "r", ...
check if this state might be used in unicorn (has no concrete register)
[ "check", "if", "this", "state", "might", "be", "used", "in", "unicorn", "(", "has", "no", "concrete", "register", ")" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/unicorn_engine.py#L1318-L1339
train
check if this state might be used in unicorn
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...