17 ut32 filesize, code_va, code_pa, phoff;
18 ut32 p_start, p_phoff, p_phdr;
19 ut32 p_ehdrsz, p_phdrsz;
21 ut32 p_vaddr, p_paddr, p_fs, p_fs2;
25 #define B(x, y) rz_buf_append_bytes(buf, (const ut8 *)(x), y)
26 #define D(x) rz_buf_append_ut32(buf, x)
27 #define H(x) rz_buf_append_ut16(buf, x)
28 #define Z(x) rz_buf_append_nbytes(buf, x)
29 #define W(x, y, z) rz_buf_write_at(buf, x, (const ut8 *)(y), z)
31 p_tmp = rz_buf_size(buf); \
33 W(p_tmp, y, strlen(y))
76 code_va = code_pa +
baddr;
78 filesize = code_pa + codelen + datalen;
80 W(p_start, &code_va, 4);
81 W(p_phoff, &phoff, 4);
82 W(p_ehdrsz, &ehdrsz, 2);
83 W(p_phdrsz, &phdrsz, 2);
86 W(p_vaddr, &code_va, 4);
88 W(p_paddr, &code_pa, 4);
90 W(p_fs, &filesize, 4);
91 W(p_fs2, &filesize, 4);
95 if (data && datalen > 0) {
97 RZ_LOG_WARN(
"DATA section not support for ELF yet\n");
105 .desc =
"CGC format rz_bin plugin",
127 .file_type = get_file_type,
const aarch64_field fields[]
static bool load_buffer(RzBinFile *bf, RzBinObject *obj, RzBuffer *buf, Sdb *sdb)
static void destroy(RzBinFile *bf)
static ut64 baddr(RzBinFile *bf)
static Sdb * get_sdb(RzBinFile *bf)
static RzList * maps(RzBinFile *bf)
static RzList * virtual_files(RzBinFile *bf)
static RzBuffer * create(RzBin *bin, const ut8 *code, int codelen, const ut8 *data, int datalen, RzBinArchOptions *opt)
struct rz_bin_dbginfo_t rz_bin_dbginfo_elf
static bool check_buffer(RzBuffer *buf)
RzBinPlugin rz_bin_plugin_cgc
static RzBinAddr * binsym(RzBinFile *bf, RzBinSpecialSymbol sym)
static RzList * libs(RzBinFile *bf)
static char * regstate(RzBinFile *bf)
RzList * entries(RzBinFile *bf)
RzBinInfo * info(RzBinFile *bf)
RzList * symbols(RzBinFile *bf)
RzList * imports(RzBinFile *bf)
RzList * sections(RzBinFile *bf)
RzList * relocs(RzBinFile *bf)
static ut64 boffset(RzBinFile *bf)
RZ_OWN char *Elf_() rz_bin_elf_section_type_to_string(ut64 type)
Return a string representing the elf type.
RZ_OWN RzList *Elf_() rz_bin_elf_section_flag_to_rzlist(ut64 flag)
Return a list of string representing flag options.
checking print the parsed form of the magic use in n conjunction with m to debug a new magic file n before installing it n output MIME type strings(--mime-type and\n"
" --mime-encoding)\n") OPT('s'
RZ_API st64 rz_buf_read_at(RZ_NONNULL RzBuffer *b, ut64 addr, RZ_NONNULL RZ_OUT ut8 *buf, ut64 len)
Read len bytes of the buffer at the specified address.
RZ_API RZ_OWN RzBuffer * rz_buf_new_with_bytes(RZ_NULLABLE RZ_BORROW const ut8 *bytes, ut64 len)
Creates a new buffer with a bytes array.
RZ_API ut64 rz_buf_size(RZ_NONNULL RzBuffer *b)
Return the size of the buffer.
#define RZ_LOG_WARN(fmtstr,...)