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/engines/soot/values/thisref.py | SimSootValue_ThisRef.load_field | def load_field(self, state, field_name, field_type):
"""
Load a field of a given object, without resolving hierachy
:param state: angr state where we want to load the object attribute
:type SimState
:param field_name: name of the attribute
:type str
:param field_... | python | def load_field(self, state, field_name, field_type):
"""
Load a field of a given object, without resolving hierachy
:param state: angr state where we want to load the object attribute
:type SimState
:param field_name: name of the attribute
:type str
:param field_... | [
"def",
"load_field",
"(",
"self",
",",
"state",
",",
"field_name",
",",
"field_type",
")",
":",
"field_ref",
"=",
"SimSootValue_InstanceFieldRef",
"(",
"self",
".",
"heap_alloc_id",
",",
"self",
".",
"type",
",",
"field_name",
",",
"field_type",
")",
"return",... | Load a field of a given object, without resolving hierachy
:param state: angr state where we want to load the object attribute
:type SimState
:param field_name: name of the attribute
:type str
:param field_type: type of the attribute
:type str | [
"Load",
"a",
"field",
"of",
"a",
"given",
"object",
"without",
"resolving",
"hierachy"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/soot/values/thisref.py#L74-L86 | train | Load a field of a given 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/engines/soot/values/thisref.py | SimSootValue_ThisRef.new_object | def new_object(cls, state, type_, symbolic=False, init_object=False):
"""
Creates a new object reference.
:param state: State associated to the object.
:param type_: Class of the object.
:param init_object: Whether the objects initializer method should be run.
:return: Re... | python | def new_object(cls, state, type_, symbolic=False, init_object=False):
"""
Creates a new object reference.
:param state: State associated to the object.
:param type_: Class of the object.
:param init_object: Whether the objects initializer method should be run.
:return: Re... | [
"def",
"new_object",
"(",
"cls",
",",
"state",
",",
"type_",
",",
"symbolic",
"=",
"False",
",",
"init_object",
"=",
"False",
")",
":",
"# create reference",
"obj_ref",
"=",
"cls",
"(",
"heap_alloc_id",
"=",
"state",
".",
"memory",
".",
"get_new_uuid",
"("... | Creates a new object reference.
:param state: State associated to the object.
:param type_: Class of the object.
:param init_object: Whether the objects initializer method should be run.
:return: Reference to the new object. | [
"Creates",
"a",
"new",
"object",
"reference",
".",
":",
"param",
"state",
":",
"State",
"associated",
"to",
"the",
"object",
".",
":",
"param",
"type_",
":",
"Class",
"of",
"the",
"object",
".",
":",
"param",
"init_object",
":",
"Whether",
"the",
"object... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/soot/values/thisref.py#L94-L123 | train | Create a new object in the 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/simos/simos.py | SimOS.configure_project | def configure_project(self):
"""
Configure the project to set up global settings (like SimProcedures).
"""
self.return_deadend = self.project.loader.extern_object.allocate()
self.project.hook(self.return_deadend, P['stubs']['CallReturn']())
self.unresolvable_jump_target ... | python | def configure_project(self):
"""
Configure the project to set up global settings (like SimProcedures).
"""
self.return_deadend = self.project.loader.extern_object.allocate()
self.project.hook(self.return_deadend, P['stubs']['CallReturn']())
self.unresolvable_jump_target ... | [
"def",
"configure_project",
"(",
"self",
")",
":",
"self",
".",
"return_deadend",
"=",
"self",
".",
"project",
".",
"loader",
".",
"extern_object",
".",
"allocate",
"(",
")",
"self",
".",
"project",
".",
"hook",
"(",
"self",
".",
"return_deadend",
",",
"... | Configure the project to set up global settings (like SimProcedures). | [
"Configure",
"the",
"project",
"to",
"set",
"up",
"global",
"settings",
"(",
"like",
"SimProcedures",
")",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/simos/simos.py#L37-L75 | train | Configure the project to set up global settings. | 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/simos.py | SimOS.state_blank | def state_blank(self, addr=None, initial_prefix=None, brk=None, stack_end=None, stack_size=1024*1024*8, stdin=None, **kwargs):
"""
Initialize a blank state.
All parameters are optional.
:param addr: The execution start address.
:param initial_prefix:
:param s... | python | def state_blank(self, addr=None, initial_prefix=None, brk=None, stack_end=None, stack_size=1024*1024*8, stdin=None, **kwargs):
"""
Initialize a blank state.
All parameters are optional.
:param addr: The execution start address.
:param initial_prefix:
:param s... | [
"def",
"state_blank",
"(",
"self",
",",
"addr",
"=",
"None",
",",
"initial_prefix",
"=",
"None",
",",
"brk",
"=",
"None",
",",
"stack_end",
"=",
"None",
",",
"stack_size",
"=",
"1024",
"*",
"1024",
"*",
"8",
",",
"stdin",
"=",
"None",
",",
"*",
"*"... | Initialize a blank state.
All parameters are optional.
:param addr: The execution start address.
:param initial_prefix:
:param stack_end: The end of the stack (i.e., the byte after the last valid stack address).
:param stack_size: The number of bytes to al... | [
"Initialize",
"a",
"blank",
"state",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/simos/simos.py#L89-L190 | train | Initialize a blank 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/simos/simos.py | SimOS.prepare_call_state | def prepare_call_state(self, calling_state, initial_state=None,
preserve_registers=(), preserve_memory=()):
"""
This function prepares a state that is executing a call instruction.
If given an initial_state, it copies over all of the critical registers to it from the
... | python | def prepare_call_state(self, calling_state, initial_state=None,
preserve_registers=(), preserve_memory=()):
"""
This function prepares a state that is executing a call instruction.
If given an initial_state, it copies over all of the critical registers to it from the
... | [
"def",
"prepare_call_state",
"(",
"self",
",",
"calling_state",
",",
"initial_state",
"=",
"None",
",",
"preserve_registers",
"=",
"(",
")",
",",
"preserve_memory",
"=",
"(",
")",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"arch",
",",
"ArchMIPS32",
"... | This function prepares a state that is executing a call instruction.
If given an initial_state, it copies over all of the critical registers to it from the
calling_state. Otherwise, it prepares the calling_state for action.
This is mostly used to create minimalistic for CFG generation. Some ABI... | [
"This",
"function",
"prepares",
"a",
"state",
"that",
"is",
"executing",
"a",
"call",
"instruction",
".",
"If",
"given",
"an",
"initial_state",
"it",
"copies",
"over",
"all",
"of",
"the",
"critical",
"registers",
"to",
"it",
"from",
"the",
"calling_state",
"... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/simos/simos.py#L222-L249 | train | This function prepares a state that is executing a call instruction. | 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/simos.py | SimOS.prepare_function_symbol | def prepare_function_symbol(self, symbol_name, basic_addr=None):
"""
Prepare the address space with the data necessary to perform relocations pointing to the given symbol
Returns a 2-tuple. The first item is the address of the function code, the second is the address of the
relocation t... | python | def prepare_function_symbol(self, symbol_name, basic_addr=None):
"""
Prepare the address space with the data necessary to perform relocations pointing to the given symbol
Returns a 2-tuple. The first item is the address of the function code, the second is the address of the
relocation t... | [
"def",
"prepare_function_symbol",
"(",
"self",
",",
"symbol_name",
",",
"basic_addr",
"=",
"None",
")",
":",
"if",
"basic_addr",
"is",
"None",
":",
"basic_addr",
"=",
"self",
".",
"project",
".",
"loader",
".",
"extern_object",
".",
"get_pseudo_addr",
"(",
"... | Prepare the address space with the data necessary to perform relocations pointing to the given symbol
Returns a 2-tuple. The first item is the address of the function code, the second is the address of the
relocation target. | [
"Prepare",
"the",
"address",
"space",
"with",
"the",
"data",
"necessary",
"to",
"perform",
"relocations",
"pointing",
"to",
"the",
"given",
"symbol"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/simos/simos.py#L251-L260 | train | Prepare the address space with the data necessary to perform relocations pointing to the given symbol_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/simos/simos.py | SimOS.setup_gdt | def setup_gdt(self, state, gdt):
"""
Write the GlobalDescriptorTable object in the current state memory
:param state: state in which to write the GDT
:param gdt: GlobalDescriptorTable object
:return:
"""
state.memory.store(gdt.addr+8, gdt.table)
state.reg... | python | def setup_gdt(self, state, gdt):
"""
Write the GlobalDescriptorTable object in the current state memory
:param state: state in which to write the GDT
:param gdt: GlobalDescriptorTable object
:return:
"""
state.memory.store(gdt.addr+8, gdt.table)
state.reg... | [
"def",
"setup_gdt",
"(",
"self",
",",
"state",
",",
"gdt",
")",
":",
"state",
".",
"memory",
".",
"store",
"(",
"gdt",
".",
"addr",
"+",
"8",
",",
"gdt",
".",
"table",
")",
"state",
".",
"regs",
".",
"gdt",
"=",
"gdt",
".",
"gdt",
"state",
".",... | Write the GlobalDescriptorTable object in the current state memory
:param state: state in which to write the GDT
:param gdt: GlobalDescriptorTable object
:return: | [
"Write",
"the",
"GlobalDescriptorTable",
"object",
"in",
"the",
"current",
"state",
"memory"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/simos/simos.py#L295-L310 | train | Setup the state. regs. gdt to the object in which to write the GDT. | 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/simos.py | SimOS.generate_gdt | def generate_gdt(self, fs, gs, fs_size=0xFFFFFFFF, gs_size=0xFFFFFFFF):
"""
Generate a GlobalDescriptorTable object and populate it using the value of the gs and fs register
:param fs: value of the fs segment register
:param gs: value of the gs segment register
:param ... | python | def generate_gdt(self, fs, gs, fs_size=0xFFFFFFFF, gs_size=0xFFFFFFFF):
"""
Generate a GlobalDescriptorTable object and populate it using the value of the gs and fs register
:param fs: value of the fs segment register
:param gs: value of the gs segment register
:param ... | [
"def",
"generate_gdt",
"(",
"self",
",",
"fs",
",",
"gs",
",",
"fs_size",
"=",
"0xFFFFFFFF",
",",
"gs_size",
"=",
"0xFFFFFFFF",
")",
":",
"A_PRESENT",
"=",
"0x80",
"A_DATA",
"=",
"0x10",
"A_DATA_WRITABLE",
"=",
"0x2",
"A_PRIV_0",
"=",
"0x0",
"A_DIR_CON_BIT... | Generate a GlobalDescriptorTable object and populate it using the value of the gs and fs register
:param fs: value of the fs segment register
:param gs: value of the gs segment register
:param fs_size: size of the fs segment register
:param gs_size: size of the gs segment regi... | [
"Generate",
"a",
"GlobalDescriptorTable",
"object",
"and",
"populate",
"it",
"using",
"the",
"value",
"of",
"the",
"gs",
"and",
"fs",
"register"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/simos/simos.py#L312-L356 | train | Generate a GlobalDescriptorTable object and populate it using the value of the fs and gs segments. | 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/sim_type.py | define_struct | def define_struct(defn):
"""
Register a struct definition globally
>>> define_struct('struct abcd {int x; int y;}')
"""
struct = parse_type(defn)
ALL_TYPES[struct.name] = struct
return struct | python | def define_struct(defn):
"""
Register a struct definition globally
>>> define_struct('struct abcd {int x; int y;}')
"""
struct = parse_type(defn)
ALL_TYPES[struct.name] = struct
return struct | [
"def",
"define_struct",
"(",
"defn",
")",
":",
"struct",
"=",
"parse_type",
"(",
"defn",
")",
"ALL_TYPES",
"[",
"struct",
".",
"name",
"]",
"=",
"struct",
"return",
"struct"
] | Register a struct definition globally
>>> define_struct('struct abcd {int x; int y;}') | [
"Register",
"a",
"struct",
"definition",
"globally"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/sim_type.py#L986-L994 | train | Register a struct definition globally
| 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/sim_type.py | do_preprocess | def do_preprocess(defn):
"""
Run a string through the C preprocessor that ships with pycparser but is weirdly inaccessible?
"""
from pycparser.ply import lex, cpp
lexer = lex.lex(cpp)
p = cpp.Preprocessor(lexer)
# p.add_path(dir) will add dir to the include search path
p.parse(defn)
... | python | def do_preprocess(defn):
"""
Run a string through the C preprocessor that ships with pycparser but is weirdly inaccessible?
"""
from pycparser.ply import lex, cpp
lexer = lex.lex(cpp)
p = cpp.Preprocessor(lexer)
# p.add_path(dir) will add dir to the include search path
p.parse(defn)
... | [
"def",
"do_preprocess",
"(",
"defn",
")",
":",
"from",
"pycparser",
".",
"ply",
"import",
"lex",
",",
"cpp",
"lexer",
"=",
"lex",
".",
"lex",
"(",
"cpp",
")",
"p",
"=",
"cpp",
".",
"Preprocessor",
"(",
"lexer",
")",
"# p.add_path(dir) will add dir to the i... | Run a string through the C preprocessor that ships with pycparser but is weirdly inaccessible? | [
"Run",
"a",
"string",
"through",
"the",
"C",
"preprocessor",
"that",
"ships",
"with",
"pycparser",
"but",
"is",
"weirdly",
"inaccessible?"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/sim_type.py#L1006-L1015 | train | Run a string through the C preprocessor that ships with pycparser but is weirdly inaccessible? | 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/sim_type.py | parse_file | def parse_file(defn, preprocess=True):
"""
Parse a series of C definitions, returns a tuple of two type mappings, one for variable
definitions and one for type definitions.
"""
if pycparser is None:
raise ImportError("Please install pycparser in order to parse C definitions")
defn = '\n... | python | def parse_file(defn, preprocess=True):
"""
Parse a series of C definitions, returns a tuple of two type mappings, one for variable
definitions and one for type definitions.
"""
if pycparser is None:
raise ImportError("Please install pycparser in order to parse C definitions")
defn = '\n... | [
"def",
"parse_file",
"(",
"defn",
",",
"preprocess",
"=",
"True",
")",
":",
"if",
"pycparser",
"is",
"None",
":",
"raise",
"ImportError",
"(",
"\"Please install pycparser in order to parse C definitions\"",
")",
"defn",
"=",
"'\\n'",
".",
"join",
"(",
"x",
"for"... | Parse a series of C definitions, returns a tuple of two type mappings, one for variable
definitions and one for type definitions. | [
"Parse",
"a",
"series",
"of",
"C",
"definitions",
"returns",
"a",
"tuple",
"of",
"two",
"type",
"mappings",
"one",
"for",
"variable",
"definitions",
"and",
"one",
"for",
"type",
"definitions",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/sim_type.py#L1033-L1064 | train | Parse a series of C definitions returns a tuple of two type mappings one for variable
definitions and one for type definitions. | 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/sim_type.py | parse_type | def parse_type(defn, preprocess=True):
"""
Parse a simple type expression into a SimType
>>> parse_type('int *')
"""
if pycparser is None:
raise ImportError("Please install pycparser in order to parse C definitions")
defn = 'typedef ' + defn.strip('; \n\t\r') + ' QQQQ;'
if preproc... | python | def parse_type(defn, preprocess=True):
"""
Parse a simple type expression into a SimType
>>> parse_type('int *')
"""
if pycparser is None:
raise ImportError("Please install pycparser in order to parse C definitions")
defn = 'typedef ' + defn.strip('; \n\t\r') + ' QQQQ;'
if preproc... | [
"def",
"parse_type",
"(",
"defn",
",",
"preprocess",
"=",
"True",
")",
":",
"if",
"pycparser",
"is",
"None",
":",
"raise",
"ImportError",
"(",
"\"Please install pycparser in order to parse C definitions\"",
")",
"defn",
"=",
"'typedef '",
"+",
"defn",
".",
"strip"... | Parse a simple type expression into a SimType
>>> parse_type('int *') | [
"Parse",
"a",
"simple",
"type",
"expression",
"into",
"a",
"SimType"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/sim_type.py#L1067-L1087 | train | Parse a simple type expression into a SimType
| 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/sim_type.py | SimType.alignment | def alignment(self):
"""
The alignment of the type in bytes.
"""
if self._arch is None:
return NotImplemented
return self.size // self._arch.byte_width | python | def alignment(self):
"""
The alignment of the type in bytes.
"""
if self._arch is None:
return NotImplemented
return self.size // self._arch.byte_width | [
"def",
"alignment",
"(",
"self",
")",
":",
"if",
"self",
".",
"_arch",
"is",
"None",
":",
"return",
"NotImplemented",
"return",
"self",
".",
"size",
"//",
"self",
".",
"_arch",
".",
"byte_width"
] | The alignment of the type in bytes. | [
"The",
"alignment",
"of",
"the",
"type",
"in",
"bytes",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/sim_type.py#L76-L82 | train | Returns the alignment of the type in bytes. | 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/concrete.py | Concrete.sync | def sync(self):
"""
Handle the switch between the concrete execution and angr.
This method takes care of:
1- Synchronize registers.
2- Set a concrete target to the memory backer so the memory reads are redirected in the concrete process memory.
3- If possible restore the ... | python | def sync(self):
"""
Handle the switch between the concrete execution and angr.
This method takes care of:
1- Synchronize registers.
2- Set a concrete target to the memory backer so the memory reads are redirected in the concrete process memory.
3- If possible restore the ... | [
"def",
"sync",
"(",
"self",
")",
":",
"def",
"_sync_segments",
"(",
"state",
")",
":",
"\"\"\"\n Segment registers synchronization is on demand as soon as the\n symbolic execution access a segment register.\n \"\"\"",
"concr_target",
"=",
"state",
"."... | Handle the switch between the concrete execution and angr.
This method takes care of:
1- Synchronize registers.
2- Set a concrete target to the memory backer so the memory reads are redirected in the concrete process memory.
3- If possible restore the SimProcedures with the real addresse... | [
"Handle",
"the",
"switch",
"between",
"the",
"concrete",
"execution",
"and",
"angr",
".",
"This",
"method",
"takes",
"care",
"of",
":",
"1",
"-",
"Synchronize",
"registers",
".",
"2",
"-",
"Set",
"a",
"concrete",
"target",
"to",
"the",
"memory",
"backer",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/concrete.py#L60-L178 | train | Synchronize the concrete registers with the one getting from the concrete process memory. | 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/unique.py | UniqueSearch.similarity | def similarity(state_a, state_b):
"""
The (L2) distance between the counts of the state addresses in the history of the path.
:param state_a: The first state to compare
:param state_b: The second state to compare
"""
count_a = Counter(state_a.history.bbl_addrs)
co... | python | def similarity(state_a, state_b):
"""
The (L2) distance between the counts of the state addresses in the history of the path.
:param state_a: The first state to compare
:param state_b: The second state to compare
"""
count_a = Counter(state_a.history.bbl_addrs)
co... | [
"def",
"similarity",
"(",
"state_a",
",",
"state_b",
")",
":",
"count_a",
"=",
"Counter",
"(",
"state_a",
".",
"history",
".",
"bbl_addrs",
")",
"count_b",
"=",
"Counter",
"(",
"state_b",
".",
"history",
".",
"bbl_addrs",
")",
"normal_distance",
"=",
"sum"... | The (L2) distance between the counts of the state addresses in the history of the path.
:param state_a: The first state to compare
:param state_b: The second state to compare | [
"The",
"(",
"L2",
")",
"distance",
"between",
"the",
"counts",
"of",
"the",
"state",
"addresses",
"in",
"the",
"history",
"of",
"the",
"path",
".",
":",
"param",
"state_a",
":",
"The",
"first",
"state",
"to",
"compare",
":",
"param",
"state_b",
":",
"T... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/exploration_techniques/unique.py#L78-L88 | train | Calculates the similarity between two states. | 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/unique.py | UniqueSearch.sequence_matcher_similarity | def sequence_matcher_similarity(state_a, state_b):
"""
The `difflib.SequenceMatcher` ratio between the state addresses in the history of the path.
:param state_a: The first state to compare
:param state_b: The second state to compare
"""
addrs_a = tuple(state_a.history.bb... | python | def sequence_matcher_similarity(state_a, state_b):
"""
The `difflib.SequenceMatcher` ratio between the state addresses in the history of the path.
:param state_a: The first state to compare
:param state_b: The second state to compare
"""
addrs_a = tuple(state_a.history.bb... | [
"def",
"sequence_matcher_similarity",
"(",
"state_a",
",",
"state_b",
")",
":",
"addrs_a",
"=",
"tuple",
"(",
"state_a",
".",
"history",
".",
"bbl_addrs",
")",
"addrs_b",
"=",
"tuple",
"(",
"state_b",
".",
"history",
".",
"bbl_addrs",
")",
"return",
"Sequenc... | The `difflib.SequenceMatcher` ratio between the state addresses in the history of the path.
:param state_a: The first state to compare
:param state_b: The second state to compare | [
"The",
"difflib",
".",
"SequenceMatcher",
"ratio",
"between",
"the",
"state",
"addresses",
"in",
"the",
"history",
"of",
"the",
"path",
".",
":",
"param",
"state_a",
":",
"The",
"first",
"state",
"to",
"compare",
":",
"param",
"state_b",
":",
"The",
"secon... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/exploration_techniques/unique.py#L91-L99 | train | The differflib. SequenceMatcher ratio between the state addresses in the history of the path. | 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/method_dispatcher.py | resolve_method | def resolve_method(state, method_name, class_name, params=(), ret_type=None,
include_superclasses=True, init_class=True,
raise_exception_if_not_found=False):
"""
Resolves the method based on the given characteristics (name, class and
params) The method may be defined in... | python | def resolve_method(state, method_name, class_name, params=(), ret_type=None,
include_superclasses=True, init_class=True,
raise_exception_if_not_found=False):
"""
Resolves the method based on the given characteristics (name, class and
params) The method may be defined in... | [
"def",
"resolve_method",
"(",
"state",
",",
"method_name",
",",
"class_name",
",",
"params",
"=",
"(",
")",
",",
"ret_type",
"=",
"None",
",",
"include_superclasses",
"=",
"True",
",",
"init_class",
"=",
"True",
",",
"raise_exception_if_not_found",
"=",
"False... | Resolves the method based on the given characteristics (name, class and
params) The method may be defined in one of the superclasses of the given
class (TODO: support interfaces).
:rtype: archinfo.arch_soot.SootMethodDescriptor | [
"Resolves",
"the",
"method",
"based",
"on",
"the",
"given",
"characteristics",
"(",
"name",
"class",
"and",
"params",
")",
"The",
"method",
"may",
"be",
"defined",
"in",
"one",
"of",
"the",
"superclasses",
"of",
"the",
"given",
"class",
"(",
"TODO",
":",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/soot/method_dispatcher.py#L11-L44 | train | Resolves the given method based on the given characteristics. | 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/calling_conventions.py | SimRegArg._fix_offset | def _fix_offset(self, state, size, arch=None):
"""
This is a hack to deal with small values being stored at offsets into large registers unpredictably
"""
if state is not None:
arch = state.arch
if arch is None:
raise ValueError('Either "state" or "arch" ... | python | def _fix_offset(self, state, size, arch=None):
"""
This is a hack to deal with small values being stored at offsets into large registers unpredictably
"""
if state is not None:
arch = state.arch
if arch is None:
raise ValueError('Either "state" or "arch" ... | [
"def",
"_fix_offset",
"(",
"self",
",",
"state",
",",
"size",
",",
"arch",
"=",
"None",
")",
":",
"if",
"state",
"is",
"not",
"None",
":",
"arch",
"=",
"state",
".",
"arch",
"if",
"arch",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"'Either \"stat... | This is a hack to deal with small values being stored at offsets into large registers unpredictably | [
"This",
"is",
"a",
"hack",
"to",
"deal",
"with",
"small",
"values",
"being",
"stored",
"at",
"offsets",
"into",
"large",
"registers",
"unpredictably"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/calling_conventions.py#L96-L111 | train | This is a hack to deal with small values being stored at offsets into large registers unpredictably
| 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/calling_conventions.py | SimCC.from_arg_kinds | def from_arg_kinds(cls, arch, fp_args, ret_fp=False, sizes=None, sp_delta=None, func_ty=None):
"""
Get an instance of the class that will extract floating-point/integral args correctly.
:param arch: The Archinfo arch for this CC
:param fp_args: A list, with one entry for each... | python | def from_arg_kinds(cls, arch, fp_args, ret_fp=False, sizes=None, sp_delta=None, func_ty=None):
"""
Get an instance of the class that will extract floating-point/integral args correctly.
:param arch: The Archinfo arch for this CC
:param fp_args: A list, with one entry for each... | [
"def",
"from_arg_kinds",
"(",
"cls",
",",
"arch",
",",
"fp_args",
",",
"ret_fp",
"=",
"False",
",",
"sizes",
"=",
"None",
",",
"sp_delta",
"=",
"None",
",",
"func_ty",
"=",
"None",
")",
":",
"basic",
"=",
"cls",
"(",
"arch",
",",
"sp_delta",
"=",
"... | Get an instance of the class that will extract floating-point/integral args correctly.
:param arch: The Archinfo arch for this CC
:param fp_args: A list, with one entry for each argument the function can take. True if the argument is fp,
false if it is integral.
... | [
"Get",
"an",
"instance",
"of",
"the",
"class",
"that",
"will",
"extract",
"floating",
"-",
"point",
"/",
"integral",
"args",
"correctly",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/calling_conventions.py#L297-L313 | train | Create an instance of the class from the given arguments. | 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/calling_conventions.py | SimCC.int_args | def int_args(self):
"""
Iterate through all the possible arg positions that can only be used to store integer or pointer values
Does not take into account customizations.
Returns an iterator of SimFunctionArguments
"""
if self.ARG_REGS is None:
raise NotImple... | python | def int_args(self):
"""
Iterate through all the possible arg positions that can only be used to store integer or pointer values
Does not take into account customizations.
Returns an iterator of SimFunctionArguments
"""
if self.ARG_REGS is None:
raise NotImple... | [
"def",
"int_args",
"(",
"self",
")",
":",
"if",
"self",
".",
"ARG_REGS",
"is",
"None",
":",
"raise",
"NotImplementedError",
"(",
")",
"for",
"reg",
"in",
"self",
".",
"ARG_REGS",
":",
"# pylint: disable=not-an-iterable",
"yield",
"SimRegArg",
"(",
"reg",
","... | Iterate through all the possible arg positions that can only be used to store integer or pointer values
Does not take into account customizations.
Returns an iterator of SimFunctionArguments | [
"Iterate",
"through",
"all",
"the",
"possible",
"arg",
"positions",
"that",
"can",
"only",
"be",
"used",
"to",
"store",
"integer",
"or",
"pointer",
"values",
"Does",
"not",
"take",
"into",
"account",
"customizations",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/calling_conventions.py#L338-L348 | train | Iterate through all possible arg positions that can only be used to store integer or pointer values. | 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/calling_conventions.py | SimCC.both_args | def both_args(self):
"""
Iterate through all the possible arg positions that can be used to store any kind of argument
Does not take into account customizations.
Returns an iterator of SimFunctionArguments
"""
turtle = self.STACKARG_SP_BUFF + self.STACKARG_SP_DIFF
... | python | def both_args(self):
"""
Iterate through all the possible arg positions that can be used to store any kind of argument
Does not take into account customizations.
Returns an iterator of SimFunctionArguments
"""
turtle = self.STACKARG_SP_BUFF + self.STACKARG_SP_DIFF
... | [
"def",
"both_args",
"(",
"self",
")",
":",
"turtle",
"=",
"self",
".",
"STACKARG_SP_BUFF",
"+",
"self",
".",
"STACKARG_SP_DIFF",
"while",
"True",
":",
"yield",
"SimStackArg",
"(",
"turtle",
",",
"self",
".",
"arch",
".",
"bytes",
")",
"turtle",
"+=",
"se... | Iterate through all the possible arg positions that can be used to store any kind of argument
Does not take into account customizations.
Returns an iterator of SimFunctionArguments | [
"Iterate",
"through",
"all",
"the",
"possible",
"arg",
"positions",
"that",
"can",
"be",
"used",
"to",
"store",
"any",
"kind",
"of",
"argument",
"Does",
"not",
"take",
"into",
"account",
"customizations",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/calling_conventions.py#L351-L361 | train | Iterate through all possible arg positions that can be used to store any kind of argument in a specific class. | 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/calling_conventions.py | SimCC.fp_args | def fp_args(self):
"""
Iterate through all the possible arg positions that can only be used to store floating point values
Does not take into account customizations.
Returns an iterator of SimFunctionArguments
"""
if self.FP_ARG_REGS is None:
raise NotImpleme... | python | def fp_args(self):
"""
Iterate through all the possible arg positions that can only be used to store floating point values
Does not take into account customizations.
Returns an iterator of SimFunctionArguments
"""
if self.FP_ARG_REGS is None:
raise NotImpleme... | [
"def",
"fp_args",
"(",
"self",
")",
":",
"if",
"self",
".",
"FP_ARG_REGS",
"is",
"None",
":",
"raise",
"NotImplementedError",
"(",
")",
"for",
"reg",
"in",
"self",
".",
"FP_ARG_REGS",
":",
"# pylint: disable=not-an-iterable",
"yield",
"SimRegArg",
"(",
"reg",
... | Iterate through all the possible arg positions that can only be used to store floating point values
Does not take into account customizations.
Returns an iterator of SimFunctionArguments | [
"Iterate",
"through",
"all",
"the",
"possible",
"arg",
"positions",
"that",
"can",
"only",
"be",
"used",
"to",
"store",
"floating",
"point",
"values",
"Does",
"not",
"take",
"into",
"account",
"customizations",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/calling_conventions.py#L364-L374 | train | Iterate through all the possible arg positions that can only be used to store floating point values. | 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/calling_conventions.py | SimCC.is_fp_arg | def is_fp_arg(self, arg):
"""
This should take a SimFunctionArgument instance and return whether or not that argument is a floating-point
argument.
Returns True for MUST be a floating point arg,
False for MUST NOT be a floating point arg,
None for when it... | python | def is_fp_arg(self, arg):
"""
This should take a SimFunctionArgument instance and return whether or not that argument is a floating-point
argument.
Returns True for MUST be a floating point arg,
False for MUST NOT be a floating point arg,
None for when it... | [
"def",
"is_fp_arg",
"(",
"self",
",",
"arg",
")",
":",
"if",
"arg",
"in",
"self",
".",
"int_args",
":",
"return",
"False",
"if",
"arg",
"in",
"self",
".",
"fp_args",
"or",
"arg",
"==",
"self",
".",
"FP_RETURN_VAL",
":",
"return",
"True",
"return",
"N... | This should take a SimFunctionArgument instance and return whether or not that argument is a floating-point
argument.
Returns True for MUST be a floating point arg,
False for MUST NOT be a floating point arg,
None for when it can be either. | [
"This",
"should",
"take",
"a",
"SimFunctionArgument",
"instance",
"and",
"return",
"whether",
"or",
"not",
"that",
"argument",
"is",
"a",
"floating",
"-",
"point",
"argument",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/calling_conventions.py#L376-L389 | train | Returns True if the argument is a floating point argument False otherwise. | 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/calling_conventions.py | SimCC.stack_space | def stack_space(self, args):
"""
:param args: A list of SimFunctionArguments
:returns: The number of bytes that should be allocated on the stack to store all these args,
NOT INCLUDING the return address.
"""
out = self.STACKARG_SP_DIF... | python | def stack_space(self, args):
"""
:param args: A list of SimFunctionArguments
:returns: The number of bytes that should be allocated on the stack to store all these args,
NOT INCLUDING the return address.
"""
out = self.STACKARG_SP_DIF... | [
"def",
"stack_space",
"(",
"self",
",",
"args",
")",
":",
"out",
"=",
"self",
".",
"STACKARG_SP_DIFF",
"for",
"arg",
"in",
"args",
":",
"if",
"isinstance",
"(",
"arg",
",",
"SimStackArg",
")",
":",
"out",
"=",
"max",
"(",
"out",
",",
"arg",
".",
"s... | :param args: A list of SimFunctionArguments
:returns: The number of bytes that should be allocated on the stack to store all these args,
NOT INCLUDING the return address. | [
":",
"param",
"args",
":",
"A",
"list",
"of",
"SimFunctionArguments"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/calling_conventions.py#L404-L417 | train | Returns the number of bytes that should be allocated on the stack. | 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/calling_conventions.py | SimCC.arg_locs | def arg_locs(self, is_fp=None, sizes=None):
"""
Pass this a list of whether each parameter is floating-point or not, and get back a list of
SimFunctionArguments. Optionally, pass a list of argument sizes (in bytes) as well.
If you've customized this CC, this will sanity-check the provid... | python | def arg_locs(self, is_fp=None, sizes=None):
"""
Pass this a list of whether each parameter is floating-point or not, and get back a list of
SimFunctionArguments. Optionally, pass a list of argument sizes (in bytes) as well.
If you've customized this CC, this will sanity-check the provid... | [
"def",
"arg_locs",
"(",
"self",
",",
"is_fp",
"=",
"None",
",",
"sizes",
"=",
"None",
")",
":",
"session",
"=",
"self",
".",
"arg_session",
"if",
"self",
".",
"func_ty",
"is",
"None",
":",
"# No function prototype is provided. `is_fp` must be provided.",
"if",
... | Pass this a list of whether each parameter is floating-point or not, and get back a list of
SimFunctionArguments. Optionally, pass a list of argument sizes (in bytes) as well.
If you've customized this CC, this will sanity-check the provided locations with the given list. | [
"Pass",
"this",
"a",
"list",
"of",
"whether",
"each",
"parameter",
"is",
"floating",
"-",
"point",
"or",
"not",
"and",
"get",
"back",
"a",
"list",
"of",
"SimFunctionArguments",
".",
"Optionally",
"pass",
"a",
"list",
"of",
"argument",
"sizes",
"(",
"in",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/calling_conventions.py#L448-L465 | train | Return a list of locations for each argument of the current 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/calling_conventions.py | SimCC.arg | def arg(self, state, index, stack_base=None):
"""
Returns a bitvector expression representing the nth argument of a function.
`stack_base` is an optional pointer to the top of the stack at the function start. If it is not
specified, use the current stack pointer.
WARNING: this ... | python | def arg(self, state, index, stack_base=None):
"""
Returns a bitvector expression representing the nth argument of a function.
`stack_base` is an optional pointer to the top of the stack at the function start. If it is not
specified, use the current stack pointer.
WARNING: this ... | [
"def",
"arg",
"(",
"self",
",",
"state",
",",
"index",
",",
"stack_base",
"=",
"None",
")",
":",
"session",
"=",
"self",
".",
"arg_session",
"if",
"self",
".",
"args",
"is",
"None",
":",
"arg_loc",
"=",
"[",
"session",
".",
"next_arg",
"(",
"False",
... | Returns a bitvector expression representing the nth argument of a function.
`stack_base` is an optional pointer to the top of the stack at the function start. If it is not
specified, use the current stack pointer.
WARNING: this assumes that none of the arguments are floating-point and they're ... | [
"Returns",
"a",
"bitvector",
"expression",
"representing",
"the",
"nth",
"argument",
"of",
"a",
"function",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/calling_conventions.py#L467-L483 | train | Returns a bitvector expression representing the nth argument of a 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/calling_conventions.py | SimCC.get_args | def get_args(self, state, is_fp=None, sizes=None, stack_base=None):
"""
`is_fp` should be a list of booleans specifying whether each corresponding argument is floating-point -
True for fp and False for int. For a shorthand to assume that all the parameters are int, pass the number of
par... | python | def get_args(self, state, is_fp=None, sizes=None, stack_base=None):
"""
`is_fp` should be a list of booleans specifying whether each corresponding argument is floating-point -
True for fp and False for int. For a shorthand to assume that all the parameters are int, pass the number of
par... | [
"def",
"get_args",
"(",
"self",
",",
"state",
",",
"is_fp",
"=",
"None",
",",
"sizes",
"=",
"None",
",",
"stack_base",
"=",
"None",
")",
":",
"if",
"sizes",
"is",
"None",
"and",
"self",
".",
"func_ty",
"is",
"not",
"None",
":",
"sizes",
"=",
"[",
... | `is_fp` should be a list of booleans specifying whether each corresponding argument is floating-point -
True for fp and False for int. For a shorthand to assume that all the parameters are int, pass the number of
parameters as an int.
If you've customized this CC, you may omit this parameter en... | [
"is_fp",
"should",
"be",
"a",
"list",
"of",
"booleans",
"specifying",
"whether",
"each",
"corresponding",
"argument",
"is",
"floating",
"-",
"point",
"-",
"True",
"for",
"fp",
"and",
"False",
"for",
"int",
".",
"For",
"a",
"shorthand",
"to",
"assume",
"tha... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/calling_conventions.py#L485-L520 | train | Returns a list of bitvector expressions representing the arguments of a 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/calling_conventions.py | SimCC.setup_callsite | def setup_callsite(self, state, ret_addr, args, stack_base=None, alloc_base=None, grow_like_stack=True):
"""
This function performs the actions of the caller getting ready to jump into a function.
:param state: The SimState to operate on
:param ret_addr: The address to ... | python | def setup_callsite(self, state, ret_addr, args, stack_base=None, alloc_base=None, grow_like_stack=True):
"""
This function performs the actions of the caller getting ready to jump into a function.
:param state: The SimState to operate on
:param ret_addr: The address to ... | [
"def",
"setup_callsite",
"(",
"self",
",",
"state",
",",
"ret_addr",
",",
"args",
",",
"stack_base",
"=",
"None",
",",
"alloc_base",
"=",
"None",
",",
"grow_like_stack",
"=",
"True",
")",
":",
"# STEP 0: clerical work",
"if",
"isinstance",
"(",
"self",
",",
... | This function performs the actions of the caller getting ready to jump into a function.
:param state: The SimState to operate on
:param ret_addr: The address to return to when the called function finishes
:param args: The list of arguments that that the called functi... | [
"This",
"function",
"performs",
"the",
"actions",
"of",
"the",
"caller",
"getting",
"ready",
"to",
"jump",
"into",
"a",
"function",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/calling_conventions.py#L522-L629 | train | This function sets up the callsite for the caller. | 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/calling_conventions.py | SimCC.teardown_callsite | def teardown_callsite(self, state, return_val=None, arg_types=None, force_callee_cleanup=False):
"""
This function performs the actions of the callee as it's getting ready to return.
It returns the address to return to.
:param state: The state to mutate
:param ... | python | def teardown_callsite(self, state, return_val=None, arg_types=None, force_callee_cleanup=False):
"""
This function performs the actions of the callee as it's getting ready to return.
It returns the address to return to.
:param state: The state to mutate
:param ... | [
"def",
"teardown_callsite",
"(",
"self",
",",
"state",
",",
"return_val",
"=",
"None",
",",
"arg_types",
"=",
"None",
",",
"force_callee_cleanup",
"=",
"False",
")",
":",
"if",
"return_val",
"is",
"not",
"None",
":",
"self",
".",
"set_return_val",
"(",
"st... | This function performs the actions of the callee as it's getting ready to return.
It returns the address to return to.
:param state: The state to mutate
:param return_val: The value to return
:param arg_types: The fp-ness of each of the args.... | [
"This",
"function",
"performs",
"the",
"actions",
"of",
"the",
"callee",
"as",
"it",
"s",
"getting",
"ready",
"to",
"return",
".",
"It",
"returns",
"the",
"address",
"to",
"return",
"to",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/calling_conventions.py#L631-L663 | train | This function cleans up the stack allocation of the callee s stack. | 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/calling_conventions.py | SimCC.get_return_val | def get_return_val(self, state, is_fp=None, size=None, stack_base=None):
"""
Get the return value out of the given state
"""
ty = self.func_ty.returnty if self.func_ty is not None else None
if self.ret_val is not None:
loc = self.ret_val
elif is_fp is not None... | python | def get_return_val(self, state, is_fp=None, size=None, stack_base=None):
"""
Get the return value out of the given state
"""
ty = self.func_ty.returnty if self.func_ty is not None else None
if self.ret_val is not None:
loc = self.ret_val
elif is_fp is not None... | [
"def",
"get_return_val",
"(",
"self",
",",
"state",
",",
"is_fp",
"=",
"None",
",",
"size",
"=",
"None",
",",
"stack_base",
"=",
"None",
")",
":",
"ty",
"=",
"self",
".",
"func_ty",
".",
"returnty",
"if",
"self",
".",
"func_ty",
"is",
"not",
"None",
... | Get the return value out of the given state | [
"Get",
"the",
"return",
"value",
"out",
"of",
"the",
"given",
"state"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/calling_conventions.py#L667-L687 | train | Get the return value out of 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/calling_conventions.py | SimCC.set_return_val | def set_return_val(self, state, val, is_fp=None, size=None, stack_base=None):
"""
Set the return value into the given state
"""
ty = self.func_ty.returnty if self.func_ty is not None else None
try:
betterval = self._standardize_value(val, ty, state, None)
exce... | python | def set_return_val(self, state, val, is_fp=None, size=None, stack_base=None):
"""
Set the return value into the given state
"""
ty = self.func_ty.returnty if self.func_ty is not None else None
try:
betterval = self._standardize_value(val, ty, state, None)
exce... | [
"def",
"set_return_val",
"(",
"self",
",",
"state",
",",
"val",
",",
"is_fp",
"=",
"None",
",",
"size",
"=",
"None",
",",
"stack_base",
"=",
"None",
")",
":",
"ty",
"=",
"self",
".",
"func_ty",
".",
"returnty",
"if",
"self",
".",
"func_ty",
"is",
"... | Set the return value into the given state | [
"Set",
"the",
"return",
"value",
"into",
"the",
"given",
"state"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/calling_conventions.py#L689-L710 | train | Set the return value into 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/calling_conventions.py | SimCC.find_cc | def find_cc(arch, args, sp_delta):
"""
Pinpoint the best-fit calling convention and return the corresponding SimCC instance, or None if no fit is
found.
:param Arch arch: An ArchX instance. Can be obtained from archinfo.
:param list args: A list of arguments.
... | python | def find_cc(arch, args, sp_delta):
"""
Pinpoint the best-fit calling convention and return the corresponding SimCC instance, or None if no fit is
found.
:param Arch arch: An ArchX instance. Can be obtained from archinfo.
:param list args: A list of arguments.
... | [
"def",
"find_cc",
"(",
"arch",
",",
"args",
",",
"sp_delta",
")",
":",
"if",
"arch",
".",
"name",
"not",
"in",
"CC",
":",
"return",
"None",
"possible_cc_classes",
"=",
"CC",
"[",
"arch",
".",
"name",
"]",
"for",
"cc_cls",
"in",
"possible_cc_classes",
"... | Pinpoint the best-fit calling convention and return the corresponding SimCC instance, or None if no fit is
found.
:param Arch arch: An ArchX instance. Can be obtained from archinfo.
:param list args: A list of arguments.
:param int sp_delta: The change of stack pointer be... | [
"Pinpoint",
"the",
"best",
"-",
"fit",
"calling",
"convention",
"and",
"return",
"the",
"corresponding",
"SimCC",
"instance",
"or",
"None",
"if",
"no",
"fit",
"is",
"found",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/calling_conventions.py#L889-L907 | train | Find the most - fit calling convention and return the corresponding SimCC instance. | 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/calling_conventions.py | SimCC.get_arg_info | def get_arg_info(self, state, is_fp=None, sizes=None):
"""
This is just a simple wrapper that collects the information from various locations
is_fp and sizes are passed to self.arg_locs and self.get_args
:param angr.SimState state: The state to evaluate and extract the values from
... | python | def get_arg_info(self, state, is_fp=None, sizes=None):
"""
This is just a simple wrapper that collects the information from various locations
is_fp and sizes are passed to self.arg_locs and self.get_args
:param angr.SimState state: The state to evaluate and extract the values from
... | [
"def",
"get_arg_info",
"(",
"self",
",",
"state",
",",
"is_fp",
"=",
"None",
",",
"sizes",
"=",
"None",
")",
":",
"argument_types",
"=",
"self",
".",
"func_ty",
".",
"args",
"argument_names",
"=",
"self",
".",
"func_ty",
".",
"arg_names",
"if",
"self",
... | This is just a simple wrapper that collects the information from various locations
is_fp and sizes are passed to self.arg_locs and self.get_args
:param angr.SimState state: The state to evaluate and extract the values from
:return: A list of tuples, where the nth tuple is (type, name, locatio... | [
"This",
"is",
"just",
"a",
"simple",
"wrapper",
"that",
"collects",
"the",
"information",
"from",
"various",
"locations",
"is_fp",
"and",
"sizes",
"are",
"passed",
"to",
"self",
".",
"arg_locs",
"and",
"self",
".",
"get_args",
":",
"param",
"angr",
".",
"S... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/calling_conventions.py#L910-L921 | train | This method returns the information from various locations
is_fp and sizes are passed to self. get_args and returns the information of the nth argument in the list | 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/successors.py | SimSuccessors.add_successor | def add_successor(self, state, target, guard, jumpkind, add_guard=True, exit_stmt_idx=None, exit_ins_addr=None,
source=None):
"""
Add a successor state of the SimRun.
This procedure stores method parameters into state.scratch, does some housekeeping,
and calls out t... | python | def add_successor(self, state, target, guard, jumpkind, add_guard=True, exit_stmt_idx=None, exit_ins_addr=None,
source=None):
"""
Add a successor state of the SimRun.
This procedure stores method parameters into state.scratch, does some housekeeping,
and calls out t... | [
"def",
"add_successor",
"(",
"self",
",",
"state",
",",
"target",
",",
"guard",
",",
"jumpkind",
",",
"add_guard",
"=",
"True",
",",
"exit_stmt_idx",
"=",
"None",
",",
"exit_ins_addr",
"=",
"None",
",",
"source",
"=",
"None",
")",
":",
"# First, trigger th... | Add a successor state of the SimRun.
This procedure stores method parameters into state.scratch, does some housekeeping,
and calls out to helper functions to prepare the state and categorize it into the appropriate
successor lists.
:param SimState state: The successor state.
... | [
"Add",
"a",
"successor",
"state",
"of",
"the",
"SimRun",
".",
"This",
"procedure",
"stores",
"method",
"parameters",
"into",
"state",
".",
"scratch",
"does",
"some",
"housekeeping",
"and",
"calls",
"out",
"to",
"helper",
"functions",
"to",
"prepare",
"the",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/successors.py#L86-L127 | train | Add a successor state to the 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/engines/successors.py | SimSuccessors._preprocess_successor | def _preprocess_successor(self, state, add_guard=True): #pylint:disable=unused-argument
"""
Preprocesses the successor state.
:param state: the successor state
"""
# Next, simplify what needs to be simplified
if o.SIMPLIFY_EXIT_STATE in state.options:
state.... | python | def _preprocess_successor(self, state, add_guard=True): #pylint:disable=unused-argument
"""
Preprocesses the successor state.
:param state: the successor state
"""
# Next, simplify what needs to be simplified
if o.SIMPLIFY_EXIT_STATE in state.options:
state.... | [
"def",
"_preprocess_successor",
"(",
"self",
",",
"state",
",",
"add_guard",
"=",
"True",
")",
":",
"#pylint:disable=unused-argument",
"# Next, simplify what needs to be simplified",
"if",
"o",
".",
"SIMPLIFY_EXIT_STATE",
"in",
"state",
".",
"options",
":",
"state",
"... | Preprocesses the successor state.
:param state: the successor state | [
"Preprocesses",
"the",
"successor",
"state",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/successors.py#L133-L169 | train | Preprocesses the successor 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/engines/successors.py | SimSuccessors._categorize_successor | def _categorize_successor(self, state):
"""
Append state into successor lists.
:param state: a SimState instance
:param target: The target (of the jump/call/ret)
:return: The state
"""
self.all_successors.append(state)
target = state.scratch.target
... | python | def _categorize_successor(self, state):
"""
Append state into successor lists.
:param state: a SimState instance
:param target: The target (of the jump/call/ret)
:return: The state
"""
self.all_successors.append(state)
target = state.scratch.target
... | [
"def",
"_categorize_successor",
"(",
"self",
",",
"state",
")",
":",
"self",
".",
"all_successors",
".",
"append",
"(",
"state",
")",
"target",
"=",
"state",
".",
"scratch",
".",
"target",
"# categorize the state",
"if",
"o",
".",
"APPROXIMATE_GUARDS",
"in",
... | Append state into successor lists.
:param state: a SimState instance
:param target: The target (of the jump/call/ret)
:return: The state | [
"Append",
"state",
"into",
"successor",
"lists",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/successors.py#L228-L340 | train | Add the state to the list of successors and the successors. | 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/successors.py | SimSuccessors._fix_syscall_ip | def _fix_syscall_ip(state):
"""
Resolve syscall information from the state, get the IP address of the syscall SimProcedure, and set the IP of
the state accordingly. Don't do anything if the resolution fails.
:param SimState state: the program state.
:return: None
"""
... | python | def _fix_syscall_ip(state):
"""
Resolve syscall information from the state, get the IP address of the syscall SimProcedure, and set the IP of
the state accordingly. Don't do anything if the resolution fails.
:param SimState state: the program state.
:return: None
"""
... | [
"def",
"_fix_syscall_ip",
"(",
"state",
")",
":",
"try",
":",
"bypass",
"=",
"o",
".",
"BYPASS_UNSUPPORTED_SYSCALL",
"in",
"state",
".",
"options",
"stub",
"=",
"state",
".",
"project",
".",
"simos",
".",
"syscall",
"(",
"state",
",",
"allow_unsupported",
... | Resolve syscall information from the state, get the IP address of the syscall SimProcedure, and set the IP of
the state accordingly. Don't do anything if the resolution fails.
:param SimState state: the program state.
:return: None | [
"Resolve",
"syscall",
"information",
"from",
"the",
"state",
"get",
"the",
"IP",
"address",
"of",
"the",
"syscall",
"SimProcedure",
"and",
"set",
"the",
"IP",
"of",
"the",
"state",
"accordingly",
".",
"Don",
"t",
"do",
"anything",
"if",
"the",
"resolution",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/successors.py#L372-L387 | train | Resolve syscall information from the state and set the IP of
the state accordingly. | 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/successors.py | SimSuccessors._finalize | def _finalize(self):
"""
Finalizes the request.
"""
if len(self.all_successors) == 0:
return
# do some cleanup
if o.DOWNSIZE_Z3 in self.all_successors[0].options:
for s in self.all_successors:
s.downsize()
# record if the ... | python | def _finalize(self):
"""
Finalizes the request.
"""
if len(self.all_successors) == 0:
return
# do some cleanup
if o.DOWNSIZE_Z3 in self.all_successors[0].options:
for s in self.all_successors:
s.downsize()
# record if the ... | [
"def",
"_finalize",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"all_successors",
")",
"==",
"0",
":",
"return",
"# do some cleanup",
"if",
"o",
".",
"DOWNSIZE_Z3",
"in",
"self",
".",
"all_successors",
"[",
"0",
"]",
".",
"options",
":",
"for... | Finalizes the request. | [
"Finalizes",
"the",
"request",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/successors.py#L389-L403 | train | Finalizes the request. | 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/successors.py | SimSuccessors._eval_target_jumptable | def _eval_target_jumptable(state, ip, limit):
"""
A *very* fast method to evaluate symbolic jump targets if they are a) concrete targets, or b) targets coming
from jump tables.
:param state: A SimState instance.
:param ip: The AST of the instruction pointer to evaluate.
... | python | def _eval_target_jumptable(state, ip, limit):
"""
A *very* fast method to evaluate symbolic jump targets if they are a) concrete targets, or b) targets coming
from jump tables.
:param state: A SimState instance.
:param ip: The AST of the instruction pointer to evaluate.
... | [
"def",
"_eval_target_jumptable",
"(",
"state",
",",
"ip",
",",
"limit",
")",
":",
"if",
"ip",
".",
"symbolic",
"is",
"False",
":",
"return",
"[",
"(",
"claripy",
".",
"ast",
".",
"bool",
".",
"true",
",",
"ip",
")",
"]",
"# concrete",
"# Detect whether... | A *very* fast method to evaluate symbolic jump targets if they are a) concrete targets, or b) targets coming
from jump tables.
:param state: A SimState instance.
:param ip: The AST of the instruction pointer to evaluate.
:param limit: The maximum number of concrete IPs.
... | [
"A",
"*",
"very",
"*",
"fast",
"method",
"to",
"evaluate",
"symbolic",
"jump",
"targets",
"if",
"they",
"are",
"a",
")",
"concrete",
"targets",
"or",
"b",
")",
"targets",
"coming",
"from",
"jump",
"tables",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/successors.py#L406-L493 | train | Evaluate symbolic jump targets. | 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/successors.py | SimSuccessors._eval_target_brutal | def _eval_target_brutal(state, ip, limit):
"""
The traditional way of evaluating symbolic jump targets.
:param state: A SimState instance.
:param ip: The AST of the instruction pointer to evaluate.
:param limit: The maximum number of concrete IPs.
:return: ... | python | def _eval_target_brutal(state, ip, limit):
"""
The traditional way of evaluating symbolic jump targets.
:param state: A SimState instance.
:param ip: The AST of the instruction pointer to evaluate.
:param limit: The maximum number of concrete IPs.
:return: ... | [
"def",
"_eval_target_brutal",
"(",
"state",
",",
"ip",
",",
"limit",
")",
":",
"addrs",
"=",
"state",
".",
"solver",
".",
"eval_upto",
"(",
"ip",
",",
"limit",
")",
"return",
"[",
"(",
"ip",
"==",
"addr",
",",
"addr",
")",
"for",
"addr",
"in",
"add... | The traditional way of evaluating symbolic jump targets.
:param state: A SimState instance.
:param ip: The AST of the instruction pointer to evaluate.
:param limit: The maximum number of concrete IPs.
:return: A list of conditions and the corresponding concrete IPs.
... | [
"The",
"traditional",
"way",
"of",
"evaluating",
"symbolic",
"jump",
"targets",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/successors.py#L496-L509 | train | A traditional way of evaluating symbolic jump targets. | 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/memset.py | memset._repeat_bytes | def _repeat_bytes(byt, rep):
"""
Get a long number for a byte being repeated for many times. This is part of the effort of optimizing
performance of angr's memory operations.
:param int byt: the byte to repeat
:param int rep: times to repeat the byte
:return: a long inte... | python | def _repeat_bytes(byt, rep):
"""
Get a long number for a byte being repeated for many times. This is part of the effort of optimizing
performance of angr's memory operations.
:param int byt: the byte to repeat
:param int rep: times to repeat the byte
:return: a long inte... | [
"def",
"_repeat_bytes",
"(",
"byt",
",",
"rep",
")",
":",
"if",
"rep",
"==",
"1",
":",
"return",
"byt",
"remainder",
"=",
"rep",
"%",
"2",
"quotient",
"=",
"rep",
"//",
"2",
"r_",
"=",
"memset",
".",
"_repeat_bytes",
"(",
"byt",
",",
"quotient",
")... | Get a long number for a byte being repeated for many times. This is part of the effort of optimizing
performance of angr's memory operations.
:param int byt: the byte to repeat
:param int rep: times to repeat the byte
:return: a long integer representing the repeating bytes
;rty... | [
"Get",
"a",
"long",
"number",
"for",
"a",
"byte",
"being",
"repeated",
"for",
"many",
"times",
".",
"This",
"is",
"part",
"of",
"the",
"effort",
"of",
"optimizing",
"performance",
"of",
"angr",
"s",
"memory",
"operations",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/procedures/libc/memset.py#L15-L39 | train | This function is used to get a long number for a byte being repeated for many times. | 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/memory_data.py | MemoryData.copy | def copy(self):
"""
Make a copy of the MemoryData.
:return: A copy of the MemoryData instance.
:rtype: MemoryData
"""
s = MemoryData(self.address, self.size, self.sort, pointer_addr=self.pointer_addr, max_size=self.max_size)
s.content = self.content
retu... | python | def copy(self):
"""
Make a copy of the MemoryData.
:return: A copy of the MemoryData instance.
:rtype: MemoryData
"""
s = MemoryData(self.address, self.size, self.sort, pointer_addr=self.pointer_addr, max_size=self.max_size)
s.content = self.content
retu... | [
"def",
"copy",
"(",
"self",
")",
":",
"s",
"=",
"MemoryData",
"(",
"self",
".",
"address",
",",
"self",
".",
"size",
",",
"self",
".",
"sort",
",",
"pointer_addr",
"=",
"self",
".",
"pointer_addr",
",",
"max_size",
"=",
"self",
".",
"max_size",
")",
... | Make a copy of the MemoryData.
:return: A copy of the MemoryData instance.
:rtype: MemoryData | [
"Make",
"a",
"copy",
"of",
"the",
"MemoryData",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/cfg/memory_data.py#L111-L121 | train | Make a copy of the MemoryData instance. | 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/storage/paged_memory.py | BasePage.store_mo | def store_mo(self, state, new_mo, overwrite=True): #pylint:disable=unused-argument
"""
Stores a memory object.
:param new_mo: the memory object
:param overwrite: whether to overwrite objects already in memory (if false, just fill in the holes)
"""
start, end = self._reso... | python | def store_mo(self, state, new_mo, overwrite=True): #pylint:disable=unused-argument
"""
Stores a memory object.
:param new_mo: the memory object
:param overwrite: whether to overwrite objects already in memory (if false, just fill in the holes)
"""
start, end = self._reso... | [
"def",
"store_mo",
"(",
"self",
",",
"state",
",",
"new_mo",
",",
"overwrite",
"=",
"True",
")",
":",
"#pylint:disable=unused-argument",
"start",
",",
"end",
"=",
"self",
".",
"_resolve_range",
"(",
"new_mo",
")",
"if",
"overwrite",
":",
"self",
".",
"stor... | Stores a memory object.
:param new_mo: the memory object
:param overwrite: whether to overwrite objects already in memory (if false, just fill in the holes) | [
"Stores",
"a",
"memory",
"object",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/storage/paged_memory.py#L69-L80 | train | Stores a memory object in the 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/storage/paged_memory.py | TreePage.load_mo | def load_mo(self, state, page_idx):
"""
Loads a memory object from memory.
:param page_idx: the index into the page
:returns: a tuple of the object
"""
try:
key = next(self._storage.irange(maximum=page_idx, reverse=True))
except StopIteration:
... | python | def load_mo(self, state, page_idx):
"""
Loads a memory object from memory.
:param page_idx: the index into the page
:returns: a tuple of the object
"""
try:
key = next(self._storage.irange(maximum=page_idx, reverse=True))
except StopIteration:
... | [
"def",
"load_mo",
"(",
"self",
",",
"state",
",",
"page_idx",
")",
":",
"try",
":",
"key",
"=",
"next",
"(",
"self",
".",
"_storage",
".",
"irange",
"(",
"maximum",
"=",
"page_idx",
",",
"reverse",
"=",
"True",
")",
")",
"except",
"StopIteration",
":... | Loads a memory object from memory.
:param page_idx: the index into the page
:returns: a tuple of the object | [
"Loads",
"a",
"memory",
"object",
"from",
"memory",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/storage/paged_memory.py#L207-L220 | train | Load a memory object from memory. | 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/storage/paged_memory.py | TreePage.load_slice | def load_slice(self, state, start, end):
"""
Return the memory objects overlapping with the provided slice.
:param start: the start address
:param end: the end address (non-inclusive)
:returns: tuples of (starting_addr, memory_object)
"""
keys = list(self._storag... | python | def load_slice(self, state, start, end):
"""
Return the memory objects overlapping with the provided slice.
:param start: the start address
:param end: the end address (non-inclusive)
:returns: tuples of (starting_addr, memory_object)
"""
keys = list(self._storag... | [
"def",
"load_slice",
"(",
"self",
",",
"state",
",",
"start",
",",
"end",
")",
":",
"keys",
"=",
"list",
"(",
"self",
".",
"_storage",
".",
"irange",
"(",
"start",
",",
"end",
"-",
"1",
")",
")",
"if",
"not",
"keys",
"or",
"keys",
"[",
"0",
"]"... | Return the memory objects overlapping with the provided slice.
:param start: the start address
:param end: the end address (non-inclusive)
:returns: tuples of (starting_addr, memory_object) | [
"Return",
"the",
"memory",
"objects",
"overlapping",
"with",
"the",
"provided",
"slice",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/storage/paged_memory.py#L222-L239 | train | Load the slice of the memory. | 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/storage/paged_memory.py | ListPage.load_mo | def load_mo(self, state, page_idx):
"""
Loads a memory object from memory.
:param page_idx: the index into the page
:returns: a tuple of the object
"""
mo = self._storage[page_idx-self._page_addr]
return self._sinkhole if mo is None else mo | python | def load_mo(self, state, page_idx):
"""
Loads a memory object from memory.
:param page_idx: the index into the page
:returns: a tuple of the object
"""
mo = self._storage[page_idx-self._page_addr]
return self._sinkhole if mo is None else mo | [
"def",
"load_mo",
"(",
"self",
",",
"state",
",",
"page_idx",
")",
":",
"mo",
"=",
"self",
".",
"_storage",
"[",
"page_idx",
"-",
"self",
".",
"_page_addr",
"]",
"return",
"self",
".",
"_sinkhole",
"if",
"mo",
"is",
"None",
"else",
"mo"
] | Loads a memory object from memory.
:param page_idx: the index into the page
:returns: a tuple of the object | [
"Loads",
"a",
"memory",
"object",
"from",
"memory",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/storage/paged_memory.py#L287-L295 | train | Loads a memory object from memory. | 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/storage/paged_memory.py | ListPage.load_slice | def load_slice(self, state, start, end):
"""
Return the memory objects overlapping with the provided slice.
:param start: the start address
:param end: the end address (non-inclusive)
:returns: tuples of (starting_addr, memory_object)
"""
items = [ ]
if s... | python | def load_slice(self, state, start, end):
"""
Return the memory objects overlapping with the provided slice.
:param start: the start address
:param end: the end address (non-inclusive)
:returns: tuples of (starting_addr, memory_object)
"""
items = [ ]
if s... | [
"def",
"load_slice",
"(",
"self",
",",
"state",
",",
"start",
",",
"end",
")",
":",
"items",
"=",
"[",
"]",
"if",
"start",
">",
"self",
".",
"_page_addr",
"+",
"self",
".",
"_page_size",
"or",
"end",
"<",
"self",
".",
"_page_addr",
":",
"l",
".",
... | Return the memory objects overlapping with the provided slice.
:param start: the start address
:param end: the end address (non-inclusive)
:returns: tuples of (starting_addr, memory_object) | [
"Return",
"the",
"memory",
"objects",
"overlapping",
"with",
"the",
"provided",
"slice",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/storage/paged_memory.py#L297-L317 | train | Load the slice of memory objects from the memory. | 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/storage/paged_memory.py | SimPagedMemory.contains_no_backer | def contains_no_backer(self, addr):
"""
Tests if the address is contained in any page of paged memory, without considering memory backers.
:param int addr: The address to test.
:return: True if the address is included in one of the pages, False otherwise.
:rtype: bool
""... | python | def contains_no_backer(self, addr):
"""
Tests if the address is contained in any page of paged memory, without considering memory backers.
:param int addr: The address to test.
:return: True if the address is included in one of the pages, False otherwise.
:rtype: bool
""... | [
"def",
"contains_no_backer",
"(",
"self",
",",
"addr",
")",
":",
"for",
"i",
",",
"p",
"in",
"self",
".",
"_pages",
".",
"items",
"(",
")",
":",
"if",
"i",
"*",
"self",
".",
"_page_size",
"<=",
"addr",
"<",
"(",
"i",
"+",
"1",
")",
"*",
"self",... | Tests if the address is contained in any page of paged memory, without considering memory backers.
:param int addr: The address to test.
:return: True if the address is included in one of the pages, False otherwise.
:rtype: bool | [
"Tests",
"if",
"the",
"address",
"is",
"contained",
"in",
"any",
"page",
"of",
"paged",
"memory",
"without",
"considering",
"memory",
"backers",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/storage/paged_memory.py#L601-L613 | train | Tests if the address is contained in any page of paged memory without considering memory backers. | 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/storage/paged_memory.py | SimPagedMemory.__changed_bytes | def __changed_bytes(self, other):
"""
Gets the set of changed bytes between `self` and `other`.
:type other: SimPagedMemory
:returns: A set of differing bytes.
"""
if self._page_size != other._page_size:
raise SimMemoryError("SimPagedMemory page size... | python | def __changed_bytes(self, other):
"""
Gets the set of changed bytes between `self` and `other`.
:type other: SimPagedMemory
:returns: A set of differing bytes.
"""
if self._page_size != other._page_size:
raise SimMemoryError("SimPagedMemory page size... | [
"def",
"__changed_bytes",
"(",
"self",
",",
"other",
")",
":",
"if",
"self",
".",
"_page_size",
"!=",
"other",
".",
"_page_size",
":",
"raise",
"SimMemoryError",
"(",
"\"SimPagedMemory page sizes differ. This is asking for disaster.\"",
")",
"our_pages",
"=",
"set",
... | Gets the set of changed bytes between `self` and `other`.
:type other: SimPagedMemory
:returns: A set of differing bytes. | [
"Gets",
"the",
"set",
"of",
"changed",
"bytes",
"between",
"self",
"and",
"other",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/storage/paged_memory.py#L630-L697 | train | Gets the set of changed bytes between self and other. | 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/storage/paged_memory.py | SimPagedMemory._apply_object_to_page | def _apply_object_to_page(self, page_base, mo, page=None, overwrite=True):
"""
Writes a memory object to a `page`
:param page_base: The base address of the page.
:param mo: The memory object.
:param page: (optional) the page to use.
:param overwrite: ... | python | def _apply_object_to_page(self, page_base, mo, page=None, overwrite=True):
"""
Writes a memory object to a `page`
:param page_base: The base address of the page.
:param mo: The memory object.
:param page: (optional) the page to use.
:param overwrite: ... | [
"def",
"_apply_object_to_page",
"(",
"self",
",",
"page_base",
",",
"mo",
",",
"page",
"=",
"None",
",",
"overwrite",
"=",
"True",
")",
":",
"page_num",
"=",
"page_base",
"//",
"self",
".",
"_page_size",
"try",
":",
"page",
"=",
"self",
".",
"_get_page",... | Writes a memory object to a `page`
:param page_base: The base address of the page.
:param mo: The memory object.
:param page: (optional) the page to use.
:param overwrite: (optional) If False, only write to currently-empty memory. | [
"Writes",
"a",
"memory",
"object",
"to",
"a",
"page"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/storage/paged_memory.py#L703-L726 | train | Writes a memory object to a page. | 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/storage/paged_memory.py | SimPagedMemory.store_memory_object | def store_memory_object(self, mo, overwrite=True):
"""
This function optimizes a large store by storing a single reference to the :class:`SimMemoryObject` instead of
one for each byte.
:param memory_object: the memory object to store
"""
for p in self._containing_pages_... | python | def store_memory_object(self, mo, overwrite=True):
"""
This function optimizes a large store by storing a single reference to the :class:`SimMemoryObject` instead of
one for each byte.
:param memory_object: the memory object to store
"""
for p in self._containing_pages_... | [
"def",
"store_memory_object",
"(",
"self",
",",
"mo",
",",
"overwrite",
"=",
"True",
")",
":",
"for",
"p",
"in",
"self",
".",
"_containing_pages_mo",
"(",
"mo",
")",
":",
"self",
".",
"_apply_object_to_page",
"(",
"p",
",",
"mo",
",",
"overwrite",
"=",
... | This function optimizes a large store by storing a single reference to the :class:`SimMemoryObject` instead of
one for each byte.
:param memory_object: the memory object to store | [
"This",
"function",
"optimizes",
"a",
"large",
"store",
"by",
"storing",
"a",
"single",
"reference",
"to",
"the",
":",
"class",
":",
"SimMemoryObject",
"instead",
"of",
"one",
"for",
"each",
"byte",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/storage/paged_memory.py#L738-L749 | train | Stores the memory object in the memory 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/storage/paged_memory.py | SimPagedMemory.replace_memory_object | def replace_memory_object(self, old, new_content):
"""
Replaces the memory object `old` with a new memory object containing `new_content`.
:param old: A SimMemoryObject (i.e., one from :func:`memory_objects_for_hash()` or :func:`
memory_objects_for_name()`).
... | python | def replace_memory_object(self, old, new_content):
"""
Replaces the memory object `old` with a new memory object containing `new_content`.
:param old: A SimMemoryObject (i.e., one from :func:`memory_objects_for_hash()` or :func:`
memory_objects_for_name()`).
... | [
"def",
"replace_memory_object",
"(",
"self",
",",
"old",
",",
"new_content",
")",
":",
"if",
"old",
".",
"object",
".",
"size",
"(",
")",
"!=",
"new_content",
".",
"size",
"(",
")",
":",
"raise",
"SimMemoryError",
"(",
"\"memory objects can only be replaced by... | Replaces the memory object `old` with a new memory object containing `new_content`.
:param old: A SimMemoryObject (i.e., one from :func:`memory_objects_for_hash()` or :func:`
memory_objects_for_name()`).
:param new_content: The content (claripy expression) for the ne... | [
"Replaces",
"the",
"memory",
"object",
"old",
"with",
"a",
"new",
"memory",
"object",
"containing",
"new_content",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/storage/paged_memory.py#L751-L771 | train | Replaces the memory object old with a new memory object containing new_content. | 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/storage/paged_memory.py | SimPagedMemory.replace_all | def replace_all(self, old, new):
"""
Replaces all instances of expression `old` with expression `new`.
:param old: A claripy expression. Must contain at least one named variable (to make it possible to use the
name index for speedup).
:param new: The new variable to ... | python | def replace_all(self, old, new):
"""
Replaces all instances of expression `old` with expression `new`.
:param old: A claripy expression. Must contain at least one named variable (to make it possible to use the
name index for speedup).
:param new: The new variable to ... | [
"def",
"replace_all",
"(",
"self",
",",
"old",
",",
"new",
")",
":",
"if",
"options",
".",
"REVERSE_MEMORY_NAME_MAP",
"not",
"in",
"self",
".",
"state",
".",
"options",
":",
"raise",
"SimMemoryError",
"(",
"\"replace_all is not doable without a reverse name mapping.... | Replaces all instances of expression `old` with expression `new`.
:param old: A claripy expression. Must contain at least one named variable (to make it possible to use the
name index for speedup).
:param new: The new variable to replace it with. | [
"Replaces",
"all",
"instances",
"of",
"expression",
"old",
"with",
"expression",
"new",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/storage/paged_memory.py#L773-L821 | train | Replaces all instances of expression old with expression new. | 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/storage/paged_memory.py | SimPagedMemory.addrs_for_name | def addrs_for_name(self, n):
"""
Returns addresses that contain expressions that contain a variable named `n`.
"""
if n not in self._name_mapping:
return
self._mark_updated_mapping(self._name_mapping, n)
to_discard = set()
for e in self._name_mapping... | python | def addrs_for_name(self, n):
"""
Returns addresses that contain expressions that contain a variable named `n`.
"""
if n not in self._name_mapping:
return
self._mark_updated_mapping(self._name_mapping, n)
to_discard = set()
for e in self._name_mapping... | [
"def",
"addrs_for_name",
"(",
"self",
",",
"n",
")",
":",
"if",
"n",
"not",
"in",
"self",
".",
"_name_mapping",
":",
"return",
"self",
".",
"_mark_updated_mapping",
"(",
"self",
".",
"_name_mapping",
",",
"n",
")",
"to_discard",
"=",
"set",
"(",
")",
"... | Returns addresses that contain expressions that contain a variable named `n`. | [
"Returns",
"addresses",
"that",
"contain",
"expressions",
"that",
"contain",
"a",
"variable",
"named",
"n",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/storage/paged_memory.py#L926-L942 | train | Returns a generator of addresses that contain expressions that contain a variable named n. | 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/storage/paged_memory.py | SimPagedMemory.addrs_for_hash | def addrs_for_hash(self, h):
"""
Returns addresses that contain expressions that contain a variable with the hash of `h`.
"""
if h not in self._hash_mapping:
return
self._mark_updated_mapping(self._hash_mapping, h)
to_discard = set()
for e in self._h... | python | def addrs_for_hash(self, h):
"""
Returns addresses that contain expressions that contain a variable with the hash of `h`.
"""
if h not in self._hash_mapping:
return
self._mark_updated_mapping(self._hash_mapping, h)
to_discard = set()
for e in self._h... | [
"def",
"addrs_for_hash",
"(",
"self",
",",
"h",
")",
":",
"if",
"h",
"not",
"in",
"self",
".",
"_hash_mapping",
":",
"return",
"self",
".",
"_mark_updated_mapping",
"(",
"self",
".",
"_hash_mapping",
",",
"h",
")",
"to_discard",
"=",
"set",
"(",
")",
"... | Returns addresses that contain expressions that contain a variable with the hash of `h`. | [
"Returns",
"addresses",
"that",
"contain",
"expressions",
"that",
"contain",
"a",
"variable",
"with",
"the",
"hash",
"of",
"h",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/storage/paged_memory.py#L944-L960 | train | Returns a list of addresses that contain expressions that contain a variable with the hash h. | 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/storage/paged_memory.py | SimPagedMemory.flush_pages | def flush_pages(self, white_list):
"""
:param white_list: white list of page number to exclude from the flush
"""
white_list_page_number = []
for addr in white_list:
for page_addr in range(addr[0], addr[1], self._page_size):
white_list_page_number... | python | def flush_pages(self, white_list):
"""
:param white_list: white list of page number to exclude from the flush
"""
white_list_page_number = []
for addr in white_list:
for page_addr in range(addr[0], addr[1], self._page_size):
white_list_page_number... | [
"def",
"flush_pages",
"(",
"self",
",",
"white_list",
")",
":",
"white_list_page_number",
"=",
"[",
"]",
"for",
"addr",
"in",
"white_list",
":",
"for",
"page_addr",
"in",
"range",
"(",
"addr",
"[",
"0",
"]",
",",
"addr",
"[",
"1",
"]",
",",
"self",
"... | :param white_list: white list of page number to exclude from the flush | [
":",
"param",
"white_list",
":",
"white",
"list",
"of",
"page",
"number",
"to",
"exclude",
"from",
"the",
"flush"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/storage/paged_memory.py#L1079-L1098 | train | This function flushes the pages that are not in the white list. | 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/posix.py | SimSystemPosix.get_fd | def get_fd(self, fd):
"""
Looks up the SimFileDescriptor associated with the given number (an AST).
If the number is concrete and does not map to anything, return None.
If the number is symbolic, constrain it to an open fd and create a new file for it.
"""
try:
... | python | def get_fd(self, fd):
"""
Looks up the SimFileDescriptor associated with the given number (an AST).
If the number is concrete and does not map to anything, return None.
If the number is symbolic, constrain it to an open fd and create a new file for it.
"""
try:
... | [
"def",
"get_fd",
"(",
"self",
",",
"fd",
")",
":",
"try",
":",
"fd",
"=",
"self",
".",
"state",
".",
"solver",
".",
"eval_one",
"(",
"fd",
")",
"except",
"SimSolverError",
":",
"ideal",
"=",
"self",
".",
"_pick_fd",
"(",
")",
"self",
".",
"state",
... | Looks up the SimFileDescriptor associated with the given number (an AST).
If the number is concrete and does not map to anything, return None.
If the number is symbolic, constrain it to an open fd and create a new file for it. | [
"Looks",
"up",
"the",
"SimFileDescriptor",
"associated",
"with",
"the",
"given",
"number",
"(",
"an",
"AST",
")",
".",
"If",
"the",
"number",
"is",
"concrete",
"and",
"does",
"not",
"map",
"to",
"anything",
"return",
"None",
".",
"If",
"the",
"number",
"... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/posix.py#L355-L375 | train | Returns the SimFileDescriptor associated with the given number. | 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/posix.py | SimSystemPosix.close | def close(self, fd):
"""
Closes the given file descriptor (an AST).
Returns whether the operation succeeded (a concrete boolean)
"""
try:
fd = self.state.solver.eval_one(fd)
except SimSolverError:
l.error("Trying to close a symbolic file descriptor... | python | def close(self, fd):
"""
Closes the given file descriptor (an AST).
Returns whether the operation succeeded (a concrete boolean)
"""
try:
fd = self.state.solver.eval_one(fd)
except SimSolverError:
l.error("Trying to close a symbolic file descriptor... | [
"def",
"close",
"(",
"self",
",",
"fd",
")",
":",
"try",
":",
"fd",
"=",
"self",
".",
"state",
".",
"solver",
".",
"eval_one",
"(",
"fd",
")",
"except",
"SimSolverError",
":",
"l",
".",
"error",
"(",
"\"Trying to close a symbolic file descriptor\"",
")",
... | Closes the given file descriptor (an AST).
Returns whether the operation succeeded (a concrete boolean) | [
"Closes",
"the",
"given",
"file",
"descriptor",
"(",
"an",
"AST",
")",
".",
"Returns",
"whether",
"the",
"operation",
"succeeded",
"(",
"a",
"concrete",
"boolean",
")"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/posix.py#L377-L396 | train | Closes the given file descriptor. Returns True if the operation succeeded. | 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/posix.py | SimSystemPosix.sigmask | def sigmask(self, sigsetsize=None):
"""
Gets the current sigmask. If it's blank, a new one is created (of sigsetsize).
:param sigsetsize: the size (in *bytes* of the sigmask set)
:return: the sigmask
"""
if self._sigmask is None:
if sigsetsize is not None:
... | python | def sigmask(self, sigsetsize=None):
"""
Gets the current sigmask. If it's blank, a new one is created (of sigsetsize).
:param sigsetsize: the size (in *bytes* of the sigmask set)
:return: the sigmask
"""
if self._sigmask is None:
if sigsetsize is not None:
... | [
"def",
"sigmask",
"(",
"self",
",",
"sigsetsize",
"=",
"None",
")",
":",
"if",
"self",
".",
"_sigmask",
"is",
"None",
":",
"if",
"sigsetsize",
"is",
"not",
"None",
":",
"sc",
"=",
"self",
".",
"state",
".",
"solver",
".",
"eval",
"(",
"sigsetsize",
... | Gets the current sigmask. If it's blank, a new one is created (of sigsetsize).
:param sigsetsize: the size (in *bytes* of the sigmask set)
:return: the sigmask | [
"Gets",
"the",
"current",
"sigmask",
".",
"If",
"it",
"s",
"blank",
"a",
"new",
"one",
"is",
"created",
"(",
"of",
"sigsetsize",
")",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/posix.py#L425-L439 | train | Gets the current sigmask. | 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/posix.py | SimSystemPosix.sigprocmask | def sigprocmask(self, how, new_mask, sigsetsize, valid_ptr=True):
"""
Updates the signal mask.
:param how: the "how" argument of sigprocmask (see manpage)
:param new_mask: the mask modification to apply
:param sigsetsize: the size (in *bytes* of the sigmask set)
:param v... | python | def sigprocmask(self, how, new_mask, sigsetsize, valid_ptr=True):
"""
Updates the signal mask.
:param how: the "how" argument of sigprocmask (see manpage)
:param new_mask: the mask modification to apply
:param sigsetsize: the size (in *bytes* of the sigmask set)
:param v... | [
"def",
"sigprocmask",
"(",
"self",
",",
"how",
",",
"new_mask",
",",
"sigsetsize",
",",
"valid_ptr",
"=",
"True",
")",
":",
"oldmask",
"=",
"self",
".",
"sigmask",
"(",
"sigsetsize",
")",
"self",
".",
"_sigmask",
"=",
"self",
".",
"state",
".",
"solver... | Updates the signal mask.
:param how: the "how" argument of sigprocmask (see manpage)
:param new_mask: the mask modification to apply
:param sigsetsize: the size (in *bytes* of the sigmask set)
:param valid_ptr: is set if the new_mask was not NULL | [
"Updates",
"the",
"signal",
"mask",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/posix.py#L441-L463 | train | Updates the signal mask. | 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/posix.py | SimSystemPosix.dump_file_by_path | def dump_file_by_path(self, path, **kwargs):
"""
Returns the concrete content for a file by path.
:param path: file path as string
:param kwargs: passed to state.solver.eval
:return: file contents as string
"""
file = self.state.fs.get(path)
if file is No... | python | def dump_file_by_path(self, path, **kwargs):
"""
Returns the concrete content for a file by path.
:param path: file path as string
:param kwargs: passed to state.solver.eval
:return: file contents as string
"""
file = self.state.fs.get(path)
if file is No... | [
"def",
"dump_file_by_path",
"(",
"self",
",",
"path",
",",
"*",
"*",
"kwargs",
")",
":",
"file",
"=",
"self",
".",
"state",
".",
"fs",
".",
"get",
"(",
"path",
")",
"if",
"file",
"is",
"None",
":",
"return",
"None",
"return",
"file",
".",
"concreti... | Returns the concrete content for a file by path.
:param path: file path as string
:param kwargs: passed to state.solver.eval
:return: file contents as string | [
"Returns",
"the",
"concrete",
"content",
"for",
"a",
"file",
"by",
"path",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/posix.py#L540-L551 | train | Dump a file by path. | 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/posix.py | SimSystemPosix.dumps | def dumps(self, fd, **kwargs):
"""
Returns the concrete content for a file descriptor.
BACKWARD COMPATIBILITY: if you ask for file descriptors 0 1 or 2, it will return the data from stdin, stdout,
or stderr as a flat string.
:param fd: A file descriptor.
:return: Th... | python | def dumps(self, fd, **kwargs):
"""
Returns the concrete content for a file descriptor.
BACKWARD COMPATIBILITY: if you ask for file descriptors 0 1 or 2, it will return the data from stdin, stdout,
or stderr as a flat string.
:param fd: A file descriptor.
:return: Th... | [
"def",
"dumps",
"(",
"self",
",",
"fd",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"0",
"<=",
"fd",
"<=",
"2",
":",
"data",
"=",
"[",
"self",
".",
"stdin",
",",
"self",
".",
"stdout",
",",
"self",
".",
"stderr",
"]",
"[",
"fd",
"]",
".",
"con... | Returns the concrete content for a file descriptor.
BACKWARD COMPATIBILITY: if you ask for file descriptors 0 1 or 2, it will return the data from stdin, stdout,
or stderr as a flat string.
:param fd: A file descriptor.
:return: The concrete content.
:rtype: str | [
"Returns",
"the",
"concrete",
"content",
"for",
"a",
"file",
"descriptor",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/posix.py#L553-L569 | train | Dumps the concrete content for a file descriptor. | 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/concrete.py | SimEngineConcrete.to_engine | def to_engine(self, state, extra_stop_points, concretize, timeout):
"""
Handle the concrete execution of the process
This method takes care of:
1- Set the breakpoints on the addresses provided by the user
2- Concretize the symbolic variables and perform the write inside the concr... | python | def to_engine(self, state, extra_stop_points, concretize, timeout):
"""
Handle the concrete execution of the process
This method takes care of:
1- Set the breakpoints on the addresses provided by the user
2- Concretize the symbolic variables and perform the write inside the concr... | [
"def",
"to_engine",
"(",
"self",
",",
"state",
",",
"extra_stop_points",
",",
"concretize",
",",
"timeout",
")",
":",
"state",
".",
"timeout",
"=",
"False",
"state",
".",
"errored",
"=",
"False",
"extra_stop_points",
"=",
"[",
"]",
"if",
"extra_stop_points",... | Handle the concrete execution of the process
This method takes care of:
1- Set the breakpoints on the addresses provided by the user
2- Concretize the symbolic variables and perform the write inside the concrete process
3- Continue the program execution.
:param state: ... | [
"Handle",
"the",
"concrete",
"execution",
"of",
"the",
"process",
"This",
"method",
"takes",
"care",
"of",
":",
"1",
"-",
"Set",
"the",
"breakpoints",
"on",
"the",
"addresses",
"provided",
"by",
"the",
"user",
"2",
"-",
"Concretize",
"the",
"symbolic",
"va... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/concrete.py#L56-L128 | train | This method handles the concrete execution of the process. This method handles the concrete execution of the process and writes the memory to the 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/engines/concrete.py | SimEngineConcrete.check_concrete_target_methods | def check_concrete_target_methods(concrete_target):
"""
Check if the concrete target methods return the correct type of data
:return: True if the concrete target is compliant
"""
entry_point = concrete_target.read_register("pc")
if not type(entry_point) is int:
... | python | def check_concrete_target_methods(concrete_target):
"""
Check if the concrete target methods return the correct type of data
:return: True if the concrete target is compliant
"""
entry_point = concrete_target.read_register("pc")
if not type(entry_point) is int:
... | [
"def",
"check_concrete_target_methods",
"(",
"concrete_target",
")",
":",
"entry_point",
"=",
"concrete_target",
".",
"read_register",
"(",
"\"pc\"",
")",
"if",
"not",
"type",
"(",
"entry_point",
")",
"is",
"int",
":",
"l",
".",
"error",
"(",
"\"read_register re... | Check if the concrete target methods return the correct type of data
:return: True if the concrete target is compliant | [
"Check",
"if",
"the",
"concrete",
"target",
"methods",
"return",
"the",
"correct",
"type",
"of",
"data",
":",
"return",
":",
"True",
"if",
"the",
"concrete",
"target",
"is",
"compliant"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/concrete.py#L131-L163 | train | Check if the concrete target methods return the correct type of data
| 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/vex/engine.py | SimEngineVEX.process | def process(self, state,
irsb=None,
skip_stmts=0,
last_stmt=99999999,
whitelist=None,
inline=False,
force_addr=None,
insn_bytes=None,
size=None,
num_inst=None,
traceflags=0,
thumb=False,
... | python | def process(self, state,
irsb=None,
skip_stmts=0,
last_stmt=99999999,
whitelist=None,
inline=False,
force_addr=None,
insn_bytes=None,
size=None,
num_inst=None,
traceflags=0,
thumb=False,
... | [
"def",
"process",
"(",
"self",
",",
"state",
",",
"irsb",
"=",
"None",
",",
"skip_stmts",
"=",
"0",
",",
"last_stmt",
"=",
"99999999",
",",
"whitelist",
"=",
"None",
",",
"inline",
"=",
"False",
",",
"force_addr",
"=",
"None",
",",
"insn_bytes",
"=",
... | :param state: The state with which to execute
:param irsb: The PyVEX IRSB object to use for execution. If not provided one will be lifted.
:param skip_stmts: The number of statements to skip in processing
:param last_stmt: Do not execute any statements after this statement
... | [
":",
"param",
"state",
":",
"The",
"state",
"with",
"which",
"to",
"execute",
":",
"param",
"irsb",
":",
"The",
"PyVEX",
"IRSB",
"object",
"to",
"use",
"for",
"execution",
".",
"If",
"not",
"provided",
"one",
"will",
"be",
"lifted",
".",
":",
"param",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/vex/engine.py#L88-L147 | train | Executes the given state and returns a list of SimSuccessors 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/engines/vex/engine.py | SimEngineVEX._handle_statement | def _handle_statement(self, state, successors, stmt):
"""
This function receives an initial state and imark and processes a list of pyvex.IRStmts
It annotates the request with a final state, last imark, and a list of SimIRStmts
"""
if type(stmt) == pyvex.IRStmt.IMark:
... | python | def _handle_statement(self, state, successors, stmt):
"""
This function receives an initial state and imark and processes a list of pyvex.IRStmts
It annotates the request with a final state, last imark, and a list of SimIRStmts
"""
if type(stmt) == pyvex.IRStmt.IMark:
... | [
"def",
"_handle_statement",
"(",
"self",
",",
"state",
",",
"successors",
",",
"stmt",
")",
":",
"if",
"type",
"(",
"stmt",
")",
"==",
"pyvex",
".",
"IRStmt",
".",
"IMark",
":",
"# TODO how much of this could be moved into the imark handler",
"ins_addr",
"=",
"s... | This function receives an initial state and imark and processes a list of pyvex.IRStmts
It annotates the request with a final state, last imark, and a list of SimIRStmts | [
"This",
"function",
"receives",
"an",
"initial",
"state",
"and",
"imark",
"and",
"processes",
"a",
"list",
"of",
"pyvex",
".",
"IRStmts",
"It",
"annotates",
"the",
"request",
"with",
"a",
"final",
"state",
"last",
"imark",
"and",
"a",
"list",
"of",
"SimIRS... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/vex/engine.py#L362-L439 | train | This function handles the single 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/engines/vex/engine.py | SimEngineVEX.lift | def lift(self,
state=None,
clemory=None,
insn_bytes=None,
arch=None,
addr=None,
size=None,
num_inst=None,
traceflags=0,
thumb=False,
extra_stop_points=None,
opt_level=None,
... | python | def lift(self,
state=None,
clemory=None,
insn_bytes=None,
arch=None,
addr=None,
size=None,
num_inst=None,
traceflags=0,
thumb=False,
extra_stop_points=None,
opt_level=None,
... | [
"def",
"lift",
"(",
"self",
",",
"state",
"=",
"None",
",",
"clemory",
"=",
"None",
",",
"insn_bytes",
"=",
"None",
",",
"arch",
"=",
"None",
",",
"addr",
"=",
"None",
",",
"size",
"=",
"None",
",",
"num_inst",
"=",
"None",
",",
"traceflags",
"=",
... | Lift an IRSB.
There are many possible valid sets of parameters. You at the very least must pass some
source of data, some source of an architecture, and some source of an address.
Sources of data in order of priority: insn_bytes, clemory, state
Sources of an address, in order of prior... | [
"Lift",
"an",
"IRSB",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/vex/engine.py#L466-L641 | train | This function takes a state clemory instruction bytes and arch and a cle. memory. Clemory object and a state object and a state object and a cle. memory. Clemory object and a state object and a state object and a state object and a cle. memory. Clemory object and a state object and a 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/engines/vex/engine.py | SimEngineVEX._first_stoppoint | def _first_stoppoint(self, irsb, extra_stop_points=None):
"""
Enumerate the imarks in the block. If any of them (after the first one) are at a stop point, returns the address
of the stop point. None is returned otherwise.
"""
if self._stop_points is None and extra_stop_points is ... | python | def _first_stoppoint(self, irsb, extra_stop_points=None):
"""
Enumerate the imarks in the block. If any of them (after the first one) are at a stop point, returns the address
of the stop point. None is returned otherwise.
"""
if self._stop_points is None and extra_stop_points is ... | [
"def",
"_first_stoppoint",
"(",
"self",
",",
"irsb",
",",
"extra_stop_points",
"=",
"None",
")",
":",
"if",
"self",
".",
"_stop_points",
"is",
"None",
"and",
"extra_stop_points",
"is",
"None",
"and",
"self",
".",
"project",
"is",
"None",
":",
"return",
"No... | Enumerate the imarks in the block. If any of them (after the first one) are at a stop point, returns the address
of the stop point. None is returned otherwise. | [
"Enumerate",
"the",
"imarks",
"in",
"the",
"block",
".",
"If",
"any",
"of",
"them",
"(",
"after",
"the",
"first",
"one",
")",
"are",
"at",
"a",
"stop",
"point",
"returns",
"the",
"address",
"of",
"the",
"stop",
"point",
".",
"None",
"is",
"returned",
... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/engines/vex/engine.py#L712-L732 | train | Enumerate the imarks in the block and return the first stop 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/knowledge_plugins/functions/function_manager.py | FunctionManager._genenare_callmap_sif | def _genenare_callmap_sif(self, filepath):
"""
Generate a sif file from the call map.
:param filepath: Path of the sif file
:return: None
"""
with open(filepath, "wb") as f:
for src, dst in self.callgraph.edges():
f.write("%#x\tD... | python | def _genenare_callmap_sif(self, filepath):
"""
Generate a sif file from the call map.
:param filepath: Path of the sif file
:return: None
"""
with open(filepath, "wb") as f:
for src, dst in self.callgraph.edges():
f.write("%#x\tD... | [
"def",
"_genenare_callmap_sif",
"(",
"self",
",",
"filepath",
")",
":",
"with",
"open",
"(",
"filepath",
",",
"\"wb\"",
")",
"as",
"f",
":",
"for",
"src",
",",
"dst",
"in",
"self",
".",
"callgraph",
".",
"edges",
"(",
")",
":",
"f",
".",
"write",
"... | Generate a sif file from the call map.
:param filepath: Path of the sif file
:return: None | [
"Generate",
"a",
"sif",
"file",
"from",
"the",
"call",
"map",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function_manager.py#L91-L100 | train | Generate a sif file from the call map. | 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/functions/function_manager.py | FunctionManager.ceiling_func | def ceiling_func(self, addr):
"""
Return the function who has the least address that is greater than or equal to `addr`.
:param int addr: The address to query.
:return: A Function instance, or None if there is no other function after `addr`.
:rtype: Function or ... | python | def ceiling_func(self, addr):
"""
Return the function who has the least address that is greater than or equal to `addr`.
:param int addr: The address to query.
:return: A Function instance, or None if there is no other function after `addr`.
:rtype: Function or ... | [
"def",
"ceiling_func",
"(",
"self",
",",
"addr",
")",
":",
"try",
":",
"next_addr",
"=",
"self",
".",
"_function_map",
".",
"ceiling_addr",
"(",
"addr",
")",
"return",
"self",
".",
"_function_map",
".",
"get",
"(",
"next_addr",
")",
"except",
"KeyError",
... | Return the function who has the least address that is greater than or equal to `addr`.
:param int addr: The address to query.
:return: A Function instance, or None if there is no other function after `addr`.
:rtype: Function or None | [
"Return",
"the",
"function",
"who",
"has",
"the",
"least",
"address",
"that",
"is",
"greater",
"than",
"or",
"equal",
"to",
"addr",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function_manager.py#L287-L301 | train | Returns the function who has the least address that is greater than or equal to 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/knowledge_plugins/functions/function_manager.py | FunctionManager.floor_func | def floor_func(self, addr):
"""
Return the function who has the greatest address that is less than or equal to `addr`.
:param int addr: The address to query.
:return: A Function instance, or None if there is no other function before `addr`.
:rtype: Function or N... | python | def floor_func(self, addr):
"""
Return the function who has the greatest address that is less than or equal to `addr`.
:param int addr: The address to query.
:return: A Function instance, or None if there is no other function before `addr`.
:rtype: Function or N... | [
"def",
"floor_func",
"(",
"self",
",",
"addr",
")",
":",
"try",
":",
"prev_addr",
"=",
"self",
".",
"_function_map",
".",
"floor_addr",
"(",
"addr",
")",
"return",
"self",
".",
"_function_map",
"[",
"prev_addr",
"]",
"except",
"KeyError",
":",
"return",
... | Return the function who has the greatest address that is less than or equal to `addr`.
:param int addr: The address to query.
:return: A Function instance, or None if there is no other function before `addr`.
:rtype: Function or None | [
"Return",
"the",
"function",
"who",
"has",
"the",
"greatest",
"address",
"that",
"is",
"less",
"than",
"or",
"equal",
"to",
"addr",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function_manager.py#L303-L317 | train | Returns the function who has the greatest address that is less than or equal to 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/knowledge_plugins/functions/function_manager.py | FunctionManager.function | def function(self, addr=None, name=None, create=False, syscall=False, plt=None):
"""
Get a function object from the function manager.
Pass either `addr` or `name` with the appropriate values.
:param int addr: Address of the function.
:param str name: Name of the function.
... | python | def function(self, addr=None, name=None, create=False, syscall=False, plt=None):
"""
Get a function object from the function manager.
Pass either `addr` or `name` with the appropriate values.
:param int addr: Address of the function.
:param str name: Name of the function.
... | [
"def",
"function",
"(",
"self",
",",
"addr",
"=",
"None",
",",
"name",
"=",
"None",
",",
"create",
"=",
"False",
",",
"syscall",
"=",
"False",
",",
"plt",
"=",
"None",
")",
":",
"if",
"addr",
"is",
"not",
"None",
":",
"try",
":",
"f",
"=",
"sel... | Get a function object from the function manager.
Pass either `addr` or `name` with the appropriate values.
:param int addr: Address of the function.
:param str name: Name of the function.
:param bool create: Whether to create the function or not if the function does not exist.
... | [
"Get",
"a",
"function",
"object",
"from",
"the",
"function",
"manager",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function_manager.py#L319-L354 | train | Returns a Function instance from the function manager. | 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/cdg.py | CDG.get_dependants | def get_dependants(self, run):
"""
Return a list of nodes that are control dependent on the given node in the control dependence graph
"""
if run in self._graph.nodes():
return list(self._graph.successors(run))
else:
return [] | python | def get_dependants(self, run):
"""
Return a list of nodes that are control dependent on the given node in the control dependence graph
"""
if run in self._graph.nodes():
return list(self._graph.successors(run))
else:
return [] | [
"def",
"get_dependants",
"(",
"self",
",",
"run",
")",
":",
"if",
"run",
"in",
"self",
".",
"_graph",
".",
"nodes",
"(",
")",
":",
"return",
"list",
"(",
"self",
".",
"_graph",
".",
"successors",
"(",
"run",
")",
")",
"else",
":",
"return",
"[",
... | Return a list of nodes that are control dependent on the given node in the control dependence graph | [
"Return",
"a",
"list",
"of",
"nodes",
"that",
"are",
"control",
"dependent",
"on",
"the",
"given",
"node",
"in",
"the",
"control",
"dependence",
"graph"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cdg.py#L62-L69 | train | Returns a list of nodes that are control dependent on the given node in the control dependence 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/analyses/cdg.py | CDG.get_guardians | def get_guardians(self, run):
"""
Return a list of nodes on whom the specific node is control dependent in the control dependence graph
"""
if run in self._graph.nodes():
return list(self._graph.predecessors(run))
else:
return [] | python | def get_guardians(self, run):
"""
Return a list of nodes on whom the specific node is control dependent in the control dependence graph
"""
if run in self._graph.nodes():
return list(self._graph.predecessors(run))
else:
return [] | [
"def",
"get_guardians",
"(",
"self",
",",
"run",
")",
":",
"if",
"run",
"in",
"self",
".",
"_graph",
".",
"nodes",
"(",
")",
":",
"return",
"list",
"(",
"self",
".",
"_graph",
".",
"predecessors",
"(",
"run",
")",
")",
"else",
":",
"return",
"[",
... | Return a list of nodes on whom the specific node is control dependent in the control dependence graph | [
"Return",
"a",
"list",
"of",
"nodes",
"on",
"whom",
"the",
"specific",
"node",
"is",
"control",
"dependent",
"in",
"the",
"control",
"dependence",
"graph"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cdg.py#L71-L78 | train | Returns a list of nodes on whom the specific node is control dependent in the control dependence 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/analyses/cdg.py | CDG._construct | def _construct(self):
"""
Construct a control dependence graph.
This implementation is based on figure 6 of paper An Efficient Method of Computing Static Single Assignment
Form by Ron Cytron, etc.
"""
self._acyclic_cfg = self._cfg.copy()
# TODO: Cycle-removing i... | python | def _construct(self):
"""
Construct a control dependence graph.
This implementation is based on figure 6 of paper An Efficient Method of Computing Static Single Assignment
Form by Ron Cytron, etc.
"""
self._acyclic_cfg = self._cfg.copy()
# TODO: Cycle-removing i... | [
"def",
"_construct",
"(",
"self",
")",
":",
"self",
".",
"_acyclic_cfg",
"=",
"self",
".",
"_cfg",
".",
"copy",
"(",
")",
"# TODO: Cycle-removing is not needed - confirm it later",
"# The CFG we use should be acyclic!",
"#self._acyclic_cfg.remove_cycles()",
"# Pre-process the... | Construct a control dependence graph.
This implementation is based on figure 6 of paper An Efficient Method of Computing Static Single Assignment
Form by Ron Cytron, etc. | [
"Construct",
"a",
"control",
"dependence",
"graph",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cdg.py#L84-L112 | train | Construct a control dependence graph for the current CFG and the tree that is acyclic. | 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/cdg.py | CDG._pre_process_cfg | def _pre_process_cfg(self):
"""
Pre-process the acyclic CFG.
- Change all FakeRet edges to normal edges when necessary (e.g. the normal/expected return edge does not exist)
"""
for _, dst, data in self._acyclic_cfg.graph.edges(data=True):
if 'jumpkind' in data and dat... | python | def _pre_process_cfg(self):
"""
Pre-process the acyclic CFG.
- Change all FakeRet edges to normal edges when necessary (e.g. the normal/expected return edge does not exist)
"""
for _, dst, data in self._acyclic_cfg.graph.edges(data=True):
if 'jumpkind' in data and dat... | [
"def",
"_pre_process_cfg",
"(",
"self",
")",
":",
"for",
"_",
",",
"dst",
",",
"data",
"in",
"self",
".",
"_acyclic_cfg",
".",
"graph",
".",
"edges",
"(",
"data",
"=",
"True",
")",
":",
"if",
"'jumpkind'",
"in",
"data",
"and",
"data",
"[",
"'jumpkind... | Pre-process the acyclic CFG.
- Change all FakeRet edges to normal edges when necessary (e.g. the normal/expected return edge does not exist) | [
"Pre",
"-",
"process",
"the",
"acyclic",
"CFG",
".",
"-",
"Change",
"all",
"FakeRet",
"edges",
"to",
"normal",
"edges",
"when",
"necessary",
"(",
"e",
".",
"g",
".",
"the",
"normal",
"/",
"expected",
"return",
"edge",
"does",
"not",
"exist",
")"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cdg.py#L116-L128 | train | Pre - process the acyclic CFG. | 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/cdg.py | CDG._post_process | def _post_process(self):
"""
There are cases where a loop has two overlapping loop headers thanks
to the way VEX is dealing with continuous instructions. As we were
breaking the connection between the second loop header and its
successor, we shall restore them in our CDG.
... | python | def _post_process(self):
"""
There are cases where a loop has two overlapping loop headers thanks
to the way VEX is dealing with continuous instructions. As we were
breaking the connection between the second loop header and its
successor, we shall restore them in our CDG.
... | [
"def",
"_post_process",
"(",
"self",
")",
":",
"# TODO: Verify its correctness",
"loop_back_edges",
"=",
"self",
".",
"_cfg",
".",
"get_loop_back_edges",
"(",
")",
"for",
"b1",
",",
"b2",
"in",
"loop_back_edges",
":",
"self",
".",
"_graph",
".",
"add_edge",
"(... | There are cases where a loop has two overlapping loop headers thanks
to the way VEX is dealing with continuous instructions. As we were
breaking the connection between the second loop header and its
successor, we shall restore them in our CDG. | [
"There",
"are",
"cases",
"where",
"a",
"loop",
"has",
"two",
"overlapping",
"loop",
"headers",
"thanks",
"to",
"the",
"way",
"VEX",
"is",
"dealing",
"with",
"continuous",
"instructions",
".",
"As",
"we",
"were",
"breaking",
"the",
"connection",
"between",
"t... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cdg.py#L130-L140 | train | Add edges to the 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/analyses/cdg.py | CDG._pd_post_process | def _pd_post_process(self, cfg):
"""
Take care of those loop headers/tails where we manually broke their
connection to the next BBL
"""
loop_back_edges = self._cfg.get_loop_back_edges()
for b1, b2 in loop_back_edges:
# The edge between b1 and b2 is manually b... | python | def _pd_post_process(self, cfg):
"""
Take care of those loop headers/tails where we manually broke their
connection to the next BBL
"""
loop_back_edges = self._cfg.get_loop_back_edges()
for b1, b2 in loop_back_edges:
# The edge between b1 and b2 is manually b... | [
"def",
"_pd_post_process",
"(",
"self",
",",
"cfg",
")",
":",
"loop_back_edges",
"=",
"self",
".",
"_cfg",
".",
"get_loop_back_edges",
"(",
")",
"for",
"b1",
",",
"b2",
"in",
"loop_back_edges",
":",
"# The edge between b1 and b2 is manually broken",
"# The post domi... | Take care of those loop headers/tails where we manually broke their
connection to the next BBL | [
"Take",
"care",
"of",
"those",
"loop",
"headers",
"/",
"tails",
"where",
"we",
"manually",
"broke",
"their",
"connection",
"to",
"the",
"next",
"BBL"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/cdg.py#L171-L188 | train | Process the post dominator of the BBL. | 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/variables/variable_manager.py | VariableManagerInternal.make_phi_node | def make_phi_node(self, block_addr, *variables):
"""
Create a phi variable for variables at block `block_addr`.
:param int block_addr: The address of the current block.
:param variables: Variables that the phi variable represents.
:return: The created phi v... | python | def make_phi_node(self, block_addr, *variables):
"""
Create a phi variable for variables at block `block_addr`.
:param int block_addr: The address of the current block.
:param variables: Variables that the phi variable represents.
:return: The created phi v... | [
"def",
"make_phi_node",
"(",
"self",
",",
"block_addr",
",",
"*",
"variables",
")",
":",
"existing_phis",
"=",
"set",
"(",
")",
"non_phis",
"=",
"set",
"(",
")",
"for",
"var",
"in",
"variables",
":",
"if",
"self",
".",
"is_phi_variable",
"(",
"var",
")... | Create a phi variable for variables at block `block_addr`.
:param int block_addr: The address of the current block.
:param variables: Variables that the phi variable represents.
:return: The created phi variable. | [
"Create",
"a",
"phi",
"variable",
"for",
"variables",
"at",
"block",
"block_addr",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/variables/variable_manager.py#L125-L168 | train | Create a phi variable for variables at the current 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/knowledge_plugins/variables/variable_manager.py | VariableManagerInternal.get_variables | def get_variables(self, sort=None, collapse_same_ident=False):
"""
Get a list of variables.
:param str or None sort: Sort of the variable to get.
:param collapse_same_ident: Whether variables of the same identifier should be collapsed or not.
:return: A lis... | python | def get_variables(self, sort=None, collapse_same_ident=False):
"""
Get a list of variables.
:param str or None sort: Sort of the variable to get.
:param collapse_same_ident: Whether variables of the same identifier should be collapsed or not.
:return: A lis... | [
"def",
"get_variables",
"(",
"self",
",",
"sort",
"=",
"None",
",",
"collapse_same_ident",
"=",
"False",
")",
":",
"variables",
"=",
"[",
"]",
"if",
"collapse_same_ident",
":",
"raise",
"NotImplementedError",
"(",
")",
"for",
"var",
"in",
"self",
".",
"_va... | Get a list of variables.
:param str or None sort: Sort of the variable to get.
:param collapse_same_ident: Whether variables of the same identifier should be collapsed or not.
:return: A list of variables.
:rtype: list | [
"Get",
"a",
"list",
"of",
"variables",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/variables/variable_manager.py#L253-L275 | train | Get a list of variables. | 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/variables/variable_manager.py | VariableManagerInternal.get_phi_subvariables | def get_phi_subvariables(self, var):
"""
Get sub-variables that phi variable `var` represents.
:param SimVariable var: The variable instance.
:return: A set of sub-variables, or an empty set if `var` is not a phi variable.
:rtype: set
"""
... | python | def get_phi_subvariables(self, var):
"""
Get sub-variables that phi variable `var` represents.
:param SimVariable var: The variable instance.
:return: A set of sub-variables, or an empty set if `var` is not a phi variable.
:rtype: set
"""
... | [
"def",
"get_phi_subvariables",
"(",
"self",
",",
"var",
")",
":",
"if",
"not",
"self",
".",
"is_phi_variable",
"(",
"var",
")",
":",
"return",
"set",
"(",
")",
"return",
"self",
".",
"_phi_variables",
"[",
"var",
"]"
] | Get sub-variables that phi variable `var` represents.
:param SimVariable var: The variable instance.
:return: A set of sub-variables, or an empty set if `var` is not a phi variable.
:rtype: set | [
"Get",
"sub",
"-",
"variables",
"that",
"phi",
"variable",
"var",
"represents",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/variables/variable_manager.py#L288-L299 | train | Returns a set of sub - variables that phi variable var represents. | 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/variables/variable_manager.py | VariableManagerInternal.get_phi_variables | def get_phi_variables(self, block_addr):
"""
Get a dict of phi variables and their corresponding variables.
:param int block_addr: Address of the block.
:return: A dict of phi variables of an empty dict if there are no phi variables at the block.
:rtype: ... | python | def get_phi_variables(self, block_addr):
"""
Get a dict of phi variables and their corresponding variables.
:param int block_addr: Address of the block.
:return: A dict of phi variables of an empty dict if there are no phi variables at the block.
:rtype: ... | [
"def",
"get_phi_variables",
"(",
"self",
",",
"block_addr",
")",
":",
"if",
"block_addr",
"not",
"in",
"self",
".",
"_phi_variables_by_block",
":",
"return",
"dict",
"(",
")",
"variables",
"=",
"{",
"}",
"for",
"phi",
"in",
"self",
".",
"_phi_variables_by_bl... | Get a dict of phi variables and their corresponding variables.
:param int block_addr: Address of the block.
:return: A dict of phi variables of an empty dict if there are no phi variables at the block.
:rtype: dict | [
"Get",
"a",
"dict",
"of",
"phi",
"variables",
"and",
"their",
"corresponding",
"variables",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/variables/variable_manager.py#L301-L315 | train | Get a dict of phi variables and their corresponding variables. | 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/variables/variable_manager.py | VariableManagerInternal.input_variables | def input_variables(self, exclude_specials=True):
"""
Get all variables that have never been written to.
:return: A list of variables that are never written to.
"""
def has_write_access(accesses):
return any(acc for acc in accesses if acc.access_type == 'write')
... | python | def input_variables(self, exclude_specials=True):
"""
Get all variables that have never been written to.
:return: A list of variables that are never written to.
"""
def has_write_access(accesses):
return any(acc for acc in accesses if acc.access_type == 'write')
... | [
"def",
"input_variables",
"(",
"self",
",",
"exclude_specials",
"=",
"True",
")",
":",
"def",
"has_write_access",
"(",
"accesses",
")",
":",
"return",
"any",
"(",
"acc",
"for",
"acc",
"in",
"accesses",
"if",
"acc",
".",
"access_type",
"==",
"'write'",
")",... | Get all variables that have never been written to.
:return: A list of variables that are never written to. | [
"Get",
"all",
"variables",
"that",
"have",
"never",
"been",
"written",
"to",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/variables/variable_manager.py#L317-L337 | train | Get all variables that have never been written to. | 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/variables/variable_manager.py | VariableManagerInternal.assign_variable_names | def assign_variable_names(self):
"""
Assign default names to all variables.
:return: None
"""
for var in self._variables:
if isinstance(var, SimStackVariable):
if var.name is not None:
continue
if var.ident.startsw... | python | def assign_variable_names(self):
"""
Assign default names to all variables.
:return: None
"""
for var in self._variables:
if isinstance(var, SimStackVariable):
if var.name is not None:
continue
if var.ident.startsw... | [
"def",
"assign_variable_names",
"(",
"self",
")",
":",
"for",
"var",
"in",
"self",
".",
"_variables",
":",
"if",
"isinstance",
"(",
"var",
",",
"SimStackVariable",
")",
":",
"if",
"var",
".",
"name",
"is",
"not",
"None",
":",
"continue",
"if",
"var",
"... | Assign default names to all variables.
:return: None | [
"Assign",
"default",
"names",
"to",
"all",
"variables",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/variables/variable_manager.py#L339-L358 | train | Assign default names to all variables. | 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/variables/variable_manager.py | VariableManager.get_variable_accesses | def get_variable_accesses(self, variable, same_name=False):
"""
Get a list of all references to the given variable.
:param SimVariable variable: The variable.
:param bool same_name: Whether to include all variables with the same variable name, or just
... | python | def get_variable_accesses(self, variable, same_name=False):
"""
Get a list of all references to the given variable.
:param SimVariable variable: The variable.
:param bool same_name: Whether to include all variables with the same variable name, or just
... | [
"def",
"get_variable_accesses",
"(",
"self",
",",
"variable",
",",
"same_name",
"=",
"False",
")",
":",
"if",
"variable",
".",
"region",
"==",
"'global'",
":",
"return",
"self",
".",
"global_manager",
".",
"get_variable_accesses",
"(",
"variable",
",",
"same_n... | Get a list of all references to the given variable.
:param SimVariable variable: The variable.
:param bool same_name: Whether to include all variables with the same variable name, or just
based on the variable identifier.
:retur... | [
"Get",
"a",
"list",
"of",
"all",
"references",
"to",
"the",
"given",
"variable",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/variables/variable_manager.py#L405-L423 | train | Get a list of all references to the given variable. | 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/callable.py | Callable.call_c | def call_c(self, c_args):
"""
Call this Callable with a string of C-style arguments.
:param str c_args: C-style arguments.
:return: The return value from the call.
:rtype: claripy.Ast
"""
c_args = c_args.strip()
if c_args[0] != "(... | python | def call_c(self, c_args):
"""
Call this Callable with a string of C-style arguments.
:param str c_args: C-style arguments.
:return: The return value from the call.
:rtype: claripy.Ast
"""
c_args = c_args.strip()
if c_args[0] != "(... | [
"def",
"call_c",
"(",
"self",
",",
"c_args",
")",
":",
"c_args",
"=",
"c_args",
".",
"strip",
"(",
")",
"if",
"c_args",
"[",
"0",
"]",
"!=",
"\"(\"",
":",
"c_args",
"=",
"\"(\"",
"+",
"c_args",
"if",
"c_args",
"[",
"-",
"1",
"]",
"!=",
"\")\"",
... | Call this Callable with a string of C-style arguments.
:param str c_args: C-style arguments.
:return: The return value from the call.
:rtype: claripy.Ast | [
"Call",
"this",
"Callable",
"with",
"a",
"string",
"of",
"C",
"-",
"style",
"arguments",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/callable.py#L84-L125 | train | This is a private method that is called by the function that is called by 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/state_plugins/history.py | SimStateHistory.trim | def trim(self):
"""
Discard the ancestry of this state.
"""
new_hist = self.copy({})
new_hist.parent = None
self.state.register_plugin('history', new_hist) | python | def trim(self):
"""
Discard the ancestry of this state.
"""
new_hist = self.copy({})
new_hist.parent = None
self.state.register_plugin('history', new_hist) | [
"def",
"trim",
"(",
"self",
")",
":",
"new_hist",
"=",
"self",
".",
"copy",
"(",
"{",
"}",
")",
"new_hist",
".",
"parent",
"=",
"None",
"self",
".",
"state",
".",
"register_plugin",
"(",
"'history'",
",",
"new_hist",
")"
] | Discard the ancestry of this state. | [
"Discard",
"the",
"ancestry",
"of",
"this",
"state",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/history.py#L147-L153 | train | Discard the ancestry of this 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/state_plugins/history.py | SimStateHistory.filter_actions | def filter_actions(self, block_addr=None, block_stmt=None, insn_addr=None, read_from=None, write_to=None):
"""
Filter self.actions based on some common parameters.
:param block_addr: Only return actions generated in blocks starting at this address.
:param block_stmt: Only return actio... | python | def filter_actions(self, block_addr=None, block_stmt=None, insn_addr=None, read_from=None, write_to=None):
"""
Filter self.actions based on some common parameters.
:param block_addr: Only return actions generated in blocks starting at this address.
:param block_stmt: Only return actio... | [
"def",
"filter_actions",
"(",
"self",
",",
"block_addr",
"=",
"None",
",",
"block_stmt",
"=",
"None",
",",
"insn_addr",
"=",
"None",
",",
"read_from",
"=",
"None",
",",
"write_to",
"=",
"None",
")",
":",
"if",
"read_from",
"is",
"not",
"None",
":",
"if... | Filter self.actions based on some common parameters.
:param block_addr: Only return actions generated in blocks starting at this address.
:param block_stmt: Only return actions generated in the nth statement of each block.
:param insn_addr: Only return actions generated in the assembly inst... | [
"Filter",
"self",
".",
"actions",
"based",
"on",
"some",
"common",
"parameters",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/history.py#L155-L253 | train | Filter self. actions based on some common parameters. | 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/history.py | SimStateHistory.closest_common_ancestor | def closest_common_ancestor(self, other):
"""
Find the common ancestor between this history node and 'other'.
:param other: the PathHistory to find a common ancestor with.
:return: the common ancestor SimStateHistory, or None if there isn't one
"""
our_history_... | python | def closest_common_ancestor(self, other):
"""
Find the common ancestor between this history node and 'other'.
:param other: the PathHistory to find a common ancestor with.
:return: the common ancestor SimStateHistory, or None if there isn't one
"""
our_history_... | [
"def",
"closest_common_ancestor",
"(",
"self",
",",
"other",
")",
":",
"our_history_iter",
"=",
"reversed",
"(",
"HistoryIter",
"(",
"self",
")",
")",
"their_history_iter",
"=",
"reversed",
"(",
"HistoryIter",
"(",
"other",
")",
")",
"sofar",
"=",
"set",
"("... | Find the common ancestor between this history node and 'other'.
:param other: the PathHistory to find a common ancestor with.
:return: the common ancestor SimStateHistory, or None if there isn't one | [
"Find",
"the",
"common",
"ancestor",
"between",
"this",
"history",
"node",
"and",
"other",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/history.py#L382-L419 | train | Find the common ancestor between this path history node and other. | 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/history.py | SimStateHistory.constraints_since | def constraints_since(self, other):
"""
Returns the constraints that have been accumulated since `other`.
:param other: a prior PathHistory object
:returns: a list of constraints
"""
constraints = [ ]
cur = self
while cur is not other and cur is not None... | python | def constraints_since(self, other):
"""
Returns the constraints that have been accumulated since `other`.
:param other: a prior PathHistory object
:returns: a list of constraints
"""
constraints = [ ]
cur = self
while cur is not other and cur is not None... | [
"def",
"constraints_since",
"(",
"self",
",",
"other",
")",
":",
"constraints",
"=",
"[",
"]",
"cur",
"=",
"self",
"while",
"cur",
"is",
"not",
"other",
"and",
"cur",
"is",
"not",
"None",
":",
"constraints",
".",
"extend",
"(",
"cur",
".",
"recent_cons... | Returns the constraints that have been accumulated since `other`.
:param other: a prior PathHistory object
:returns: a list of constraints | [
"Returns",
"the",
"constraints",
"that",
"have",
"been",
"accumulated",
"since",
"other",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/history.py#L421-L434 | train | Returns the list of constraints that have been accumulated since other. | 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/history.py | TreeIter.count | def count(self, v):
"""
Count occurrences of value v in the entire history. Note that the subclass must implement the __reversed__
method, otherwise an exception will be thrown.
:param object v: The value to look for
:return: The number of occurrences
:rtype: int
... | python | def count(self, v):
"""
Count occurrences of value v in the entire history. Note that the subclass must implement the __reversed__
method, otherwise an exception will be thrown.
:param object v: The value to look for
:return: The number of occurrences
:rtype: int
... | [
"def",
"count",
"(",
"self",
",",
"v",
")",
":",
"ctr",
"=",
"0",
"for",
"item",
"in",
"reversed",
"(",
"self",
")",
":",
"if",
"item",
"==",
"v",
":",
"ctr",
"+=",
"1",
"return",
"ctr"
] | Count occurrences of value v in the entire history. Note that the subclass must implement the __reversed__
method, otherwise an exception will be thrown.
:param object v: The value to look for
:return: The number of occurrences
:rtype: int | [
"Count",
"occurrences",
"of",
"value",
"v",
"in",
"the",
"entire",
"history",
".",
"Note",
"that",
"the",
"subclass",
"must",
"implement",
"the",
"__reversed__",
"method",
"otherwise",
"an",
"exception",
"will",
"be",
"thrown",
".",
":",
"param",
"object",
"... | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/history.py#L478-L490 | train | Count the number of occurrences of value v in the entire history. | 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/region_identifier.py | RegionIdentifier.slice_graph | def slice_graph(graph, node, frontier, include_frontier=False):
"""
Generate a slice of the graph from the head node to the given frontier.
:param networkx.DiGraph graph: The graph to work on.
:param node: The starting node in the graph.
:param frontier: A list of frontier nodes... | python | def slice_graph(graph, node, frontier, include_frontier=False):
"""
Generate a slice of the graph from the head node to the given frontier.
:param networkx.DiGraph graph: The graph to work on.
:param node: The starting node in the graph.
:param frontier: A list of frontier nodes... | [
"def",
"slice_graph",
"(",
"graph",
",",
"node",
",",
"frontier",
",",
"include_frontier",
"=",
"False",
")",
":",
"subgraph",
"=",
"networkx",
".",
"DiGraph",
"(",
")",
"for",
"frontier_node",
"in",
"frontier",
":",
"for",
"simple_path",
"in",
"networkx",
... | Generate a slice of the graph from the head node to the given frontier.
:param networkx.DiGraph graph: The graph to work on.
:param node: The starting node in the graph.
:param frontier: A list of frontier nodes.
:param bool include_frontier: Whether the frontier nodes are included in t... | [
"Generate",
"a",
"slice",
"of",
"the",
"graph",
"from",
"the",
"head",
"node",
"to",
"the",
"given",
"frontier",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/decompiler/region_identifier.py#L159-L183 | train | Generate a slice of the graph from the given node to the given frontier. | 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/common.py | condition_to_lambda | def condition_to_lambda(condition, default=False):
"""
Translates an integer, set, list or function into a lambda that checks if state's current basic block matches
some condition.
:param condition: An integer, set, list or lambda to convert to a lambda.
:param default: The default return val... | python | def condition_to_lambda(condition, default=False):
"""
Translates an integer, set, list or function into a lambda that checks if state's current basic block matches
some condition.
:param condition: An integer, set, list or lambda to convert to a lambda.
:param default: The default return val... | [
"def",
"condition_to_lambda",
"(",
"condition",
",",
"default",
"=",
"False",
")",
":",
"if",
"condition",
"is",
"None",
":",
"condition_function",
"=",
"lambda",
"state",
":",
"default",
"static_addrs",
"=",
"set",
"(",
")",
"elif",
"isinstance",
"(",
"cond... | Translates an integer, set, list or function into a lambda that checks if state's current basic block matches
some condition.
:param condition: An integer, set, list or lambda to convert to a lambda.
:param default: The default return value of the lambda (in case condition is None). Default: false.
... | [
"Translates",
"an",
"integer",
"set",
"list",
"or",
"function",
"into",
"a",
"lambda",
"that",
"checks",
"if",
"state",
"s",
"current",
"basic",
"block",
"matches",
"some",
"condition",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/exploration_techniques/common.py#L5-L49 | train | Converts a condition into a lambda that checks if state s current basic block matches some condition. | 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/vaults.py | Vault._get_persistent_id | def _get_persistent_id(self, o):
"""
Determines a persistent ID for an object.
Does NOT do stores.
"""
if type(o) in self.hash_dedup:
oid = o.__class__.__name__ + "-" + str(hash(o))
self._object_cache[oid] = o
return oid
if any(isinsta... | python | def _get_persistent_id(self, o):
"""
Determines a persistent ID for an object.
Does NOT do stores.
"""
if type(o) in self.hash_dedup:
oid = o.__class__.__name__ + "-" + str(hash(o))
self._object_cache[oid] = o
return oid
if any(isinsta... | [
"def",
"_get_persistent_id",
"(",
"self",
",",
"o",
")",
":",
"if",
"type",
"(",
"o",
")",
"in",
"self",
".",
"hash_dedup",
":",
"oid",
"=",
"o",
".",
"__class__",
".",
"__name__",
"+",
"\"-\"",
"+",
"str",
"(",
"hash",
"(",
"o",
")",
")",
"self"... | Determines a persistent ID for an object.
Does NOT do stores. | [
"Determines",
"a",
"persistent",
"ID",
"for",
"an",
"object",
".",
"Does",
"NOT",
"do",
"stores",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/vaults.py#L90-L118 | train | Determines a persistent ID for an 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/vaults.py | Vault.is_stored | def is_stored(self, i):
"""
Checks if the provided id is already in the vault.
"""
if i in self.stored:
return True
try:
with self._read_context(i):
return True
except (AngrVaultError, EOFError):
return False | python | def is_stored(self, i):
"""
Checks if the provided id is already in the vault.
"""
if i in self.stored:
return True
try:
with self._read_context(i):
return True
except (AngrVaultError, EOFError):
return False | [
"def",
"is_stored",
"(",
"self",
",",
"i",
")",
":",
"if",
"i",
"in",
"self",
".",
"stored",
":",
"return",
"True",
"try",
":",
"with",
"self",
".",
"_read_context",
"(",
"i",
")",
":",
"return",
"True",
"except",
"(",
"AngrVaultError",
",",
"EOFErro... | Checks if the provided id is already in the vault. | [
"Checks",
"if",
"the",
"provided",
"id",
"is",
"already",
"in",
"the",
"vault",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/vaults.py#L124-L135 | train | Checks if the id is already in the vault. | 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/vaults.py | Vault.load | def load(self, id): #pylint:disable=redefined-builtin
"""
Retrieves one object from the pickler with the provided id.
:param id: an ID to use
"""
l.debug("LOAD: %s", id)
try:
l.debug("... trying cached")
return self._object_cache[id]
excep... | python | def load(self, id): #pylint:disable=redefined-builtin
"""
Retrieves one object from the pickler with the provided id.
:param id: an ID to use
"""
l.debug("LOAD: %s", id)
try:
l.debug("... trying cached")
return self._object_cache[id]
excep... | [
"def",
"load",
"(",
"self",
",",
"id",
")",
":",
"#pylint:disable=redefined-builtin",
"l",
".",
"debug",
"(",
"\"LOAD: %s\"",
",",
"id",
")",
"try",
":",
"l",
".",
"debug",
"(",
"\"... trying cached\"",
")",
"return",
"self",
".",
"_object_cache",
"[",
"id... | Retrieves one object from the pickler with the provided id.
:param id: an ID to use | [
"Retrieves",
"one",
"object",
"from",
"the",
"pickler",
"with",
"the",
"provided",
"id",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/vaults.py#L137-L150 | train | Load one object from the pickler with the provided ID. | 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/vaults.py | Vault.store | def store(self, o, id=None): #pylint:disable=redefined-builtin
"""
Stores an object and returns its ID.
:param o: the object
:param id: an ID to use
"""
actual_id = id or self._get_persistent_id(o) or "TMP-"+str(uuid.uuid4())
l.debug("STORE: %s %s", o, actual_id... | python | def store(self, o, id=None): #pylint:disable=redefined-builtin
"""
Stores an object and returns its ID.
:param o: the object
:param id: an ID to use
"""
actual_id = id or self._get_persistent_id(o) or "TMP-"+str(uuid.uuid4())
l.debug("STORE: %s %s", o, actual_id... | [
"def",
"store",
"(",
"self",
",",
"o",
",",
"id",
"=",
"None",
")",
":",
"#pylint:disable=redefined-builtin",
"actual_id",
"=",
"id",
"or",
"self",
".",
"_get_persistent_id",
"(",
"o",
")",
"or",
"\"TMP-\"",
"+",
"str",
"(",
"uuid",
".",
"uuid4",
"(",
... | Stores an object and returns its ID.
:param o: the object
:param id: an ID to use | [
"Stores",
"an",
"object",
"and",
"returns",
"its",
"ID",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/vaults.py#L152-L176 | train | Stores an object and returns its ID. | 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/vaults.py | Vault.dumps | def dumps(self, o):
"""
Returns a serialized string representing the object, post-deduplication.
:param o: the object
"""
f = io.BytesIO()
VaultPickler(self, f).dump(o)
f.seek(0)
return f.read() | python | def dumps(self, o):
"""
Returns a serialized string representing the object, post-deduplication.
:param o: the object
"""
f = io.BytesIO()
VaultPickler(self, f).dump(o)
f.seek(0)
return f.read() | [
"def",
"dumps",
"(",
"self",
",",
"o",
")",
":",
"f",
"=",
"io",
".",
"BytesIO",
"(",
")",
"VaultPickler",
"(",
"self",
",",
"f",
")",
".",
"dump",
"(",
"o",
")",
"f",
".",
"seek",
"(",
"0",
")",
"return",
"f",
".",
"read",
"(",
")"
] | Returns a serialized string representing the object, post-deduplication.
:param o: the object | [
"Returns",
"a",
"serialized",
"string",
"representing",
"the",
"object",
"post",
"-",
"deduplication",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/vaults.py#L178-L187 | train | Returns a serialized string representing the 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/vaults.py | Vault.loads | def loads(self, s):
"""
Deserializes a string representation of the object.
:param s: the string
"""
f = io.BytesIO(s)
return VaultUnpickler(self, f).load() | python | def loads(self, s):
"""
Deserializes a string representation of the object.
:param s: the string
"""
f = io.BytesIO(s)
return VaultUnpickler(self, f).load() | [
"def",
"loads",
"(",
"self",
",",
"s",
")",
":",
"f",
"=",
"io",
".",
"BytesIO",
"(",
"s",
")",
"return",
"VaultUnpickler",
"(",
"self",
",",
"f",
")",
".",
"load",
"(",
")"
] | Deserializes a string representation of the object.
:param s: the string | [
"Deserializes",
"a",
"string",
"representation",
"of",
"the",
"object",
"."
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/vaults.py#L189-L196 | train | Deserializes a string representation of the 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/analyses/identifier/identify.py | Identifier.get_reg_name | def get_reg_name(arch, reg_offset):
"""
:param arch: the architecture
:param reg_offset: Tries to find the name of a register given the offset in the registers.
:return: The register name
"""
# todo does this make sense
if reg_offset is None:
return No... | python | def get_reg_name(arch, reg_offset):
"""
:param arch: the architecture
:param reg_offset: Tries to find the name of a register given the offset in the registers.
:return: The register name
"""
# todo does this make sense
if reg_offset is None:
return No... | [
"def",
"get_reg_name",
"(",
"arch",
",",
"reg_offset",
")",
":",
"# todo does this make sense",
"if",
"reg_offset",
"is",
"None",
":",
"return",
"None",
"original_offset",
"=",
"reg_offset",
"while",
"reg_offset",
">=",
"0",
"and",
"reg_offset",
">=",
"original_of... | :param arch: the architecture
:param reg_offset: Tries to find the name of a register given the offset in the registers.
:return: The register name | [
":",
"param",
"arch",
":",
"the",
"architecture",
":",
"param",
"reg_offset",
":",
"Tries",
"to",
"find",
"the",
"name",
"of",
"a",
"register",
"given",
"the",
"offset",
"in",
"the",
"registers",
".",
":",
"return",
":",
"The",
"register",
"name"
] | 4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40 | https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/identifier/identify.py#L412-L428 | train | Tries to find the name of a register in the arch. bytes. | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.