Rizin
unix-like reverse engineering framework and cli tools
bin_elf.c
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2009-2020 pancake <pancake@nopcode.org>
2 // SPDX-FileCopyrightText: 2009-2020 nibble <nibble.ds@gmail.com>
3 // SPDX-FileCopyrightText: 2009-2020 dso <dso@rice.edu>
4 // SPDX-License-Identifier: LGPL-3.0-only
5 
6 #include "bin_elf.inc"
7 
8 static bool check_buffer(RzBuffer *buf) {
9  return check_buffer_aux(buf) == ELFCLASS32;
10 }
11 
13  .name = "elf",
14  .desc = "ELF format plugin",
15  .license = "LGPL3",
16  .get_sdb = &get_sdb,
17  .load_buffer = &load_buffer,
18  .check_buffer = &check_buffer,
19  .baddr = &baddr,
20  .boffset = &boffset,
21  .binsym = &binsym,
22  .entries = &entries,
23  .virtual_files = &virtual_files,
24  .maps = &maps,
25  .sections = &sections,
26  .symbols = &symbols,
27  .imports = &imports,
28  .strings = &strings,
29  .minstrlen = 4,
30  .info = &info,
31  .fields = &fields,
32  .header = &headers,
33  .size = &size,
34  .libs = &libs,
35  .relocs = &relocs,
36  .create = &create_elf,
37  .file_type = &get_file_type,
38  .regstate = &regstate,
39  .section_type_to_string = &Elf_(rz_bin_elf_section_type_to_string),
40  .section_flag_to_rzlist = &Elf_(rz_bin_elf_section_flag_to_rzlist),
41  .destroy = destroy,
42 };
43 
44 #ifndef RZ_PLUGIN_INCORE
47  .data = &rz_bin_plugin_elf,
49 };
50 #endif
const aarch64_field fields[]
Definition: aarch64-opc.c:205
static bool load_buffer(RzBinFile *bf, RzBinObject *obj, RzBuffer *buf, Sdb *sdb)
Definition: bin_any.c:50
static void destroy(RzBinFile *bf)
Definition: bin_any.c:54
static ut64 baddr(RzBinFile *bf)
Definition: bin_any.c:58
static Sdb * get_sdb(RzBinFile *bf)
Definition: bin_art.c:60
static RzList * maps(RzBinFile *bf)
Definition: bin_bf.c:116
static RzList * virtual_files(RzBinFile *bf)
Definition: bin_bflt.c:167
static RzBinAddr * binsym(RzBinFile *bf, RzBinSpecialSymbol sym)
Definition: bin_coff.c:47
static RzList * libs(RzBinFile *bf)
Definition: bin_coff.c:379
static char * regstate(RzBinFile *bf)
Definition: bin_dmp64.c:252
static bool check_buffer(RzBuffer *buf)
Definition: bin_elf.c:8
RzBinPlugin rz_bin_plugin_elf
Definition: bin_elf.c:12
RZ_API RzLibStruct rizin_plugin
Definition: bin_elf.c:45
RzList * entries(RzBinFile *bf)
Definition: bin_ne.c:98
RzBinInfo * info(RzBinFile *bf)
Definition: bin_ne.c:86
RzList * symbols(RzBinFile *bf)
Definition: bin_ne.c:102
RzList * imports(RzBinFile *bf)
Definition: bin_ne.c:106
RzList * sections(RzBinFile *bf)
Definition: bin_ne.c:110
RzList * relocs(RzBinFile *bf)
Definition: bin_ne.c:114
static ut64 boffset(RzBinFile *bf)
Definition: bin_ninds.c:39
#define RZ_API
RZ_OWN char *Elf_() rz_bin_elf_section_type_to_string(ut64 type)
Return a string representing the elf type.
Definition: elf_sections.c:422
RZ_OWN RzList *Elf_() rz_bin_elf_section_flag_to_rzlist(ut64 flag)
Return a list of string representing flag options.
Definition: elf_sections.c:298
#define Elf_(name)
Definition: elf_specs.h:32
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'
voidpf void uLong size
Definition: ioapi.h:138
voidpf void * buf
Definition: ioapi.h:138
#define ELFCLASS32
Definition: common.h:53
@ RZ_LIB_TYPE_BIN
Definition: rz_lib.h:75
#define RZ_VERSION
Definition: rz_version.h:8
char * name
Definition: rz_bin.h:509
char * version
Definition: rz_bin.h:512