27 #define RZ_BIN_DBG_STRIPPED 0x01
28 #define RZ_BIN_DBG_STATIC 0x02
29 #define RZ_BIN_DBG_LINENUMS 0x04
30 #define RZ_BIN_DBG_SYMS 0x08
31 #define RZ_BIN_DBG_RELOCS 0x10
33 #define RZ_BIN_ENTRY_TYPE_PROGRAM 0
34 #define RZ_BIN_ENTRY_TYPE_MAIN 1
35 #define RZ_BIN_ENTRY_TYPE_INIT 2
36 #define RZ_BIN_ENTRY_TYPE_FINI 3
37 #define RZ_BIN_ENTRY_TYPE_TLS 4
38 #define RZ_BIN_ENTRY_TYPE_PREINIT 5
40 #define RZ_BIN_SIZEOF_STRINGS 512
41 #define RZ_BIN_MAX_ARCH 1024
43 #define RZ_BIN_REQ_ALL UT64_MAX
44 #define RZ_BIN_REQ_UNK 0x000000
45 #define RZ_BIN_REQ_ENTRIES 0x000001
46 #define RZ_BIN_REQ_IMPORTS 0x000002
47 #define RZ_BIN_REQ_SYMBOLS 0x000004
48 #define RZ_BIN_REQ_SECTIONS 0x000008
49 #define RZ_BIN_REQ_INFO 0x000010
50 #define RZ_BIN_REQ_OPERATION 0x000020
51 #define RZ_BIN_REQ_HELP 0x000040
52 #define RZ_BIN_REQ_STRINGS 0x000080
53 #define RZ_BIN_REQ_FIELDS 0x000100
54 #define RZ_BIN_REQ_LIBS 0x000200
55 #define RZ_BIN_REQ_SRCLINE 0x000400
56 #define RZ_BIN_REQ_MAIN 0x000800
57 #define RZ_BIN_REQ_EXTRACT 0x001000
58 #define RZ_BIN_REQ_RELOCS 0x002000
59 #define RZ_BIN_REQ_LISTARCHS 0x004000
60 #define RZ_BIN_REQ_CREATE 0x008000
61 #define RZ_BIN_REQ_CLASSES 0x010000
62 #define RZ_BIN_REQ_DWARF 0x020000
63 #define RZ_BIN_REQ_SIZE 0x040000
64 #define RZ_BIN_REQ_PDB 0x080000
65 #define RZ_BIN_REQ_PDB_DWNLD 0x100000
66 #define RZ_BIN_REQ_DLOPEN 0x200000
67 #define RZ_BIN_REQ_EXPORTS 0x400000
68 #define RZ_BIN_REQ_VERSIONINFO 0x800000
69 #define RZ_BIN_REQ_PACKAGE 0x1000000
70 #define RZ_BIN_REQ_HEADER 0x2000000
71 #define RZ_BIN_REQ_LISTPLUGINS 0x4000000
72 #define RZ_BIN_REQ_RESOURCES 0x8000000
73 #define RZ_BIN_REQ_INITFINI 0x10000000
74 #define RZ_BIN_REQ_SEGMENTS 0x20000000
75 #define RZ_BIN_REQ_HASHES 0x40000000
76 #define RZ_BIN_REQ_SIGNATURE 0x80000000
77 #define RZ_BIN_REQ_TRYCATCH 0x100000000
78 #define RZ_BIN_REQ_SECTIONS_MAPPING 0x200000000
79 #define RZ_BIN_REQ_CLASSES_SOURCES 0x400000000
80 #define RZ_BIN_REQ_BASEFIND 0x800000000
83 #define RZ_BIN_METH_CLASS 0x0000000000000001L
84 #define RZ_BIN_METH_STATIC 0x0000000000000002L
85 #define RZ_BIN_METH_PUBLIC 0x0000000000000004L
86 #define RZ_BIN_METH_PRIVATE 0x0000000000000008L
87 #define RZ_BIN_METH_PROTECTED 0x0000000000000010L
88 #define RZ_BIN_METH_INTERNAL 0x0000000000000020L
89 #define RZ_BIN_METH_OPEN 0x0000000000000040L
90 #define RZ_BIN_METH_FILEPRIVATE 0x0000000000000080L
91 #define RZ_BIN_METH_FINAL 0x0000000000000100L
92 #define RZ_BIN_METH_VIRTUAL 0x0000000000000200L
93 #define RZ_BIN_METH_CONST 0x0000000000000400L
94 #define RZ_BIN_METH_MUTATING 0x0000000000000800L
95 #define RZ_BIN_METH_ABSTRACT 0x0000000000001000L
96 #define RZ_BIN_METH_SYNCHRONIZED 0x0000000000002000L
97 #define RZ_BIN_METH_NATIVE 0x0000000000004000L
98 #define RZ_BIN_METH_BRIDGE 0x0000000000008000L
99 #define RZ_BIN_METH_VARARGS 0x0000000000010000L
100 #define RZ_BIN_METH_SYNTHETIC 0x0000000000020000L
101 #define RZ_BIN_METH_STRICT 0x0000000000040000L
102 #define RZ_BIN_METH_MIRANDA 0x0000000000080000L
103 #define RZ_BIN_METH_CONSTRUCTOR 0x0000000000100000L
104 #define RZ_BIN_METH_DECLARED_SYNCHRONIZED 0x0000000000200000L
106 #define RZ_BIN_BIND_LOCAL_STR "LOCAL"
107 #define RZ_BIN_BIND_GLOBAL_STR "GLOBAL"
108 #define RZ_BIN_BIND_WEAK_STR "WEAK"
109 #define RZ_BIN_BIND_NUM_STR "NUM"
110 #define RZ_BIN_BIND_LOOS_STR "LOOS"
111 #define RZ_BIN_BIND_HIOS_STR "HIOS"
112 #define RZ_BIN_BIND_LOPROC_STR "LOPROC"
113 #define RZ_BIN_BIND_HIPROC_STR "HIPROC"
114 #define RZ_BIN_BIND_IMPORT_STR "IMPORT"
115 #define RZ_BIN_BIND_UNKNOWN_STR "UNKNOWN"
117 #define RZ_BIN_TYPE_NOTYPE_STR "NOTYPE"
118 #define RZ_BIN_TYPE_OBJECT_STR "OBJ"
119 #define RZ_BIN_TYPE_FUNC_STR "FUNC"
120 #define RZ_BIN_TYPE_FIELD_STR "FIELD"
121 #define RZ_BIN_TYPE_IFACE_STR "IFACE"
122 #define RZ_BIN_TYPE_METH_STR "METH"
123 #define RZ_BIN_TYPE_STATIC_STR "STATIC"
124 #define RZ_BIN_TYPE_SECTION_STR "SECT"
125 #define RZ_BIN_TYPE_FILE_STR "FILE"
126 #define RZ_BIN_TYPE_COMMON_STR "COMMON"
127 #define RZ_BIN_TYPE_TLS_STR "TLS"
128 #define RZ_BIN_TYPE_NUM_STR "NUM"
129 #define RZ_BIN_TYPE_LOOS_STR "LOOS"
130 #define RZ_BIN_TYPE_HIOS_STR "HIOS"
131 #define RZ_BIN_TYPE_LOPROC_STR "LOPROC"
132 #define RZ_BIN_TYPE_HIPROC_STR "HIPROC"
133 #define RZ_BIN_TYPE_SPECIAL_SYM_STR "SPCL"
134 #define RZ_BIN_TYPE_UNKNOWN_STR "UNK"
162 #define RZ_BIN_LANGUAGE_MASK(x) ((x) & ~RZ_BIN_LANGUAGE_BLOCKS)
163 #define RZ_BIN_LANGUAGE_HAS_BLOCKS(x) ((x)&RZ_BIN_LANGUAGE_BLOCKS)
475 return !
s->line && !
s->column && !
s->file;
545 char *(*enrich_asm)(
RzBinFile *bf,
const char *asm_str,
int asm_len);
552 char *(*demangle)(
const char *
str);
659 #define RzBinSectionName rz_offsetof(RzBinSection, name)
660 #define RzBinSectionOffset rz_offsetof(RzBinSection, offset)
662 #define REBASE_PADDR(o, l, type_t) \
664 if ((o)->opts.loadaddr) { \
667 rz_list_foreach ((l), _it, _el) { \
668 _el->paddr += (o)->opts.loadaddr; \
837 typedef struct rz_bin_options_t {
838 const char *pluginname;
846 typedef struct rz_event_bin_file_del_t {
864 ut64 target_vfile_base,
ut64 target_vfile_size,
RZ_API bool rz_bin_file_set_cur_binfile(RzBin *bin, RzBinFile *bf)
RZ_API RZ_OWN RzList * rz_bin_file_set_hashes(RzBin *bin, RZ_OWN RzList *new_hashes)
Set file_hashes on current RzBinInfo.
RZ_API ut64 rz_bin_file_delete_all(RzBin *bin)
RZ_API RzBinSymbol * rz_bin_file_add_method(RzBinFile *bf, const char *klass, const char *method, int nargs)
RZ_API RzBinClass * rz_bin_file_add_class(RzBinFile *bf, const char *name, const char *super, int view)
RZ_API RzBinFile * rz_bin_file_find_by_name(RzBin *bin, const char *name)
RZ_API RzBinFile * rz_bin_file_find_by_id(RzBin *bin, ut32 bf_id)
RZ_API bool rz_bin_file_set_cur_by_fd(RzBin *bin, ut32 bin_fd)
RZ_API RzList * rz_bin_file_get_symbols(RzBinFile *bf)
RZ_API RzBinFile * rz_bin_file_find_by_fd(RzBin *bin, ut32 bin_fd)
RZ_API bool rz_bin_file_delete(RzBin *bin, RzBinFile *bf)
RZ_API RzBinFile * rz_bin_file_find_by_arch_bits(RzBin *bin, const char *arch, int bits)
RZ_API RZ_OWN RzList * rz_bin_file_compute_hashes(RzBin *bin, RzBinFile *bf, ut64 limit)
RZ_API bool rz_bin_file_set_cur_by_id(RzBin *bin, ut32 bin_id)
RZ_API RzBinPlugin * rz_bin_file_cur_plugin(RzBinFile *bf)
RZ_API bool rz_bin_file_object_new_from_xtr_data(RzBin *bin, RzBinFile *bf, RzBinObjectLoadOptions *opts, RzBinXtrData *data)
RZ_API bool rz_bin_file_set_cur_by_name(RzBin *bin, const char *name)
RZ_API ut64 rz_bin_file_get_baddr(RzBinFile *bf)
RZ_API RzList * rz_bin_file_get_trycatch(RZ_NONNULL RzBinFile *bf)
RZ_API RZ_OWN RzList * rz_bin_file_strings(RZ_NONNULL RzBinFile *bf, size_t min_length, bool raw_strings)
Generates a RzList struct containing RzBinString from a given RzBinFile.
RZ_API void rz_bin_filter_symbols(RzBinFile *bf, RzList *list)
RZ_API void rz_bin_filter_sections(RzBinFile *bf, RzList *list)
RZ_API char * rz_bin_filter_name(RzBinFile *bf, HtPU *db, ut64 vaddr, char *name)
RZ_API void rz_bin_filter_sym(RzBinFile *bf, HtPP *ht, ut64 vaddr, RzBinSymbol *sym)
RZ_API bool rz_bin_string_filter(RzBin *bin, const char *str, int len, ut64 addr)
RZ_API bool rz_bin_strpurge(RzBin *bin, const char *str, ut64 refaddr)
RZ_API const char * rz_bin_entry_type_string(int etype)
RZ_DEPRECATE RZ_API RZ_BORROW RzBinInfo * rz_bin_get_info(RzBin *bin)
RZ_API RzBinImport * rz_bin_import_clone(RzBinImport *o)
RZ_API RzBin * rz_bin_new(void)
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_entries(RZ_NONNULL RzBin *bin)
RZ_API ut64 rz_bin_get_laddr(RzBin *bin)
RZ_API RzBinObject * rz_bin_cur_object(RzBin *bin)
RZ_API bool rz_bin_plugin_add(RzBin *bin, RzBinPlugin *foo)
RZ_API ut64 rz_bin_get_size(RzBin *bin)
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_imports(RZ_NONNULL RzBin *bin)
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_mem(RZ_NONNULL RzBin *bin)
RZ_API void rz_bin_load_filter(RzBin *bin, ut64 rules)
RZ_API void rz_bin_file_hash_free(RzBinFileHash *fhash)
RZ_API void rz_bin_bind(RzBin *bin, RzBinBind *b)
RZ_API RzBinPlugin * rz_bin_get_binplugin_by_buffer(RzBin *bin, RzBuffer *buf)
RZ_API void rz_bin_set_user_ptr(RzBin *bin, void *user)
RZ_API RzBinFile * rz_bin_open_buf(RzBin *bin, RzBuffer *buf, RzBinOptions *opt)
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_classes(RZ_NONNULL RzBin *bin)
RZ_API RzBinFile * rz_bin_file_at(RzBin *bin, ut64 at)
RZ_API const char * rz_bin_symbol_name(RzBinSymbol *s)
RZ_API bool rz_bin_list_plugin(RzBin *bin, const char *name, PJ *pj, int json)
RZ_API const RzBinPlugin * rz_bin_plugin_get(RZ_NONNULL RzBin *bin, RZ_NONNULL const char *name)
Get a RzBinPlugin by name.
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_libs(RZ_NONNULL RzBin *bin)
RZ_API RzBinFile * rz_bin_open_io(RzBin *bin, RzBinOptions *opt)
RZ_DEPRECATE RZ_API int rz_bin_is_static(RZ_NONNULL RzBin *bin)
RZ_API RZ_BORROW RzBinMap * rz_bin_object_get_map_at(RZ_NONNULL RzBinObject *o, ut64 off, bool va)
Find the last binary map at offset off .
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_symbols(RZ_NONNULL RzBin *bin)
RZ_API void rz_bin_arch_options_init(RzBinArchOptions *opt, const char *arch, int bits)
RZ_API const RzBinXtrPlugin * rz_bin_xtrplugin_get(RZ_NONNULL RzBin *bin, RZ_NONNULL const char *name)
Get a RzBinXtrPlugin by name.
RZ_API bool rz_bin_select_bfid(RzBin *bin, ut32 bf_id)
RZ_API ut64 rz_bin_get_baddr(RzBin *bin)
RZ_API RZ_OWN RzPVector * rz_bin_object_get_maps_at(RzBinObject *o, ut64 off, bool va)
Find all binary maps at offset off .
RZ_API void rz_bin_force_plugin(RzBin *bin, const char *name)
RZ_API RZ_BORROW RzBinSection * rz_bin_get_section_at(RzBinObject *o, ut64 off, int va)
Find the binary section at offset off.
RZ_API RzBuffer * rz_bin_create(RzBin *bin, const char *p, const ut8 *code, int codelen, const ut8 *data, int datalen, RzBinArchOptions *opt)
RZ_API bool rz_bin_xtr_add(RzBin *bin, RzBinXtrPlugin *foo)
RZ_API RZ_OWN char * rz_bin_demangle(RZ_NULLABLE RzBinFile *bf, RZ_NULLABLE const char *language, RZ_NULLABLE const char *symbol, ut64 vaddr, bool libs)
Demangles a symbol based on the language or the RzBinFile data.
RZ_API RzBinFile * rz_bin_reload(RzBin *bin, RzBinFile *bf, ut64 baseaddr)
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_strings(RZ_NONNULL RzBin *bin)
RZ_API void rz_bin_options_init(RzBinOptions *opt, int fd, ut64 baseaddr, ut64 loadaddr, bool patch_relocs)
RZ_API RzBinFile * rz_bin_open(RzBin *bin, const char *file, RzBinOptions *opt)
RZ_API RzBinFile * rz_bin_cur(RzBin *bin)
RZ_API const char * rz_bin_get_meth_flag_string(ut64 flag, bool compact)
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_sections(RZ_NONNULL RzBin *bin)
RZ_API bool rz_bin_select(RzBin *bin, const char *arch, int bits, const char *name)
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_fields(RZ_NONNULL RzBin *bin)
RZ_API void rz_bin_free(RzBin *bin)
RZ_API bool rz_bin_use_arch(RzBin *bin, const char *arch, int bits, const char *name)
RZ_API void rz_bin_set_baddr(RzBin *bin, ut64 baddr)
RzBinPlugin rz_bin_plugin_any
static ut64 baddr(RzBinFile *bf)
RzBinPlugin rz_bin_plugin_art
RzBinPlugin rz_bin_plugin_avr
RzBinPlugin rz_bin_plugin_bf
static RzList * maps(RzBinFile *bf)
RzBinPlugin rz_bin_plugin_bflt
RzBinPlugin rz_bin_plugin_bios
RzBinPlugin rz_bin_plugin_bootimg
RzBinPlugin rz_bin_plugin_cgc
static RzList * libs(RzBinFile *bf)
RzBinPlugin rz_bin_plugin_coff
RzBinPlugin rz_bin_plugin_dex
RzBinPlugin rz_bin_plugin_dmp64
RzBinPlugin rz_bin_plugin_dol
RzBinPlugin rz_bin_plugin_dyldcache
RzBinPlugin rz_bin_plugin_elf64
RzBinPlugin rz_bin_plugin_elf
RzBinPlugin rz_bin_plugin_java
RZ_API RzBinLanguage rz_bin_language_detect(RzBinFile *binfile)
Tries to detect which language is used in the binary based on symbols and libraries.
RZ_API RzBinLanguage rz_bin_language_to_id(const char *language)
returns the language identifier based on the given lang name
RZ_API const char * rz_bin_language_to_string(RzBinLanguage language)
returns the language name based on the given language identifier
RzBinPlugin rz_bin_plugin_le
RzBinPlugin rz_bin_plugin_luac
RzBinPlugin rz_bin_plugin_mach064
RzBinPlugin rz_bin_plugin_mach0
RzBinPlugin rz_bin_plugin_mbn
RzBinPlugin rz_bin_plugin_mdmp
RzBinPlugin rz_bin_plugin_mz
RzBinPlugin rz_bin_plugin_ne
RzList * relocs(RzBinFile *bf)
RzBinPlugin rz_bin_plugin_nes
RzBinPlugin rz_bin_plugin_nin3ds
RzBinPlugin rz_bin_plugin_ninds
RzBinPlugin rz_bin_plugin_ningb
RzBinPlugin rz_bin_plugin_ningba
RzBinPlugin rz_bin_plugin_nro
RzBinPlugin rz_bin_plugin_nso
RzBinPlugin rz_bin_plugin_omf
RzBinPlugin rz_bin_plugin_p9
RzBinPlugin rz_bin_plugin_pe64
RzBinPlugin rz_bin_plugin_pe
RzBinPlugin rz_bin_plugin_pebble
RzBinPlugin rz_bin_plugin_prg
RzBinPlugin rz_bin_plugin_psxexe
RzBinPlugin rz_bin_plugin_pyc
RzBinPlugin rz_bin_plugin_qnx
RzBinPlugin rz_bin_plugin_sfc
RzBinPlugin rz_bin_plugin_smd
RzBinPlugin rz_bin_plugin_sms
RzBinPlugin rz_bin_plugin_spc700
RzBinPlugin rz_bin_plugin_symbols
RzBinPlugin rz_bin_plugin_te
RzBinPlugin rz_bin_plugin_vsf
RzBinPlugin rz_bin_plugin_wasm
RzBinPlugin rz_bin_plugin_xbe
RzBinPlugin rz_bin_plugin_xnu_kernelcache
RzBinXtrPlugin rz_bin_xtr_plugin_xtr_fatmach0
RzBinXtrPlugin rz_bin_xtr_plugin_xtr_pemixed
RzBinXtrPlugin rz_bin_xtr_plugin_xtr_sep64
RzBinPlugin rz_bin_plugin_z64
RzBinPlugin rz_bin_plugin_zimg
int bits(struct state *s, int need)
RZ_API bool rz_bin_string_database_remove(RZ_NONNULL RzBinStrDb *db, ut64 address, bool is_va)
Return true if the given address has been removed to the RzBinObject string database.
RZ_API RZ_OWN RzBinStrDb * rz_bin_string_database_new(RZ_NULLABLE RZ_OWN RzList *list)
Allocates and initializes the RzBinStrDb structure with the given list of strings.
RZ_API const RzBinInfo * rz_bin_object_get_info(RZ_NONNULL RzBinObject *obj)
Get the RzBinInfo of the binary object.
RZ_API const RzList * rz_bin_object_get_entries(RZ_NONNULL RzBinObject *obj)
Get list of RzBinAddr representing the entry points of the binary object.
RZ_API const RzList * rz_bin_object_get_classes(RZ_NONNULL RzBinObject *obj)
Get list of RzBinClass representing the classes (e.g. C++ classes) defined in the binary object.
RZ_API void rz_bin_string_database_free(RZ_NULLABLE RzBinStrDb *db)
Frees a RzBinStrDb structure.
RZ_API RzBinVirtualFile * rz_bin_object_get_virtual_file(RzBinObject *o, const char *name)
RZ_API RZ_BORROW RzBinString * rz_bin_object_get_string_at(RZ_NONNULL RzBinObject *obj, ut64 address, bool is_va)
Return RzBinString if at address there is an entry in the RzBinObject string database.
RZ_API void rz_bin_string_decode_base64(RZ_NONNULL RzBinString *bstr)
Tries to decode the base64 string hold by RzBinString and overwrites it.
RZ_API const RzList * rz_bin_object_get_imports(RZ_NONNULL RzBinObject *obj)
Get list of RzBinImport representing the imports of the binary object.
RZ_API int rz_bin_object_set_items(RzBinFile *bf, RzBinObject *o)
RZ_API const RzBinAddr * rz_bin_object_get_special_symbol(RzBinObject *o, RzBinSpecialSymbol sym)
Return the RzBinAddr structure representing the special symbol sym.
RZ_API const RzList * rz_bin_object_get_fields(RZ_NONNULL RzBinObject *obj)
Get list of RzBinField representing the fields of the binary object.
RZ_API RZ_OWN RzVector * rz_bin_object_sections_mapping_list(RZ_NONNULL RzBinObject *obj)
Get the mapping between segments and sections in the binary.
RZ_API const RzList * rz_bin_object_get_libs(RZ_NONNULL RzBinObject *obj)
Get list of char* representing the libraries used by the binary object.
RZ_API const RzList * rz_bin_object_get_sections_all(RZ_NONNULL RzBinObject *obj)
Get list of RzBinSection representing both the sections and the segments of the binary object.
RZ_API ut64 rz_bin_object_addr_with_base(RzBinObject *o, ut64 addr)
Put the given address on top of o's base address.
RZ_API RzVector * rz_bin_object_p2v_all(RZ_NONNULL RzBinObject *obj, ut64 paddr)
Convert offset in the file to all possible virtual addresses according to binary mappings.
RZ_API RzBinSymbol * rz_bin_object_get_symbol_of_import(RzBinObject *o, RzBinImport *imp)
Find the symbol that represents the given import This is necessary for example to determine the addre...
RZ_API const RzList * rz_bin_object_get_strings(RZ_NONNULL RzBinObject *obj)
Get list of RzBinString representing the strings identified in the binary object.
RZ_API bool rz_bin_object_reset_strings(RZ_NONNULL RzBin *bin, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzBinObject *obj)
Remove all previously identified strings in the binary object and scan it again for strings.
RZ_API ut64 rz_bin_object_v2p(RZ_NONNULL RzBinObject *obj, ut64 vaddr)
Convert virtual address to offset in the file according to binary mappings.
RZ_API ut64 rz_bin_object_get_vaddr(RzBinObject *o, ut64 paddr, ut64 vaddr)
RZ_API const RzList * rz_bin_object_get_mem(RZ_NONNULL RzBinObject *obj)
Get list of RzBinMem representing the memory regions identified in the binary object.
RZ_API ut64 rz_bin_object_p2v(RZ_NONNULL RzBinObject *obj, ut64 paddr)
Convert offset in the file to virtual address according to binary mappings.
RZ_API void rz_bin_mem_free(void *data)
RZ_API bool rz_bin_string_database_add(RZ_NONNULL RzBinStrDb *db, RZ_NONNULL RzBinString *bstr)
{ function_description }
RZ_API const RzList * rz_bin_object_get_resources(RZ_NONNULL RzBinObject *obj)
Get a list of RzBinResource representing the resources in the binary object.
RZ_API RZ_OWN RzList * rz_bin_object_get_segments(RZ_NONNULL RzBinObject *obj)
Get list of RzBinSection representing only the segments of the binary object.
RZ_API bool rz_bin_object_is_big_endian(RZ_NONNULL RzBinObject *obj)
Return true if the binary object obj is big endian.
RZ_API RZ_OWN RzList * rz_bin_object_get_sections(RZ_NONNULL RzBinObject *obj)
Get list of RzBinSection representing only the sections of the binary object.
RZ_API const RzList * rz_bin_object_get_symbols(RZ_NONNULL RzBinObject *obj)
Get list of RzBinSymbol representing the symbols in the binary object.
RZ_API RzBinRelocStorage * rz_bin_object_patch_relocs(RzBinFile *bf, RzBinObject *o)
RZ_API bool rz_bin_object_is_static(RZ_NONNULL RzBinObject *obj)
Return true if the binary object obj is detected as statically compiled.
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
RZ_DEPRECATE RZ_API bool rz_bin_addr2line(RzBin *bin, ut64 addr, char *file, int len, int *line)
RZ_DEPRECATE RZ_API char * rz_bin_addr2text(RzBin *bin, ut64 addr, int origin)
size_t map(int syms, int left, int len)
static void list(RzEgg *egg)
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags void static offset const char static length static mode static who const char struct statfs static buf unsigned unsigned num
RZ_API void MACH0_() patch_relocs(RzBinFile *bf, struct MACH0_(obj_t) *obj)
Patching of external relocs in a sparse overlay buffer.
static uint32_t const uint8_t uint32_t uint32_t limit
RZ_API ut64 rz_bin_reloc_target_builder_get_target(RzBinRelocTargetBuilder *builder, ut64 sym)
obtain the address of the target for a given symbol
RZ_API void rz_bin_reloc_target_builder_free(RzBinRelocTargetBuilder *builder)
RZ_API void rz_bin_relocs_patch_maps(RZ_NONNULL RzList *maps, RZ_NULLABLE RzBuffer *buf_patched, ut64 buf_patched_offset, ut64 target_vfile_base, ut64 target_vfile_size, RZ_NONNULL const char *vfile_name_patched, RZ_NONNULL const char *vfile_name_reloc_targets)
Change file-mapped maps to the patched vfile if covered by the buffer and add the reloc target map.
RZ_API RzBinRelocTargetBuilder * rz_bin_reloc_target_builder_new(ut64 target_size, ut64 target_base)
RZ_API ut64 rz_bin_relocs_patch_find_targets_map_base(RzList *maps, ut64 target_sz)
Finm a suitable location for putting the artificial reloc targets map.
RZ_API void rz_bin_info_free(RzBinInfo *rb)
RZ_API void rz_bin_source_line_info_free(RzBinSourceLineInfo *sli)
int(* FREE_XTR)(void *xtr_obj)
RZ_API const RzBinSourceLineSample * rz_bin_source_line_info_get_next(const RzBinSourceLineInfo *sli, RZ_NONNULL const RzBinSourceLineSample *cur)
struct rz_bin_arch_options_t RzBinArchOptions
struct rz_bin_section_t RzBinSection
char *(* RzBinDemangle)(RzBinFile *bf, const char *def, const char *str, ut64 vaddr, bool libs)
RZ_API RzBinSymbol * rz_bin_symbol_new(const char *name, ut64 paddr, ut64 vaddr)
struct rz_bin_reloc_t RzBinReloc
@ RZ_BIN_LANGUAGE_UNKNOWN
struct rz_bin_class_t RzBinClass
RZ_API RzBinSection * rz_bin_section_new(const char *name)
struct rz_bin_hash_t RzBinHash
struct rz_bin_symbol_t RzBinSymbol
RZ_API RZ_OWN RzList * rz_bin_section_flag_to_list(RzBin *bin, ut64 flag)
Converts the RzBinSection flags to a list of string representations.
struct rz_bin_resource_t RzBinResource
struct rz_bin_map_t RzBinMap
Description of a single memory mapping into virtual memory from a binary.
RzBinSection *(* RzBinGetSectionAt)(RzBin *bin, ut64 addr)
struct rz_bin_file_hash_t RzBinFileHash
struct rz_bin_mem_t RzBinMem
RZ_API void rz_bin_symbol_free(RzBinSymbol *sym)
RZ_API void rz_bin_map_free(RzBinMap *map)
RZ_API void rz_bin_string_free(void *_str)
struct rz_bin_string_t RzBinString
struct rz_bin_xtr_plugin_t RzBinXtrPlugin
RZ_API void rz_bin_source_line_info_builder_init(RzBinSourceLineInfoBuilder *builder)
struct rz_bin_plugin_t RzBinPlugin
char *(* RzBinGetName)(RzBin *bin, int type, int idx)
RZ_API void rz_bin_field_free(RzBinField *field)
RZ_API void rz_bin_source_line_info_builder_fini(RzBinSourceLineInfoBuilder *builder)
RZ_API RzBinSourceLineInfo * rz_bin_source_line_info_builder_build_and_fini(RzBinSourceLineInfoBuilder *builder)
RZ_API void rz_bin_import_free(RzBinImport *imp)
RZ_API void rz_bin_resource_free(RzBinResource *res)
struct rz_bin_info_t RzBinInfo
struct rz_bin_bind_t RzBinBind
RZ_API RzList * rz_bin_sections_of_maps(RzList *maps)
Create a list of RzBinSection from RzBinMaps.
void(* RzBinSymbollCallback)(RzBinObject *obj, void *symbol)
RZ_API RzBinRelocStorage * rz_bin_reloc_storage_new(RZ_OWN RzList *relocs)
struct rz_bin_source_line_sample_t RzBinSourceLineSample
A single sample of source line info for a specific address.
@ RZ_BIN_SPECIAL_SYMBOL_FINI
@ RZ_BIN_SPECIAL_SYMBOL_ENTRY
@ RZ_BIN_SPECIAL_SYMBOL_LAST
@ RZ_BIN_SPECIAL_SYMBOL_INIT
@ RZ_BIN_SPECIAL_SYMBOL_MAIN
struct rz_bin_object_t RzBinObject
RZ_API void rz_bin_section_free(RzBinSection *bs)
struct rz_bin_section_map_t RzBinSectionMap
RZ_API const RzBinSourceLineSample * rz_bin_source_line_info_get_first_at(const RzBinSourceLineInfo *sli, ut64 addr)
Find the first sample that affects the given address. i.e. find the first sample with the highest add...
struct rz_bin_file_load_options_t RzBinObjectLoadOptions
RzList *(* RzBinGetSections)(RzBin *bin)
static bool rz_bin_reloc_storage_targets_available(RzBinRelocStorage *storage)
return true iff there is at least one reloc in the storage with a target address
struct rz_bin_trycatch_t RzBinTrycatch
RZ_API RzBinXtrData * rz_bin_xtrdata_new(RzBuffer *buf, ut64 offset, ut64 size, ut32 file_count, RzBinXtrMetadata *metadata)
struct rz_bin_xtr_extract_t RzBinXtrData
RZ_API RZ_OWN RzList * rz_bin_maps_of_file_sections(RZ_NONNULL RzBinFile *binfile)
Create a list of RzBinMap from RzBinSections queried from the given file.
static bool rz_bin_reloc_has_target(RzBinReloc *reloc)
RZ_API RzBinTrycatch * rz_bin_trycatch_new(ut64 source, ut64 from, ut64 to, ut64 handler, ut64 filter)
RZ_API void rz_bin_source_line_info_builder_push_sample(RzBinSourceLineInfoBuilder *builder, ut64 address, ut32 line, ut32 column, const char *file)
Push a new sample into the builder.
ut64(* RzBinGetOffset)(RzBin *bin, int type, int idx)
RZ_API RzBinField * rz_bin_field_new(ut64 paddr, ut64 vaddr, int size, const char *name, const char *comment, const char *format, bool format_named)
RZ_API void rz_bin_virtual_file_free(RzBinVirtualFile *vfile)
RZ_API void rz_bin_xtrdata_free(void *data)
struct rz_bin_field_t RzBinField
struct rz_bin_import_t RzBinImport
struct rz_bin_addr_t RzBinAddr
struct rz_bin_xtr_metadata_t RzBinXtrMetadata
RZ_API RzBinReloc * rz_bin_reloc_storage_get_reloc_to(RzBinRelocStorage *storage, ut64 vaddr)
Get a reloc that points exactly to vaddr or NULL.
RZ_API RzBinReloc * rz_bin_reloc_storage_get_reloc_in(RzBinRelocStorage *storage, ut64 vaddr, ut64 size)
Get the reloc with the lowest vaddr that starts inside the given interval.
RZ_API RZ_OWN char * rz_bin_section_type_to_string(RzBin *bin, int type)
Converts the RzBinSection type to the string representation.
RZ_API void rz_bin_reloc_free(RzBinReloc *reloc)
RZ_LIB_VERSION_HEADER(rz_bin)
struct rz_bin_virtual_file_t RzBinVirtualFile
RZ_API void rz_bin_reloc_storage_free(RzBinRelocStorage *storage)
static bool rz_bin_source_line_sample_is_closing(const RzBinSourceLineSample *s)
RZ_API ut64 rz_bin_reloc_size(RzBinReloc *reloc)
size of the reloc (where it is supposed to be patched) in bits
struct rz_bin_source_line_info_builder_t RzBinSourceLineInfoBuilder
struct rz_bin_file_options_t RzBinFileOptions
RZ_API void rz_bin_trycatch_free(RzBinTrycatch *tc)
int(* PrintfCallback)(const char *str,...) RZ_PRINTF_CHECK(1
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr from
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr socklen_t static fromlen const void const struct sockaddr to
RzBinGetOffset get_offset
RzBinGetSections get_sections
RzBinGetSectionAt get_vsect_at
bool elf_checks_sections
ELF specific, checks or not ELF sections.
bool patch_relocs
ask the bin plugin to fill relocs with valid contents for analysis
ut64 loadaddr
starting physical address to read from the target file
bool elf_load_sections
ELF specific, load or not ELF sections.
bool elf_checks_segments
ELF specific, checks or not ELF sections.
ut64 baseaddr
where the linker maps the binary in memory
bool big_endian
only used for binary formats that do not specify the endian in the file, but need it to load,...
XX curplugin == o->plugin.
RZ_DEPRECATE Sdb * sdb
deprecated, put info in C structures instead of this
int fd
when used in combination with RzIO, this refers to the io fd.
struct rz_bin_xtr_plugin_t * curxtr
Description of a single memory mapping into virtual memory from a binary.
ut64 vsize
size to map in the destination address space. If vsize > psize, excessive bytes are meant to be fille...
ut64 paddr
address of the map inside the file
ut64 psize
size of the data inside the file
ut64 vaddr
address in the destination address space to map to
RZ_NULLABLE char * vfile_name
RzBinObjectLoadOptions opts
HtPP * import_name_symbols
Acceleration structure for fast access of the symbol for a given import. This associates the name of ...
struct rz_bin_plugin_t * plugin
RzBinSourceLineInfo * lines
RZ_DEPRECATE RZ_BORROW Sdb * kv
deprecated, put info in C structures instead of this (holds a copy of another pointer....
RzBinAddr * binsym[RZ_BIN_SPECIAL_SYMBOL_LAST]
RzBinRelocStorage * relocs
int(* file_type)(RzBinFile *bf)
bool(* check_buffer)(RzBuffer *buf)
ut64(* baddr)(RzBinFile *bf)
bool(* check_bytes)(const ut8 *buf, ut64 length)
int(* demangle_type)(const char *str)
void(* header)(RzBinFile *bf)
bool(* load_buffer)(RzBinFile *bf, RzBinObject *obj, RzBuffer *buf, Sdb *sdb)
void(* destroy)(RzBinFile *bf)
ut64(* get_offset)(RzBinFile *bf, int type, int idx)
ut64(* get_vaddr)(RzBinFile *bf, ut64 baddr, ut64 paddr, ut64 vaddr)
ut64(* boffset)(RzBinFile *bf)
bool(* check_filename)(const char *filename)
Efficient storage of relocations to query by address.
RzBinReloc ** target_relocs
all relocs that have a valid target_vaddr, ordered by their target_vaddr. size is target_relocs_count...
size_t target_relocs_count
RzBinReloc ** relocs
all relocs, ordered by their vaddr
ut64 paddr
the paddr where the value should be patched into
ut64 vaddr
the vaddr where the value should be patched into
ut64 target_vaddr
the target address that the patched reloc points to
ut64 target_size
size per target
const RzBinSection * segment
RzStrConstPool filename_pool
RzStrConstPool filename_pool
RzBinSourceLineSample * samples
All source line references for given adresses.
A single sample of source line info for a specific address.
bool strseach_check_ascii_freq
RZ_DEPRECATE RzBinFile * cur
never use this in new code! Get a file from the binfiles list or track it yourself.
RZ_NONNULL RzBuffer * buf
bool buf_owned
whether buf is owned and freed by this RzBinVirtualFile
RZ_OWN RZ_NONNULL char * name
bool(* check_buffer)(RzBuffer *b)
void(* free_xtr)(void *xtr_obj)
void(* destroy)(RzBin *bin)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static const z80_opcode fd[]
int def(FILE *source, FILE *dest, int level)