Rizin
unix-like reverse engineering framework and cli tools
rz_bin.h
Go to the documentation of this file.
1 #ifndef RZ_BIN_H
2 #define RZ_BIN_H
3 
4 #include <rz_util.h>
5 #include <rz_types.h>
6 #include <rz_io.h>
7 #include <rz_cons.h>
8 #include <rz_list.h>
9 #include <ht_pu.h>
10 #include <rz_demangler.h>
11 #include <rz_hash.h>
12 
13 typedef struct rz_bin_t RzBin;
14 typedef struct rz_bin_file_t RzBinFile;
17 
18 #include <rz_bin_dwarf.h>
19 #include <rz_pdb.h>
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
26 
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
32 
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
39 
40 #define RZ_BIN_SIZEOF_STRINGS 512
41 #define RZ_BIN_MAX_ARCH 1024
42 
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
81 
82 /* RzBinSymbol->method_flags : */
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
105 
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"
116 
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"
135 
136 typedef enum {
143 
144 // name mangling types
145 typedef enum {
160 } RzBinLanguage;
161 
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)
164 
165 enum {
170 };
171 
172 typedef enum {
177  RZ_BIN_RELOC_64 = 64
179 
180 enum {
182  RZ_BIN_TYPE_CORE = 1
183 };
184 
185 typedef struct rz_bin_addr_t {
190  int type;
191  int bits;
193 
194 typedef struct rz_bin_hash_t {
195  const char *type;
197  int len;
200  ut8 buf[32];
201  const char *cmd;
203 
204 typedef struct rz_bin_file_hash_t {
205  const char *type;
206  const char *hex;
208 
209 typedef struct rz_bin_info_t {
210  char *file;
211  char *type;
212  char *bclass;
213  char *rclass;
214  char *arch;
215  char *cpu;
216  char *machine;
217  char *head_flag;
218  char *features;
219  char *os;
220  char *subsystem;
221  char *rpath;
222  char *guid;
224  const char *lang;
225  char *default_cc;
226  RzList /*<RzBinFileHash *>*/ *file_hashes;
227  int bits;
228  int has_va;
229  int has_pi; // pic/pie
234  int has_nx;
239  bool signature;
243  char *intrp;
244  char *compiler;
246 
251  bool big_endian;
256 
257 typedef struct rz_bin_string_database_t RzBinStrDb;
258 
259 typedef struct rz_bin_object_t {
265  RzList /*<RzBinVirtualFile>*/ *vfiles;
266  RzList /*<RzBinMap>*/ *maps;
267  RzList /*<RzBinSection>*/ *sections;
268  RzList /*<RzBinImport>*/ *imports;
269  RzList /*<RzBinSymbol>*/ *symbols;
270  RzList /*<RzBinResource>*/ *resources;
275  HtPP /*<const char *, RzBinSymbol>*/ *import_name_symbols; // currently only used for imports, but could be extended to all symbols if needed.
276  RzList /*<RzBinAddr>*/ *entries;
277  RzList /*<RzBinField>*/ *fields;
278  RzList /*<char*>*/ *libs;
281  RzList /*<RzBinClass>*/ *classes;
282  HtPP *classes_ht;
283  HtPP *methods_ht;
285  RzList /*<RzBinMem>*/ *mem;
286  char *regstate;
293  void *bin_obj; // internal pointer used by formats
295 
296 // XXX: RbinFile may hold more than one RzBinObject
299  char *file;
300  int fd;
301  int size;
306  void *xtr_obj;
308  /* values used when searching the strings */
311  int narch;
313  // struct rz_bin_plugin_t *curplugin; // use o->plugin
314  RzList /*<RzBinXtrData *>*/ *xtr_data;
316  struct rz_bin_t *rbin;
317 }; // RzBinFile
318 
319 typedef struct rz_bin_file_options_t {
320  int rawstr;
321  ut64 baddr; // base address
322  ut64 laddr; // load address
323  ut64 paddr; // offset
324  const char *plugname; // force a plugin? why do i need this?
325  // const char *xtrname;
327 
328 struct rz_bin_t {
329  const char *file;
331  int narch;
332  void *user;
334  /* preconfigured values */
335  int debase64;
337  int maxstrlen; //< <= 0 means no limit
339  int rawstr;
342  RzList /*<RzBinPlugin *>*/ *plugins;
343  RzList /*<RzBinXtrPlugin *>*/ *binxtrs;
344  RzList /*<RzBinFile *>*/ *binfiles;
346  int loadany;
349  char *force;
352  int filter; // symbol filtering
353  char strfilter; // string filtering
354  char *strpurge; // purge false positive strings
355  char *srcdir; // dir.source
356  char *prefix; // bin.prefix
357  char *strenc;
359  bool verbose;
360  bool use_xtr; // use extract plugins when loading a file?
361  bool strseach_check_ascii_freq; // str.search.check_ascii_freq
363  bool is_reloc_patched; // used to indicate whether relocations were patched or not
366 };
367 
368 typedef struct rz_bin_xtr_metadata_t {
369  char *arch;
370  int bits;
371  char *libname;
372  char *machine;
373  char *type;
374  const char *xtr_type;
376 
377 typedef int (*FREE_XTR)(void *xtr_obj);
378 typedef struct rz_bin_xtr_extract_t {
379  char *file;
385  int loaded;
388 
390 RZ_API void rz_bin_xtrdata_free(void /*RzBinXtrData*/ *data);
391 
392 typedef struct rz_bin_xtr_plugin_t {
393  char *name;
394  char *desc;
395  char *license;
396  int (*init)(void *user);
397  int (*fini)(void *user);
399 
400  RzBinXtrData *(*extract_from_bytes)(RzBin *bin, const ut8 *buf, ut64 size, int idx);
401  RzBinXtrData *(*extract_from_buffer)(RzBin *bin, RzBuffer *buf, int idx);
402  RzList /*<RzBinXtrData *>*/ *(*extractall_from_bytes)(RzBin *bin, const ut8 *buf, ut64 size);
403  RzList /*<RzBinXtrData *>*/ *(*extractall_from_buffer)(RzBin *bin, RzBuffer *buf);
404  RzBinXtrData *(*extract)(RzBin *bin, int idx);
405  RzList /*<RzBinXtrData *>*/ *(*extractall)(RzBin *bin);
406 
409  void (*destroy)(RzBin *bin);
410  void (*free_xtr)(void *xtr_obj);
412 
413 typedef struct rz_bin_arch_options_t {
414  const char *arch;
415  int bits;
417 
418 typedef struct rz_bin_trycatch_t {
424  // TODO: add type/name of exception
426 
429 
447 
455 
463 
468  const char *file;
470 
471 /*
472  * see documentation of RzBinSourceLineSample about what closing exactly means.
473  */
475  return !s->line && !s->column && !s->file;
476 }
477 
489 }; // RzBinSourceLineInfo
490 
495  RzVector /*<RzBinSourceLineSample>*/ samples; //< may be unsorted and will be sorted in the finalization step
498 
503 
507 
508 typedef struct rz_bin_plugin_t {
509  char *name;
510  char *desc;
511  char *author;
512  char *version;
513  char *license;
514  RZ_DEPRECATE Sdb *(*get_sdb)(RzBinFile *obj);
517  void (*destroy)(RzBinFile *bf);
520  bool (*check_filename)(const char *filename);
523  RzList /*<RzBinVirtualFile *>*/ *(*virtual_files)(RzBinFile *bf);
524  RzList /*<RzBinMap *>*/ *(*maps)(RzBinFile *bf);
526  RzList /*<RzBinAddr *>*/ *(*entries)(RzBinFile *bf);
527  RzList /*<RzBinSection *>*/ *(*sections)(RzBinFile *bf);
528  RZ_OWN RzBinSourceLineInfo *(*lines)(RzBinFile *bf); //< only called once on load, ownership is transferred to the caller
529  RzList /*<RzBinSymbol *>*/ *(*symbols)(RzBinFile *bf);
530  RzList /*<RzBinImport *>*/ *(*imports)(RzBinFile *bf);
531  RzList /*<RzBinString *>*/ *(*strings)(RzBinFile *bf);
532  RzBinInfo /*<RzBinInfo *>*/ *(*info)(RzBinFile *bf);
533  RzList /*<RzBinField *>*/ *(*fields)(RzBinFile *bf);
534  RzList /*<char *>*/ *(*libs)(RzBinFile *bf);
535  RzList /*<RzBinReloc *>*/ *(*relocs)(RzBinFile *bf);
536  RzList /*<RzBinTrycatch *>*/ *(*trycatch)(RzBinFile *bf);
537  RzList /*<RzBinClass *>*/ *(*classes)(RzBinFile *bf);
538  RzList /*<RzBinMem *>*/ *(*mem)(RzBinFile *bf);
539  RzList /*<RzBinReloc *>*/ *(*patch_relocs)(RzBinFile *bf);
540  RzList /*<RzBinFileHash *>*/ *(*hashes)(RzBinFile *bf);
541  RzList /*<RzBinResource *>*/ *(*resources)(RzBinFile *bf);
542  void (*header)(RzBinFile *bf);
543  char *(*signature)(RzBinFile *bf, bool json);
544  int (*demangle_type)(const char *str);
545  char *(*enrich_asm)(RzBinFile *bf, const char *asm_str, int asm_len);
546  ut64 (*get_offset)(RzBinFile *bf, int type, int idx);
547  char *(*get_name)(RzBinFile *bf, int type, int idx);
548  ut64 (*get_vaddr)(RzBinFile *bf, ut64 baddr, ut64 paddr, ut64 vaddr);
549  char *(*section_type_to_string)(ut64 type);
550  RzList /*<char *>*/ *(*section_flag_to_rzlist)(ut64 flag);
551  RzBuffer *(*create)(RzBin *bin, const ut8 *code, int codelen, const ut8 *data, int datalen, RzBinArchOptions *opt);
552  char *(*demangle)(const char *str);
553  char *(*regstate)(RzBinFile *bf);
555  /* default value if not specified by user */
557  char strfilter;
558  void *user;
560 
561 typedef void (*RzBinSymbollCallback)(RzBinObject *obj, void *symbol);
562 
595 typedef struct rz_bin_virtual_file_t {
598  bool buf_owned;
600 
602 typedef struct rz_bin_map_t {
609 
617 
618 typedef struct rz_bin_section_t {
619  char *name;
626  // per section platform info
627  const char *arch;
630  char *format;
631  int bits;
633  bool is_data;
636 
641 typedef struct rz_bin_section_map_t {
645 
646 typedef struct rz_bin_class_t {
647  char *name;
648  // TODO: char *module;
649  char *super;
650  char *visibility_str; // XXX only used by java
651  int index;
653  RzList *methods; // <RzBinSymbol>
654  RzList *fields; // <RzBinField>
655  // RzList *interfaces; // <char *>
658 
659 #define RzBinSectionName rz_offsetof(RzBinSection, name)
660 #define RzBinSectionOffset rz_offsetof(RzBinSection, offset)
661 
662 #define REBASE_PADDR(o, l, type_t) \
663  do { \
664  if ((o)->opts.loadaddr) { \
665  RzListIter *_it; \
666  type_t *_el; \
667  rz_list_foreach ((l), _it, _el) { \
668  _el->paddr += (o)->opts.loadaddr; \
669  } \
670  } \
671  } while (0)
672 
673 typedef struct rz_bin_symbol_t {
674  /* heap-allocated */
675  char *name;
676  char *dname;
677  char *libname;
678  char *classname;
679  /* const-unique-strings */
680  const char *forwarder;
681  const char *bind;
682  const char *type;
683  const char *rtype;
685  /* only used by java */
687  // ----------------
688  // char descriptor[RZ_BIN_SIZEOF_STRINGS+1];
694  int bits;
695  /* see RZ_BIN_METH_* constants */
699 
700 typedef struct rz_bin_import_t {
701  char *name;
702  char *libname;
703  const char *bind;
704  const char *type;
705  char *classname;
706  char *descriptor;
710 
711 typedef struct rz_bin_reloc_t {
714  RzBinImport *import;
720  bool additive;
721  /* is_ifunc: indirect function, `addend` points to a resolver function
722  * that returns the actual relocation value, e.g. chooses
723  * an optimized version depending on the CPU.
724  * cf. https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
725  */
726  bool is_ifunc;
728 
730 
734  size_t relocs_count;
737 }; // RzBinRelocStorage
738 
742 
745  return storage->target_relocs_count != 0;
746 }
747 
749 
750 typedef struct rz_bin_string_t {
751  // TODO: rename string->name (avoid colisions)
752  char *string;
756  ut32 size; // size of buffer containing the string in bytes
757  ut32 length; // length of string in chars
758  char type; // Ascii Wide cp850 utf8 mutf8 base64 ...
760 
761 typedef struct rz_bin_field_t {
764  int size;
765  int offset;
767  char *name;
768  char *type;
770  char *comment;
771  char *format;
772  bool format_named; // whether format is the name of a format or a raw pf format string
775 
776 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);
777 RZ_API void rz_bin_field_free(RzBinField *field);
778 
779 typedef struct rz_bin_mem_t {
780  char *name;
782  int size;
783  int perms;
784  RzList /*<RzBinMem>*/ *mirrors; // for mirror access; stuff here should only create new maps not new fds
786 
787 typedef struct rz_bin_resource_t {
788  size_t index;
789  char *name;
790  char *time;
793  char *type;
794  char *language;
796 
797 // TODO: deprecate rz_bin_is_big_endian
798 // TODO: has_dbg_syms... maybe flags?
799 
800 typedef ut64 (*RzBinGetOffset)(RzBin *bin, int type, int idx);
801 typedef char *(*RzBinGetName)(RzBin *bin, int type, int idx);
802 typedef RzList *(*RzBinGetSections)(RzBin *bin);
803 typedef RzBinSection *(*RzBinGetSectionAt)(RzBin *bin, ut64 addr);
804 typedef char *(*RzBinDemangle)(RzBinFile *bf, const char *def, const char *str, ut64 vaddr, bool libs);
805 
806 typedef struct rz_bin_bind_t {
815 
819 RZ_API RzList /*<RzBinSection *>*/ *rz_bin_sections_of_maps(RzList /*<RzBinMap *>*/ *maps);
828 static inline bool rz_bin_reloc_has_target(RzBinReloc *reloc) {
829  return reloc->target_vaddr && reloc->target_vaddr != UT64_MAX;
830 }
831 RZ_API void rz_bin_reloc_free(RzBinReloc *reloc);
832 RZ_API RzBinSymbol *rz_bin_symbol_new(const char *name, ut64 paddr, ut64 vaddr);
833 RZ_API void rz_bin_string_free(void *_str);
834 
835 #ifdef RZ_API
836 
837 typedef struct rz_bin_options_t {
838  const char *pluginname;
839  RzBinObjectLoadOptions obj_opts;
840  ut64 sz;
841  int xtr_idx; // load Nth binary
842  int fd;
843  const char *filename;
844 } RzBinOptions;
845 
846 typedef struct rz_event_bin_file_del_t {
847  RzBinFile *bf;
848 } RzEventBinFileDel;
849 
851 RZ_API const char *rz_bin_symbol_name(RzBinSymbol *s);
852 typedef void (*RzBinSymbolCallback)(RzBinObject *obj, RzBinSymbol *symbol);
853 
854 // common functionality for patching relocs
856 
857 typedef struct rz_bin_reloc_target_builder RzBinRelocTargetBuilder;
858 RZ_API RzBinRelocTargetBuilder *rz_bin_reloc_target_builder_new(ut64 target_size, ut64 target_base);
859 RZ_API void rz_bin_reloc_target_builder_free(RzBinRelocTargetBuilder *builder);
860 RZ_API ut64 rz_bin_reloc_target_builder_get_target(RzBinRelocTargetBuilder *builder, ut64 sym);
861 
862 RZ_API void rz_bin_relocs_patch_maps(RZ_NONNULL RzList /*<RzBinMap *>*/ *maps,
863  RZ_NULLABLE RzBuffer *buf_patched, ut64 buf_patched_offset,
864  ut64 target_vfile_base, ut64 target_vfile_size,
865  RZ_NONNULL const char *vfile_name_patched, RZ_NONNULL const char *vfile_name_reloc_targets);
866 
867 // options functions
868 RZ_API void rz_bin_options_init(RzBinOptions *opt, int fd, ut64 baseaddr, ut64 loadaddr, bool patch_relocs);
869 RZ_API void rz_bin_arch_options_init(RzBinArchOptions *opt, const char *arch, int bits);
870 
871 // open/close/reload functions
872 RZ_API RzBin *rz_bin_new(void);
873 RZ_API void rz_bin_free(RzBin *bin);
874 RZ_API RzBinFile *rz_bin_open(RzBin *bin, const char *file, RzBinOptions *opt);
875 RZ_API RzBinFile *rz_bin_open_io(RzBin *bin, RzBinOptions *opt);
876 RZ_API RzBinFile *rz_bin_open_buf(RzBin *bin, RzBuffer *buf, RzBinOptions *opt);
878 
879 // plugins/bind functions
880 RZ_API void rz_bin_bind(RzBin *b, RzBinBind *bnd);
883 RZ_API bool rz_bin_list_plugin(RzBin *bin, const char *name, PJ *pj, int json);
887 RZ_API void rz_bin_force_plugin(RzBin *bin, const char *pname);
888 
889 // get/set various bin information
892 RZ_API void rz_bin_set_user_ptr(RzBin *bin, void *user);
897 RZ_API RZ_OWN RzList /*<RzBinString *>*/ *rz_bin_file_strings(RZ_NONNULL RzBinFile *bf, size_t min_length, bool raw_strings);
898 
899 // use RzBinFile instead
910 RZ_API RzList /*<RzBinTrycatch *>*/ *rz_bin_file_get_trycatch(RZ_NONNULL RzBinFile *bf);
911 
912 RZ_API const RzList /*<RzBinAddr *>*/ *rz_bin_object_get_entries(RZ_NONNULL RzBinObject *obj);
913 RZ_API const RzList /*<RzBinField *>*/ *rz_bin_object_get_fields(RZ_NONNULL RzBinObject *obj);
914 RZ_API const RzList /*<RzBinImport *>*/ *rz_bin_object_get_imports(RZ_NONNULL RzBinObject *obj);
916 RZ_API const RzList /*<char *>*/ *rz_bin_object_get_libs(RZ_NONNULL RzBinObject *obj);
917 RZ_API const RzList /*<RzBinSection *>*/ *rz_bin_object_get_sections_all(RZ_NONNULL RzBinObject *obj);
920 RZ_API const RzList /*<RzBinClass *>*/ *rz_bin_object_get_classes(RZ_NONNULL RzBinObject *obj);
921 RZ_API const RzList /*<RzBinString *>*/ *rz_bin_object_get_strings(RZ_NONNULL RzBinObject *obj);
922 RZ_API const RzList /*<RzBinMem *>*/ *rz_bin_object_get_mem(RZ_NONNULL RzBinObject *obj);
923 RZ_API const RzList /*<RzBinResource *>*/ *rz_bin_object_get_resources(RZ_NONNULL RzBinObject *obj);
924 RZ_API const RzList /*<RzBinSymbol *>*/ *rz_bin_object_get_symbols(RZ_NONNULL RzBinObject *obj);
930 RZ_API RZ_OWN RzPVector /*<RzBinMap *>*/ *rz_bin_object_get_maps_at(RzBinObject *o, ut64 off, bool va);
935 
937 RZ_API RzBinLanguage rz_bin_language_to_id(const char *language);
938 RZ_API const char *rz_bin_language_to_string(RzBinLanguage language);
939 
942 
943 // select/list binfiles functions
944 RZ_API bool rz_bin_select(RzBin *bin, const char *arch, int bits, const char *name);
945 RZ_API bool rz_bin_select_bfid(RzBin *bin, ut32 bf_id);
946 RZ_API bool rz_bin_use_arch(RzBin *bin, const char *arch, int bits, const char *name);
947 RZ_API RzBuffer *rz_bin_create(RzBin *bin, const char *plugin_name, const ut8 *code, int codelen, const ut8 *data, int datalen, RzBinArchOptions *opt);
948 
949 RZ_API const char *rz_bin_entry_type_string(int etype);
950 
952 
953 // RzBinFile.get
955 RZ_API RzList /*<RzBinSymbol *>*/ *rz_bin_file_get_symbols(RzBinFile *bf);
956 // RzBinFile.add
957 RZ_API RzBinClass *rz_bin_file_add_class(RzBinFile *binfile, const char *name, const char *super, int view);
958 RZ_API RzBinSymbol *rz_bin_file_add_method(RzBinFile *bf, const char *classname, const char *name, int nargs);
959 // RzBinFile.find
964 
968 RZ_API bool rz_bin_file_set_cur_by_name(RzBin *bin, const char *name);
972 RZ_API RZ_OWN RzList /*<RzBinFileHash *>*/ *rz_bin_file_set_hashes(RzBin *bin, RZ_OWN RzList /*<RzBinFileHash *>*/ *new_hashes);
975 
976 // binobject functions
984 RZ_API void rz_bin_mem_free(void *data);
985 
986 // demangle functions
987 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);
988 RZ_API const char *rz_bin_get_meth_flag_string(ut64 flag, bool compact);
989 
991 
992 /* dbginfo.c */
993 RZ_DEPRECATE RZ_API bool rz_bin_addr2line(RzBin *bin, ut64 addr, char *file, int len, int *line);
995 
996 /* filter.c */
997 RZ_API void rz_bin_load_filter(RzBin *bin, ut64 rules);
998 RZ_API void rz_bin_filter_symbols(RzBinFile *bf, RzList /*<RzBinSymbol *>*/ *list);
999 RZ_API void rz_bin_filter_sections(RzBinFile *bf, RzList /*<RzBinSection *>*/ *list);
1000 RZ_API char *rz_bin_filter_name(RzBinFile *bf, HtPU *db, ut64 addr, char *name);
1001 RZ_API void rz_bin_filter_sym(RzBinFile *bf, HtPP *ht, ut64 vaddr, RzBinSymbol *sym);
1002 RZ_API bool rz_bin_strpurge(RzBin *bin, const char *str, ut64 addr);
1003 RZ_API bool rz_bin_string_filter(RzBin *bin, const char *str, int len, ut64 addr);
1004 
1005 /* bin string */
1010 RZ_API bool rz_bin_string_database_remove(RZ_NONNULL RzBinStrDb *db, ut64 address, bool is_va);
1011 
1012 /* plugin pointers */
1014 extern RzBinPlugin rz_bin_plugin_fs;
1043 extern RzBinXtrPlugin rz_bin_xtr_plugin_xtr_dyldcache;
1071 
1072 #ifdef __cplusplus
1073 }
1074 #endif
1075 
1076 #endif
1077 #endif
size_t len
Definition: 6502dis.c:15
RZ_API bool rz_bin_file_set_cur_binfile(RzBin *bin, RzBinFile *bf)
Definition: bfile.c:288
RZ_API RZ_OWN RzList * rz_bin_file_set_hashes(RzBin *bin, RZ_OWN RzList *new_hashes)
Set file_hashes on current RzBinInfo.
Definition: bfile.c:488
RZ_API ut64 rz_bin_file_delete_all(RzBin *bin)
Definition: bfile.c:199
RZ_API RzBinSymbol * rz_bin_file_add_method(RzBinFile *bf, const char *klass, const char *method, int nargs)
Definition: bfile.c:543
RZ_API RzBinClass * rz_bin_file_add_class(RzBinFile *bf, const char *name, const char *super, int view)
Definition: bfile.c:523
RZ_API RzBinFile * rz_bin_file_find_by_name(RzBin *bin, const char *name)
Definition: bfile.c:239
RZ_API RzBinFile * rz_bin_file_find_by_id(RzBin *bin, ut32 bf_id)
Definition: bfile.c:188
RZ_API bool rz_bin_file_set_cur_by_fd(RzBin *bin, ut32 bin_fd)
Definition: bfile.c:258
RZ_API RzList * rz_bin_file_get_symbols(RzBinFile *bf)
Definition: bfile.c:572
RZ_API RzBinFile * rz_bin_file_find_by_fd(RzBin *bin, ut32 bin_fd)
Definition: bfile.c:226
RZ_API bool rz_bin_file_delete(RzBin *bin, RzBinFile *bf)
Definition: bfile.c:213
RZ_API RzBinFile * rz_bin_file_find_by_arch_bits(RzBin *bin, const char *arch, int bits)
Definition: bfile.c:163
RZ_API RZ_OWN RzList * rz_bin_file_compute_hashes(RzBin *bin, RzBinFile *bf, ut64 limit)
Definition: bfile.c:411
RZ_API bool rz_bin_file_set_cur_by_id(RzBin *bin, ut32 bin_id)
Definition: bfile.c:253
RZ_API RzBinPlugin * rz_bin_file_cur_plugin(RzBinFile *bf)
Definition: bfile.c:348
RZ_API bool rz_bin_file_object_new_from_xtr_data(RzBin *bin, RzBinFile *bf, RzBinObjectLoadOptions *opts, RzBinXtrData *data)
Definition: bfile.c:94
RZ_API bool rz_bin_file_set_cur_by_name(RzBin *bin, const char *name)
Definition: bfile.c:293
RZ_API ut64 rz_bin_file_get_baddr(RzBinFile *bf)
Definition: bfile.c:352
RZ_API RzList * rz_bin_file_get_trycatch(RZ_NONNULL RzBinFile *bf)
Definition: bfile.c:564
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.
Definition: bfile_string.c:325
RZ_API void rz_bin_filter_symbols(RzBinFile *bf, RzList *list)
Definition: filter.c:128
RZ_API void rz_bin_filter_sections(RzBinFile *bf, RzList *list)
Definition: filter.c:144
RZ_API char * rz_bin_filter_name(RzBinFile *bf, HtPU *db, ut64 vaddr, char *name)
Definition: filter.c:33
RZ_API void rz_bin_filter_sym(RzBinFile *bf, HtPP *ht, ut64 vaddr, RzBinSymbol *sym)
Definition: filter.c:81
RZ_API bool rz_bin_string_filter(RzBin *bin, const char *str, int len, ut64 addr)
Definition: filter.c:385
RZ_API bool rz_bin_strpurge(RzBin *bin, const char *str, ut64 refaddr)
Definition: filter.c:208
RZ_API const char * rz_bin_entry_type_string(int etype)
Definition: bin.c:912
RZ_DEPRECATE RZ_API RZ_BORROW RzBinInfo * rz_bin_get_info(RzBin *bin)
Definition: bin.c:585
RZ_API RzBinImport * rz_bin_import_clone(RzBinImport *o)
Definition: bin.c:125
RZ_API RzBin * rz_bin_new(void)
Definition: bin.c:716
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_entries(RZ_NONNULL RzBin *bin)
Definition: bin.c:567
RZ_API ut64 rz_bin_get_laddr(RzBin *bin)
Definition: bin.c:542
RZ_API RzBinObject * rz_bin_cur_object(RzBin *bin)
Definition: bin.c:900
RZ_API bool rz_bin_plugin_add(RzBin *bin, RzBinPlugin *foo)
Definition: bin.c:404
RZ_API ut64 rz_bin_get_size(RzBin *bin)
Definition: bin.c:889
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_imports(RZ_NONNULL RzBin *bin)
Definition: bin.c:579
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_mem(RZ_NONNULL RzBin *bin)
Definition: bin.c:702
RZ_API void rz_bin_load_filter(RzBin *bin, ut64 rules)
Definition: bin.c:930
RZ_API void rz_bin_file_hash_free(RzBinFileHash *fhash)
Definition: bin.c:89
RZ_API void rz_bin_bind(RzBin *bin, RzBinBind *b)
Definition: bin.c:851
RZ_API RzBinPlugin * rz_bin_get_binplugin_by_buffer(RzBin *bin, RzBuffer *buf)
Definition: bin.c:349
RZ_API void rz_bin_set_user_ptr(RzBin *bin, void *user)
Definition: bin.c:839
RZ_API RzBinFile * rz_bin_open_buf(RzBin *bin, RzBuffer *buf, RzBinOptions *opt)
Definition: bin.c:238
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_classes(RZ_NONNULL RzBin *bin)
Definition: bin.c:883
RZ_API RzBinFile * rz_bin_file_at(RzBin *bin, ut64 at)
Definition: bin.c:1160
RZ_API const char * rz_bin_symbol_name(RzBinSymbol *s)
Definition: bin.c:158
RZ_API bool rz_bin_list_plugin(RzBin *bin, const char *name, PJ *pj, int json)
Definition: bin.c:510
RZ_API const RzBinPlugin * rz_bin_plugin_get(RZ_NONNULL RzBin *bin, RZ_NONNULL const char *name)
Get a RzBinPlugin by name.
Definition: bin.c:1197
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_libs(RZ_NONNULL RzBin *bin)
Definition: bin.c:591
RZ_API RzBinFile * rz_bin_open_io(RzBin *bin, RzBinOptions *opt)
Definition: bin.c:283
RZ_DEPRECATE RZ_API int rz_bin_is_static(RZ_NONNULL RzBin *bin)
Definition: bin.c:708
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 .
Definition: bin.c:643
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_symbols(RZ_NONNULL RzBin *bin)
Definition: bin.c:696
RZ_API void rz_bin_arch_options_init(RzBinArchOptions *opt, const char *arch, int bits)
Definition: bin.c:84
RZ_API const RzBinXtrPlugin * rz_bin_xtrplugin_get(RZ_NONNULL RzBin *bin, RZ_NONNULL const char *name)
Get a RzBinXtrPlugin by name.
Definition: bin.c:1214
RZ_API bool rz_bin_select_bfid(RzBin *bin, ut32 bf_id)
Definition: bin.c:833
RZ_API ut64 rz_bin_get_baddr(RzBin *bin)
Definition: bin.c:536
RZ_API RZ_OWN RzPVector * rz_bin_object_get_maps_at(RzBinObject *o, ut64 off, bool va)
Find all binary maps at offset off .
Definition: bin.c:668
RZ_API void rz_bin_force_plugin(RzBin *bin, const char *name)
Definition: bin.c:906
RZ_API RZ_BORROW RzBinSection * rz_bin_get_section_at(RzBinObject *o, ut64 off, int va)
Find the binary section at offset off.
Definition: bin.c:611
RZ_API RzBuffer * rz_bin_create(RzBin *bin, const char *p, const ut8 *code, int codelen, const ut8 *data, int datalen, RzBinArchOptions *opt)
Definition: bin.c:862
RZ_API bool rz_bin_xtr_add(RzBin *bin, RzBinXtrPlugin *foo)
Definition: bin.c:421
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.
Definition: bin.c:1295
RZ_API RzBinFile * rz_bin_reload(RzBin *bin, RzBinFile *bf, ut64 baseaddr)
Definition: bin.c:216
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_strings(RZ_NONNULL RzBin *bin)
Definition: bin.c:690
RZ_API void rz_bin_options_init(RzBinOptions *opt, int fd, ut64 baseaddr, ut64 loadaddr, bool patch_relocs)
Definition: bin.c:75
RZ_API RzBinFile * rz_bin_open(RzBin *bin, const char *file, RzBinOptions *opt)
Definition: bin.c:200
RZ_API RzBinFile * rz_bin_cur(RzBin *bin)
Definition: bin.c:895
RZ_API const char * rz_bin_get_meth_flag_string(ut64 flag, bool compact)
Definition: bin.c:961
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_sections(RZ_NONNULL RzBin *bin)
Definition: bin.c:597
RZ_API bool rz_bin_select(RzBin *bin, const char *arch, int bits, const char *name)
Definition: bin.c:813
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_fields(RZ_NONNULL RzBin *bin)
Definition: bin.c:573
RZ_API void rz_bin_free(RzBin *bin)
Definition: bin.c:440
RZ_API bool rz_bin_use_arch(RzBin *bin, const char *arch, int bits, const char *name)
Definition: bin.c:787
RZ_API void rz_bin_set_baddr(RzBin *bin, ut64 baddr)
Definition: bin.c:549
RzBinPlugin rz_bin_plugin_any
Definition: bin_any.c:62
static ut64 baddr(RzBinFile *bf)
Definition: bin_any.c:58
RzBinPlugin rz_bin_plugin_art
Definition: bin_art.c:208
RzBinPlugin rz_bin_plugin_avr
Definition: bin_avr.c:203
RzBinPlugin rz_bin_plugin_bf
Definition: bin_bf.c:150
static RzList * maps(RzBinFile *bf)
Definition: bin_bf.c:116
RzBinPlugin rz_bin_plugin_bflt
Definition: bin_bflt.c:255
RzBinPlugin rz_bin_plugin_bios
Definition: bin_bios.c:136
RzBinPlugin rz_bin_plugin_bootimg
Definition: bin_bootimg.c:243
RzBinPlugin rz_bin_plugin_cgc
Definition: bin_cgc.c:103
static RzList * libs(RzBinFile *bf)
Definition: bin_coff.c:379
RzBinPlugin rz_bin_plugin_coff
Definition: bin_coff.c:523
RzBinPlugin rz_bin_plugin_dex
Definition: bin_dex.c:240
RzBinPlugin rz_bin_plugin_dmp64
Definition: bin_dmp64.c:276
RzBinPlugin rz_bin_plugin_dol
Definition: bin_dol.c:170
RzBinPlugin rz_bin_plugin_dyldcache
RzBinPlugin rz_bin_plugin_elf64
Definition: bin_elf64.c:18
RzBinPlugin rz_bin_plugin_elf
Definition: bin_elf.c:12
RzBinPlugin rz_bin_plugin_java
Definition: bin_java.c:231
RZ_API RzBinLanguage rz_bin_language_detect(RzBinFile *binfile)
Tries to detect which language is used in the binary based on symbols and libraries.
Definition: bin_language.c:69
RZ_API RzBinLanguage rz_bin_language_to_id(const char *language)
returns the language identifier based on the given lang name
Definition: bin_language.c:193
RZ_API const char * rz_bin_language_to_string(RzBinLanguage language)
returns the language name based on the given language identifier
Definition: bin_language.c:229
RzBinPlugin rz_bin_plugin_le
Definition: bin_le.c:156
RzBinPlugin rz_bin_plugin_luac
Definition: bin_luac.c:130
RzBinPlugin rz_bin_plugin_mach064
Definition: bin_mach064.c:294
RzBinPlugin rz_bin_plugin_mach0
Definition: bin_mach0.c:855
RzBinPlugin rz_bin_plugin_mbn
Definition: bin_mbn.c:184
RzBinPlugin rz_bin_plugin_mdmp
Definition: bin_mdmp.c:467
RzBinPlugin rz_bin_plugin_menuet
Definition: bin_menuet.c:205
RzBinPlugin rz_bin_plugin_mz
Definition: bin_mz.c:257
RzBinPlugin rz_bin_plugin_ne
Definition: bin_ne.c:118
RzList * relocs(RzBinFile *bf)
Definition: bin_ne.c:114
RzBinPlugin rz_bin_plugin_nes
Definition: bin_nes.c:223
RzBinPlugin rz_bin_plugin_nin3ds
Definition: bin_nin3ds.c:130
RzBinPlugin rz_bin_plugin_ninds
Definition: bin_ninds.c:128
RzBinPlugin rz_bin_plugin_ningb
Definition: bin_ningb.c:250
RzBinPlugin rz_bin_plugin_ningba
Definition: bin_ningba.c:88
RzBinPlugin rz_bin_plugin_nro
Definition: bin_nro.c:331
RzBinPlugin rz_bin_plugin_nso
Definition: bin_nso.c:387
RzBinPlugin rz_bin_plugin_omf
Definition: bin_omf.c:165
RzBinPlugin rz_bin_plugin_p9
Definition: bin_p9.c:256
RzBinPlugin rz_bin_plugin_pe64
Definition: bin_pe64.c:548
RzBinPlugin rz_bin_plugin_pe
Definition: bin_pe.c:459
RzBinPlugin rz_bin_plugin_pebble
Definition: bin_pebble.c:185
RzBinPlugin rz_bin_plugin_prg
Definition: bin_prg.c:78
RzBinPlugin rz_bin_plugin_psxexe
Definition: bin_psxexe.c:116
RzBinPlugin rz_bin_plugin_pyc
Definition: bin_pyc.c:140
RzBinPlugin rz_bin_plugin_qnx
Definition: bin_qnx.c:310
RzBinPlugin rz_bin_plugin_sfc
Definition: bin_sfc.c:288
RzBinPlugin rz_bin_plugin_smd
Definition: bin_smd.c:322
RzBinPlugin rz_bin_plugin_sms
Definition: bin_sms.c:103
RzBinPlugin rz_bin_plugin_spc700
Definition: bin_spc700.c:82
RzBinPlugin rz_bin_plugin_symbols
Definition: bin_symbols.c:456
RzBinPlugin rz_bin_plugin_te
Definition: bin_te.c:152
RzBinPlugin rz_bin_plugin_vsf
Definition: bin_vsf.c:535
RzBinPlugin rz_bin_plugin_wasm
Definition: bin_wasm.c:327
RzBinPlugin rz_bin_plugin_xbe
Definition: bin_xbe.c:371
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
Definition: bin_z64.c:150
RzBinPlugin rz_bin_plugin_zimg
Definition: bin_zimg.c:57
int bits(struct state *s, int need)
Definition: blast.c:72
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.
Definition: bobj.c:1117
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.
Definition: bobj.c:1036
RZ_API const RzBinInfo * rz_bin_object_get_info(RZ_NONNULL RzBinObject *obj)
Get the RzBinInfo of the binary object.
Definition: bobj.c:734
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.
Definition: bobj.c:710
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.
Definition: bobj.c:790
RZ_API void rz_bin_string_database_free(RZ_NULLABLE RzBinStrDb *db)
Frees a RzBinStrDb structure.
Definition: bobj.c:1076
RZ_API RzBinVirtualFile * rz_bin_object_get_virtual_file(RzBinObject *o, const char *name)
Definition: bobj.c:624
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.
Definition: bobj.c:861
RZ_API void rz_bin_string_decode_base64(RZ_NONNULL RzBinString *bstr)
Tries to decode the base64 string hold by RzBinString and overwrites it.
Definition: bobj.c:15
RZ_API const RzList * rz_bin_object_get_imports(RZ_NONNULL RzBinObject *obj)
Get list of RzBinImport representing the imports of the binary object.
Definition: bobj.c:726
RZ_API int rz_bin_object_set_items(RzBinFile *bf, RzBinObject *o)
Definition: bobj.c:392
RZ_API const RzBinAddr * rz_bin_object_get_special_symbol(RzBinObject *o, RzBinSpecialSymbol sym)
Return the RzBinAddr structure representing the special symbol sym.
Definition: bobj.c:699
RZ_API const RzList * rz_bin_object_get_fields(RZ_NONNULL RzBinObject *obj)
Get list of RzBinField representing the fields of the binary object.
Definition: bobj.c:718
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.
Definition: bobj.c:902
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.
Definition: bobj.c:742
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.
Definition: bobj.c:750
RZ_API ut64 rz_bin_object_addr_with_base(RzBinObject *o, ut64 addr)
Put the given address on top of o's base address.
Definition: bobj.c:661
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.
Definition: bobj.c:987
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...
Definition: bobj.c:616
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.
Definition: bobj.c:798
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.
Definition: bobj.c:833
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.
Definition: bobj.c:1015
RZ_API ut64 rz_bin_object_get_vaddr(RzBinObject *o, ut64 paddr, ut64 vaddr)
Definition: bobj.c:669
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.
Definition: bobj.c:809
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.
Definition: bobj.c:970
RZ_API void rz_bin_mem_free(void *data)
Definition: bobj.c:49
RZ_API bool rz_bin_string_database_add(RZ_NONNULL RzBinStrDb *db, RZ_NONNULL RzBinString *bstr)
{ function_description }
Definition: bobj.c:1094
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.
Definition: bobj.c:825
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.
Definition: bobj.c:782
RZ_API bool rz_bin_object_is_big_endian(RZ_NONNULL RzBinObject *obj)
Return true if the binary object obj is big endian.
Definition: bobj.c:875
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.
Definition: bobj.c:774
RZ_API const RzList * rz_bin_object_get_symbols(RZ_NONNULL RzBinObject *obj)
Get list of RzBinSymbol representing the symbols in the binary object.
Definition: bobj.c:817
RZ_API RzBinRelocStorage * rz_bin_object_patch_relocs(RzBinFile *bf, RzBinObject *o)
Definition: bobj.c:590
RZ_API bool rz_bin_object_is_static(RZ_NONNULL RzBinObject *obj)
Return true if the binary object obj is detected as statically compiled.
Definition: bobj.c:883
#define RZ_API
cs_arch arch
Definition: cstool.c:13
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
Definition: sflib.h:133
RZ_DEPRECATE RZ_API bool rz_bin_addr2line(RzBin *bin, ut64 addr, char *file, int len, int *line)
Definition: dbginfo.c:194
RZ_DEPRECATE RZ_API char * rz_bin_addr2text(RzBin *bin, ut64 addr, int origin)
Definition: dbginfo.c:217
uint32_t ut32
size_t map(int syms, int left, int len)
Definition: enough.c:237
voidpf void uLong size
Definition: ioapi.h:138
const char * filename
Definition: ioapi.h:137
voidpf uLong int origin
Definition: ioapi.h:144
voidpf uLong offset
Definition: ioapi.h:144
voidpf void * buf
Definition: ioapi.h:138
uint8_t ut8
Definition: lh5801.h:11
static RzMain foo[]
Definition: main.c:11
static void list(RzEgg *egg)
Definition: rz-gg.c:52
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
Definition: sflib.h:126
const char * source
Definition: lz4.h:699
RZ_API void MACH0_() patch_relocs(RzBinFile *bf, struct MACH0_(obj_t) *obj)
Patching of external relocs in a sparse overlay buffer.
Definition: mach0_relocs.c:614
static uint32_t const uint8_t uint32_t uint32_t limit
Definition: memcmplen.h:45
int type
Definition: mipsasm.c:17
line
Definition: setup.py:34
int idx
Definition: setup.py:197
int off
Definition: pal.c:13
const char * code
Definition: pal.c:98
RZ_API ut64 rz_bin_reloc_target_builder_get_target(RzBinRelocTargetBuilder *builder, ut64 sym)
obtain the address of the target for a given symbol
Definition: relocs_patch.c:69
RZ_API void rz_bin_reloc_target_builder_free(RzBinRelocTargetBuilder *builder)
Definition: relocs_patch.c:51
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.
Definition: relocs_patch.c:86
RZ_API RzBinRelocTargetBuilder * rz_bin_reloc_target_builder_new(ut64 target_size, ut64 target_base)
Definition: relocs_patch.c:35
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.
Definition: relocs_patch.c:8
static RzSocket * s
Definition: rtr.c:28
RZ_API void rz_bin_info_free(RzBinInfo *rb)
Definition: bin.c:97
RZ_API void rz_bin_source_line_info_free(RzBinSourceLineInfo *sli)
Definition: dbginfo.c:137
int(* FREE_XTR)(void *xtr_obj)
Definition: rz_bin.h:377
RZ_API const RzBinSourceLineSample * rz_bin_source_line_info_get_next(const RzBinSourceLineInfo *sli, RZ_NONNULL const RzBinSourceLineSample *cur)
Definition: dbginfo.c:182
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)
Definition: rz_bin.h:804
RZ_API RzBinSymbol * rz_bin_symbol_new(const char *name, ut64 paddr, ut64 vaddr)
Definition: bin.c:165
struct rz_bin_reloc_t RzBinReloc
RzBinLanguage
Definition: rz_bin.h:145
@ RZ_BIN_LANGUAGE_UNKNOWN
Definition: rz_bin.h:146
@ RZ_BIN_LANGUAGE_GROOVY
Definition: rz_bin.h:157
@ RZ_BIN_LANGUAGE_OBJC
Definition: rz_bin.h:151
@ RZ_BIN_LANGUAGE_KOTLIN
Definition: rz_bin.h:156
@ RZ_BIN_LANGUAGE_RUST
Definition: rz_bin.h:155
@ RZ_BIN_LANGUAGE_DLANG
Definition: rz_bin.h:153
@ RZ_BIN_LANGUAGE_C
Definition: rz_bin.h:148
@ RZ_BIN_LANGUAGE_JAVA
Definition: rz_bin.h:147
@ RZ_BIN_LANGUAGE_DART
Definition: rz_bin.h:158
@ RZ_BIN_LANGUAGE_CXX
Definition: rz_bin.h:150
@ RZ_BIN_LANGUAGE_SWIFT
Definition: rz_bin.h:152
@ RZ_BIN_LANGUAGE_MSVC
Definition: rz_bin.h:154
@ RZ_BIN_LANGUAGE_GO
Definition: rz_bin.h:149
@ RZ_BIN_LANGUAGE_BLOCKS
Definition: rz_bin.h:159
struct rz_bin_class_t RzBinClass
RZ_API RzBinSection * rz_bin_section_new(const char *name)
Definition: bin.c:1108
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.
Definition: bin.c:1151
struct rz_bin_resource_t RzBinResource
@ RZ_BIN_CLASS_PUBLIC
Definition: rz_bin.h:167
@ RZ_BIN_CLASS_FRIENDLY
Definition: rz_bin.h:168
@ RZ_BIN_CLASS_PROTECTED
Definition: rz_bin.h:169
@ RZ_BIN_CLASS_PRIVATE
Definition: rz_bin.h:166
RzBinRelocType
Definition: rz_bin.h:172
@ RZ_BIN_RELOC_32
Definition: rz_bin.h:176
@ RZ_BIN_RELOC_24
Definition: rz_bin.h:175
@ RZ_BIN_RELOC_16
Definition: rz_bin.h:174
@ RZ_BIN_RELOC_64
Definition: rz_bin.h:177
@ RZ_BIN_RELOC_8
Definition: rz_bin.h:173
struct rz_bin_map_t RzBinMap
Description of a single memory mapping into virtual memory from a binary.
RzBinSection *(* RzBinGetSectionAt)(RzBin *bin, ut64 addr)
Definition: rz_bin.h:803
struct rz_bin_file_hash_t RzBinFileHash
struct rz_bin_mem_t RzBinMem
RZ_API void rz_bin_symbol_free(RzBinSymbol *sym)
Definition: bin.c:175
RZ_API void rz_bin_map_free(RzBinMap *map)
Definition: bin.c:1023
RZ_API void rz_bin_string_free(void *_str)
Definition: bin.c:192
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)
Definition: dbginfo.c:9
struct rz_bin_plugin_t RzBinPlugin
char *(* RzBinGetName)(RzBin *bin, int type, int idx)
Definition: rz_bin.h:801
RZ_API void rz_bin_field_free(RzBinField *field)
Definition: bin.c:950
RZ_API void rz_bin_source_line_info_builder_fini(RzBinSourceLineInfoBuilder *builder)
Definition: dbginfo.c:14
RZ_API RzBinSourceLineInfo * rz_bin_source_line_info_builder_build_and_fini(RzBinSourceLineInfoBuilder *builder)
Definition: dbginfo.c:87
RZ_API void rz_bin_import_free(RzBinImport *imp)
Definition: bin.c:137
RZ_API void rz_bin_resource_free(RzBinResource *res)
Definition: bin.c:147
struct rz_bin_info_t RzBinInfo
@ RZ_BIN_TYPE_DEFAULT
Definition: rz_bin.h:181
@ RZ_BIN_TYPE_CORE
Definition: rz_bin.h:182
struct rz_bin_bind_t RzBinBind
RZ_API RzList * rz_bin_sections_of_maps(RzList *maps)
Create a list of RzBinSection from RzBinMaps.
Definition: bin.c:1084
void(* RzBinSymbollCallback)(RzBinObject *obj, void *symbol)
Definition: rz_bin.h:561
RZ_API RzBinRelocStorage * rz_bin_reloc_storage_new(RZ_OWN RzList *relocs)
Definition: bobj.c:105
struct rz_bin_source_line_sample_t RzBinSourceLineSample
A single sample of source line info for a specific address.
RzBinSpecialSymbol
Definition: rz_bin.h:136
@ RZ_BIN_SPECIAL_SYMBOL_FINI
Definition: rz_bin.h:140
@ RZ_BIN_SPECIAL_SYMBOL_ENTRY
Definition: rz_bin.h:137
@ RZ_BIN_SPECIAL_SYMBOL_LAST
Definition: rz_bin.h:141
@ RZ_BIN_SPECIAL_SYMBOL_INIT
Definition: rz_bin.h:138
@ RZ_BIN_SPECIAL_SYMBOL_MAIN
Definition: rz_bin.h:139
struct rz_bin_object_t RzBinObject
RZ_API void rz_bin_section_free(RzBinSection *bs)
Definition: bin.c:1116
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...
Definition: dbginfo.c:151
struct rz_bin_file_load_options_t RzBinObjectLoadOptions
RzList *(* RzBinGetSections)(RzBin *bin)
Definition: rz_bin.h:802
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
Definition: rz_bin.h:744
struct rz_bin_trycatch_t RzBinTrycatch
RZ_API RzBinXtrData * rz_bin_xtrdata_new(RzBuffer *buf, ut64 offset, ut64 size, ut32 file_count, RzBinXtrMetadata *metadata)
Definition: bin.c:47
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.
Definition: bin.c:1040
static bool rz_bin_reloc_has_target(RzBinReloc *reloc)
Definition: rz_bin.h:828
RZ_API RzBinTrycatch * rz_bin_trycatch_new(ut64 source, ut64 from, ut64 to, ut64 handler, ut64 filter)
Definition: bin.c:1178
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.
Definition: dbginfo.c:28
ut64(* RzBinGetOffset)(RzBin *bin, int type, int idx)
Definition: rz_bin.h:800
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)
Definition: bin.c:935
RZ_API void rz_bin_virtual_file_free(RzBinVirtualFile *vfile)
Definition: bin.c:1012
RZ_API void rz_bin_xtrdata_free(void *data)
Definition: bin.c:61
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.
Definition: bobj.c:173
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.
Definition: bobj.c:154
RZ_API RZ_OWN char * rz_bin_section_type_to_string(RzBin *bin, int type)
Converts the RzBinSection type to the string representation.
Definition: bin.c:1133
RZ_API void rz_bin_reloc_free(RzBinReloc *reloc)
Definition: bin.c:188
RZ_LIB_VERSION_HEADER(rz_bin)
struct rz_bin_virtual_file_t RzBinVirtualFile
RZ_API void rz_bin_reloc_storage_free(RzBinRelocStorage *storage)
Definition: bobj.c:137
static bool rz_bin_source_line_sample_is_closing(const RzBinSourceLineSample *s)
Definition: rz_bin.h:474
RZ_API ut64 rz_bin_reloc_size(RzBinReloc *reloc)
size of the reloc (where it is supposed to be patched) in bits
Definition: bobj.c:60
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)
Definition: bin.c:1190
#define RZ_NULLABLE
Definition: rz_types.h:65
#define RZ_OWN
Definition: rz_types.h:62
#define RZ_NONNULL
Definition: rz_types.h:64
int(* PrintfCallback)(const char *str,...) RZ_PRINTF_CHECK(1
Definition: rz_types.h:233
#define RZ_BORROW
Definition: rz_types.h:63
#define RZ_DEPRECATE
Definition: rz_types.h:66
#define st64
Definition: rz_types_base.h:10
#define UT64_MAX
Definition: rz_types_base.h:86
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr from
Definition: sfsocketcall.h:123
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr socklen_t static fromlen const void const struct sockaddr to
Definition: sfsocketcall.h:125
static int
Definition: sfsocketcall.h:114
#define b(i)
Definition: sha256.c:42
Definition: malloc.c:26
Definition: inftree9.h:24
Definition: gzappend.c:170
Definition: z80asm.h:102
Definition: rz_pj.h:12
ut64 vaddr
Definition: rz_bin.h:186
ut64 paddr
Definition: rz_bin.h:187
ut64 hpaddr
Definition: rz_bin.h:189
ut64 hvaddr
Definition: rz_bin.h:188
const char * arch
Definition: rz_bin.h:414
RzBin * bin
Definition: rz_bin.h:807
RzBinGetOffset get_offset
Definition: rz_bin.h:808
RzBinDemangle demangle
Definition: rz_bin.h:812
RzBinGetSections get_sections
Definition: rz_bin.h:810
RzBinGetSectionAt get_vsect_at
Definition: rz_bin.h:811
RzBinGetName get_name
Definition: rz_bin.h:809
ut32 visibility
Definition: rz_bin.h:813
char * super
Definition: rz_bin.h:649
RzList * fields
Definition: rz_bin.h:654
char * name
Definition: rz_bin.h:647
int visibility
Definition: rz_bin.h:656
RzList * methods
Definition: rz_bin.h:653
char * visibility_str
Definition: rz_bin.h:650
char * comment
Definition: rz_bin.h:770
ut64 vaddr
Definition: rz_bin.h:762
char * format
Definition: rz_bin.h:771
char * name
Definition: rz_bin.h:767
ut64 flags
Definition: rz_bin.h:773
ut32 visibility
Definition: rz_bin.h:766
char * type
Definition: rz_bin.h:768
char * visibility_str
Definition: rz_bin.h:769
ut64 paddr
Definition: rz_bin.h:763
bool format_named
Definition: rz_bin.h:772
const char * type
Definition: rz_bin.h:205
const char * hex
Definition: rz_bin.h:206
bool elf_checks_sections
ELF specific, checks or not ELF sections.
Definition: rz_bin.h:253
bool patch_relocs
ask the bin plugin to fill relocs with valid contents for analysis
Definition: rz_bin.h:250
ut64 loadaddr
starting physical address to read from the target file
Definition: rz_bin.h:249
bool elf_load_sections
ELF specific, load or not ELF sections.
Definition: rz_bin.h:252
bool elf_checks_segments
ELF specific, checks or not ELF sections.
Definition: rz_bin.h:254
ut64 baseaddr
where the linker maps the binary in memory
Definition: rz_bin.h:248
bool big_endian
only used for binary formats that do not specify the endian in the file, but need it to load,...
Definition: rz_bin.h:251
const char * plugname
Definition: rz_bin.h:324
XX curplugin == o->plugin.
Definition: rz_bin.h:298
ut64 loadaddr
Definition: rz_bin.h:307
RzBinObject * o
Definition: rz_bin.h:305
RZ_DEPRECATE Sdb * sdb
deprecated, put info in C structures instead of this
Definition: rz_bin.h:315
struct rz_bin_t * rbin
Definition: rz_bin.h:316
int fd
when used in combination with RzIO, this refers to the io fd.
Definition: rz_bin.h:300
struct rz_bin_xtr_plugin_t * curxtr
Definition: rz_bin.h:312
char * file
Definition: rz_bin.h:299
int maxstrlen
Definition: rz_bin.h:310
RzBuffer * buf
Definition: rz_bin.h:303
ut64 offset
Definition: rz_bin.h:304
RzList * xtr_data
Definition: rz_bin.h:314
void * xtr_obj
Definition: rz_bin.h:306
int minstrlen
Definition: rz_bin.h:309
const char * cmd
Definition: rz_bin.h:201
ut64 addr
Definition: rz_bin.h:196
const char * type
Definition: rz_bin.h:195
ut64 from
Definition: rz_bin.h:198
char * libname
Definition: rz_bin.h:702
ut32 visibility
Definition: rz_bin.h:708
const char * type
Definition: rz_bin.h:704
const char * bind
Definition: rz_bin.h:703
char * descriptor
Definition: rz_bin.h:706
ut32 ordinal
Definition: rz_bin.h:707
char * name
Definition: rz_bin.h:701
char * classname
Definition: rz_bin.h:705
int has_va
Definition: rz_bin.h:228
char * claimed_checksum
Definition: rz_bin.h:237
char * type
Definition: rz_bin.h:211
int has_crypto
Definition: rz_bin.h:233
RzList * file_hashes
Definition: rz_bin.h:226
char * intrp
Definition: rz_bin.h:243
int has_canary
Definition: rz_bin.h:230
char * default_cc
Definition: rz_bin.h:225
char * os
Definition: rz_bin.h:219
char * head_flag
Definition: rz_bin.h:217
char * subsystem
Definition: rz_bin.h:220
int has_pi
Definition: rz_bin.h:229
int has_nx
Definition: rz_bin.h:234
char * machine
Definition: rz_bin.h:216
const char * lang
Definition: rz_bin.h:224
char * bclass
Definition: rz_bin.h:212
char * guid
Definition: rz_bin.h:222
char * file
Definition: rz_bin.h:210
char * debug_file_name
Definition: rz_bin.h:223
ut64 dbg_info
Definition: rz_bin.h:240
RzBinHash sum[3]
Definition: rz_bin.h:241
int has_retguard
Definition: rz_bin.h:231
char * features
Definition: rz_bin.h:218
ut64 baddr
Definition: rz_bin.h:242
bool signature
Definition: rz_bin.h:239
int pe_overlay
Definition: rz_bin.h:238
char * rpath
Definition: rz_bin.h:221
char * cpu
Definition: rz_bin.h:215
char * actual_checksum
Definition: rz_bin.h:236
char * rclass
Definition: rz_bin.h:213
char * arch
Definition: rz_bin.h:214
char * compiler
Definition: rz_bin.h:244
int has_sanitizers
Definition: rz_bin.h:232
int big_endian
Definition: rz_bin.h:235
Description of a single memory mapping into virtual memory from a binary.
Definition: rz_bin.h:602
ut64 vsize
size to map in the destination address space. If vsize > psize, excessive bytes are meant to be fille...
Definition: rz_bin.h:606
ut32 perm
Definition: rz_bin.h:608
ut64 paddr
address of the map inside the file
Definition: rz_bin.h:603
ut64 psize
size of the data inside the file
Definition: rz_bin.h:604
ut64 vaddr
address in the destination address space to map to
Definition: rz_bin.h:605
RZ_NULLABLE char * name
Definition: rz_bin.h:607
RZ_NULLABLE char * vfile_name
Definition: rz_bin.h:615
char * name
Definition: rz_bin.h:780
ut64 addr
Definition: rz_bin.h:781
int size
Definition: rz_bin.h:782
int perms
Definition: rz_bin.h:783
RzList * mirrors
Definition: rz_bin.h:784
RzList * classes
Definition: rz_bin.h:281
RzList * fields
Definition: rz_bin.h:277
RzBinObjectLoadOptions opts
Definition: rz_bin.h:260
RzList * imports
Definition: rz_bin.h:268
HtPP * import_name_symbols
Acceleration structure for fast access of the symbol for a given import. This associates the name of ...
Definition: rz_bin.h:275
RzList * maps
Definition: rz_bin.h:266
RzList * symbols
Definition: rz_bin.h:269
ut64 boffset
Definition: rz_bin.h:262
RzList * entries
Definition: rz_bin.h:276
RzBinStrDb * strings
Definition: rz_bin.h:280
RzBinLanguage lang
Definition: rz_bin.h:290
struct rz_bin_plugin_t * plugin
Definition: rz_bin.h:289
RzBinSourceLineInfo * lines
Definition: rz_bin.h:284
RzList * resources
Definition: rz_bin.h:270
RzBinInfo * info
Definition: rz_bin.h:287
RZ_DEPRECATE RZ_BORROW Sdb * kv
deprecated, put info in C structures instead of this (holds a copy of another pointer....
Definition: rz_bin.h:291
HtPP * methods_ht
Definition: rz_bin.h:283
void * bin_obj
Definition: rz_bin.h:293
RzList * mem
Definition: rz_bin.h:285
HtPP * classes_ht
Definition: rz_bin.h:282
char * regstate
Definition: rz_bin.h:286
RzList * libs
Definition: rz_bin.h:278
RzList * sections
Definition: rz_bin.h:267
ut64 obj_size
Definition: rz_bin.h:264
st64 baddr_shift
Definition: rz_bin.h:261
RzList * vfiles
Definition: rz_bin.h:265
HtUP * addrzklassmethod
Definition: rz_bin.h:292
RzBinAddr * binsym[RZ_BIN_SPECIAL_SYMBOL_LAST]
Definition: rz_bin.h:288
RzBinRelocStorage * relocs
Definition: rz_bin.h:279
void * user
Definition: rz_bin.h:558
int(* file_type)(RzBinFile *bf)
Definition: rz_bin.h:554
bool(* check_buffer)(RzBuffer *buf)
Definition: rz_bin.h:519
ut64(* baddr)(RzBinFile *bf)
Definition: rz_bin.h:521
char * desc
Definition: rz_bin.h:510
bool(* check_bytes)(const ut8 *buf, ut64 length)
Definition: rz_bin.h:518
int(* demangle_type)(const char *str)
Definition: rz_bin.h:544
void(* header)(RzBinFile *bf)
Definition: rz_bin.h:542
bool(* load_buffer)(RzBinFile *bf, RzBinObject *obj, RzBuffer *buf, Sdb *sdb)
Definition: rz_bin.h:515
char * name
Definition: rz_bin.h:509
char * license
Definition: rz_bin.h:513
char strfilter
Definition: rz_bin.h:557
char * version
Definition: rz_bin.h:512
void(* destroy)(RzBinFile *bf)
Definition: rz_bin.h:517
ut64(* get_offset)(RzBinFile *bf, int type, int idx)
Definition: rz_bin.h:546
ut64(* get_vaddr)(RzBinFile *bf, ut64 baddr, ut64 paddr, ut64 vaddr)
Definition: rz_bin.h:548
char * author
Definition: rz_bin.h:511
ut64(* boffset)(RzBinFile *bf)
Definition: rz_bin.h:522
bool(* check_filename)(const char *filename)
Definition: rz_bin.h:520
Efficient storage of relocations to query by address.
Definition: rz_bin.h:732
RzBinReloc ** target_relocs
all relocs that have a valid target_vaddr, ordered by their target_vaddr. size is target_relocs_count...
Definition: rz_bin.h:735
size_t target_relocs_count
Definition: rz_bin.h:736
RzBinReloc ** relocs
all relocs, ordered by their vaddr
Definition: rz_bin.h:733
ut64 paddr
the paddr where the value should be patched into
Definition: rz_bin.h:717
ut32 visibility
Definition: rz_bin.h:719
RzBinRelocType type
Definition: rz_bin.h:712
ut64 vaddr
the vaddr where the value should be patched into
Definition: rz_bin.h:716
ut64 target_vaddr
the target address that the patched reloc points to
Definition: rz_bin.h:718
bool is_ifunc
Definition: rz_bin.h:726
bool additive
Definition: rz_bin.h:720
st64 addend
Definition: rz_bin.h:715
RzBinSymbol * symbol
Definition: rz_bin.h:713
ut64 target_size
size per target
Definition: relocs_patch.c:26
char * language
Definition: rz_bin.h:794
size_t index
Definition: rz_bin.h:788
const RzBinSection * segment
Definition: rz_bin.h:642
RzPVector sections
Definition: rz_bin.h:643
char * format
Definition: rz_bin.h:630
bool is_segment
Definition: rz_bin.h:634
const char * arch
Definition: rz_bin.h:627
char * name
Definition: rz_bin.h:619
bool has_strings
Definition: rz_bin.h:632
RzStrConstPool filename_pool
Definition: rz_bin.h:496
RzStrConstPool filename_pool
Definition: rz_bin.h:488
RzBinSourceLineSample * samples
All source line references for given adresses.
Definition: rz_bin.h:486
A single sample of source line info for a specific address.
Definition: rz_bin.h:441
ut32 ordinal
Definition: rz_bin.h:755
char * string
Definition: rz_bin.h:752
const char * bind
Definition: rz_bin.h:681
char * visibility_str
Definition: rz_bin.h:686
bool is_imported
Definition: rz_bin.h:684
const char * rtype
Definition: rz_bin.h:683
const char * type
Definition: rz_bin.h:682
char * name
Definition: rz_bin.h:675
char * classname
Definition: rz_bin.h:678
ut32 ordinal
Definition: rz_bin.h:692
char * dname
Definition: rz_bin.h:676
ut64 method_flags
Definition: rz_bin.h:696
ut32 visibility
Definition: rz_bin.h:693
const char * forwarder
Definition: rz_bin.h:680
char * libname
Definition: rz_bin.h:677
int filter
Definition: rz_bin.h:352
PrintfCallback cb_printf
Definition: rz_bin.h:345
bool strseach_check_ascii_freq
Definition: rz_bin.h:361
char * force
Definition: rz_bin.h:349
int debase64
Definition: rz_bin.h:335
RzList * binxtrs
Definition: rz_bin.h:343
ut64 maxstrbuf
Definition: rz_bin.h:338
char * strpurge
Definition: rz_bin.h:354
ut64 filter_rules
Definition: rz_bin.h:358
char * srcdir
Definition: rz_bin.h:355
int loadany
Definition: rz_bin.h:346
RzHash * hash
Definition: rz_bin.h:365
char * strenc
Definition: rz_bin.h:357
bool want_dbginfo
Definition: rz_bin.h:351
RzDemangler * demangler
Definition: rz_bin.h:364
RZ_DEPRECATE RzBinFile * cur
never use this in new code! Get a file from the binfiles list or track it yourself.
Definition: rz_bin.h:330
RzConsBind consb
Definition: rz_bin.h:348
int maxstrlen
Definition: rz_bin.h:337
RzEvent * event
Definition: rz_bin.h:333
bool verbose
Definition: rz_bin.h:359
void * user
Definition: rz_bin.h:332
int is_debugger
Definition: rz_bin.h:350
RzIOBind iob
Definition: rz_bin.h:347
char * prefix
Definition: rz_bin.h:356
bool is_reloc_patched
Definition: rz_bin.h:363
RzIDStorage * ids
Definition: rz_bin.h:341
bool use_xtr
Definition: rz_bin.h:360
RzList * binfiles
Definition: rz_bin.h:344
RzList * plugins
Definition: rz_bin.h:342
const char * file
Definition: rz_bin.h:329
char strfilter
Definition: rz_bin.h:353
int narch
Definition: rz_bin.h:331
int rawstr
Definition: rz_bin.h:339
int minstrlen
Definition: rz_bin.h:336
RzStrConstPool constpool
Definition: rz_bin.h:362
RZ_DEPRECATE Sdb * sdb
Definition: rz_bin.h:340
RZ_NONNULL RzBuffer * buf
Definition: rz_bin.h:597
bool buf_owned
whether buf is owned and freed by this RzBinVirtualFile
Definition: rz_bin.h:598
RZ_OWN RZ_NONNULL char * name
Definition: rz_bin.h:596
RzBinObjectLoadOptions obj_opts
Definition: rz_bin.h:383
RzBuffer * buf
Definition: rz_bin.h:380
RzBinXtrMetadata * metadata
Definition: rz_bin.h:386
const char * xtr_type
Definition: rz_bin.h:374
bool(* check_buffer)(RzBuffer *b)
Definition: rz_bin.h:398
int(* init)(void *user)
Definition: rz_bin.h:396
int(* fini)(void *user)
Definition: rz_bin.h:397
int(* size)(RzBin *bin)
Definition: rz_bin.h:408
void(* free_xtr)(void *xtr_obj)
Definition: rz_bin.h:410
void(* destroy)(RzBin *bin)
Definition: rz_bin.h:409
bool(* load)(RzBin *bin)
Definition: rz_bin.h:407
Definition: sdb.h:63
#define bool
Definition: sysdefs.h:146
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static const z80_opcode fd[]
Definition: z80_tab.h:997
static int baseaddr
Definition: z80asm.c:79
static int addr
Definition: z80asm.c:58
int def(FILE *source, FILE *dest, int level)
Definition: zpipe.c:36