angr.utils.library¶
- angr.utils.library.get_function_name(s)¶
Get the function name from a C-style function declaration string.
- angr.utils.library.register_kernel_types()¶
- angr.utils.library.convert_cproto_to_py(c_decl)¶
Convert a C-style function declaration string to its corresponding SimTypes-based Python representation.
- Parameters:
c_decl (str) – The C-style function declaration string.
- Return type:
- Returns:
A tuple of the function name, the prototype, and a string representing the SimType-based Python representation.
- angr.utils.library.convert_cppproto_to_py(cpp_decl, with_param_names=False)¶
Pre-process a C++-style function declaration string to its corresponding SimTypes-based Python representation.
- angr.utils.library.parsedcprotos2py(parsed_cprotos, fd_spots=frozenset({}), remove_sys_prefix=False)¶
Parse a list of C function declarations and output to Python code that can be embedded into angr.procedures.definitions.
>>> # parse the list of glibc C prototypes and output to a file >>> from angr.procedures.definitions import glibc >>> with open("glibc_protos", "w") as f: f.write(cprotos2py(glibc._libc_c_decls))
- angr.utils.library.cprotos2py(cprotos, fd_spots=frozenset({}), remove_sys_prefix=False)¶
Parse a list of C function declarations and output to Python code that can be embedded into angr.procedures.definitions.
>>> # parse the list of glibc C prototypes and output to a file >>> from angr.procedures.definitions import glibc >>> with open("glibc_protos", "w") as f: f.write(cprotos2py(glibc._libc_c_decls))
- angr.utils.library.get_cpp_function_name_and_metadata(demangled_name)¶
Parse a demangled C++ declaration into a function name.
Note that the extracted name may include template instantiation, for example:
example_func<int>
- angr.utils.library.get_cpp_function_name(demangled_name)¶
Parse a demangled C++ declaration into a function name.
Note that the extracted name may include template instantiation, for example:
example_func<int>
- angr.utils.library.get_rust_function_name(demangled_name)¶