9 #define EF_MIPS_ABI_O32 0x00001000
10 #define EF_MIPS_ABI_O64 0x00002000
11 #define EF_MIPS_ABI 0x0000f000
13 #define VERSYM_VERSION 0x7fff
63 {
".note.openbsd.ident",
"openbsd" },
64 {
".note.minix.ident",
"minix" },
65 {
".note.netbsd.ident",
"netbsd" },
66 {
".note.android.ident",
"android" }
71 {
EM_M32,
"AT&T WE 32100" },
74 {
EM_68K,
"Motorola m68k family" },
75 {
EM_88K,
"Motorola m88k family" },
90 {
EM_RCE,
"Motorola RCE" },
94 {
EM_SH,
"Hitachi SH" },
97 {
EM_ARC,
"Argonaut RISC Core" },
100 {
EM_H8S,
"Hitachi H8S" },
106 {
EM_MMA,
"Fujitsu MMA Multimedia Accelerator" },
107 {
EM_PCP,
"Siemens PCP" },
108 {
EM_NCPU,
"Sony nCPU embeeded RISC" },
109 {
EM_NDR1,
"Denso NDR1 microprocessor" },
111 {
EM_ME16,
"Toyota ME16 processor" },
112 {
EM_ST100,
"STMicroelectronic ST100 processor" },
113 {
EM_TINYJ,
"Advanced Logic Corp. Tinyj emb.fam" },
114 {
EM_X86_64,
"AMD x86-64 architecture" },
115 {
EM_LANAI,
"32bit LANAI architecture" },
116 {
EM_PDSP,
"Sony DSP Processor" },
117 {
EM_PDP10,
"Digital Equipment Corp. PDP-10" },
118 {
EM_PDP11,
"Digital Equipment Corp. PDP-11" },
119 {
EM_FX66,
"Siemens FX66 microcontroller" },
120 {
EM_ST9PLUS,
"STMicroelectronics ST9+ 8/16 mc" },
121 {
EM_ST7,
"STmicroelectronics ST7 8 bit mc" },
122 {
EM_68HC16,
"Motorola MC68HC16 microcontroller" },
123 {
EM_68HC11,
"Motorola MC68HC11 microcontroller" },
124 {
EM_68HC08,
"Motorola MC68HC08 microcontroller" },
125 {
EM_68HC05,
"Motorola MC68HC05 microcontroller" },
126 {
EM_SVX,
"Silicon Graphics SVx" },
127 {
EM_ST19,
"STMicroelectronics ST19 8 bit mc" },
128 {
EM_VAX,
"Digital VAX" },
129 {
EM_CRIS,
"Axis Communications 32-bit embedded processor" },
130 {
EM_JAVELIN,
"Infineon Technologies 32-bit embedded processor" },
131 {
EM_FIREPATH,
"Element 14 64-bit DSP Processor" },
132 {
EM_ZSP,
"LSI Logic 16-bit DSP Processor" },
133 {
EM_MMIX,
"Donald Knuth's educational 64-bit processor" },
134 {
EM_HUANY,
"Harvard University machine-independent object files" },
136 {
EM_AVR,
"Atmel AVR 8-bit microcontroller" },
138 {
EM_D10V,
"Mitsubishi D10V" },
139 {
EM_D30V,
"Mitsubishi D30V" },
141 {
EM_M32R,
"Mitsubishi M32R" },
144 {
EM_PJ,
"picoJava" },
145 {
EM_OPENRISC,
"OpenRISC 32-bit embedded processor" },
147 {
EM_XTENSA,
"Tensilica Xtensa Architecture" },
156 {
EM_TI_C6000,
"The Texas Instruments TMS320C6000 DSP family" },
157 {
EM_TI_C2000,
"The Texas Instruments TMS320C2000 DSP family" },
158 {
EM_TI_C5500,
"The Texas Instruments TMS320C55x DSP family" },
159 {
EM_TI_ARP32,
"Texas Instruments Application Specific RISC Processor, 32bit fetch" },
160 {
EM_TI_PRU,
"Texas Instruments Programmable Realtime Unit" },
161 {
EM_MMDSP_PLUS,
"STMicroelectronics 64bit VLIW Data Signal Processor" },
163 {
EM_R32C,
"Renesas R32C series microprocessors" },
164 {
EM_TRIMEDIA,
"NXP Semiconductors TriMedia architecture family" },
165 {
EM_QDSP6,
"QUALCOMM DSP6 Processor" },
166 {
EM_8051,
"Intel 8051 and variants" },
167 {
EM_STXP7X,
"STMicroelectronics STxP7x family of configurable and extensible RISC processors" },
168 {
EM_NDS32,
"Andes Technology compact code size embedded RISC processor family" },
169 {
EM_ECOG1,
"Cyan Technology eCOG1X family" },
170 {
EM_MAXQ30,
"Dallas Semiconductor MAXQ30 Core Micro-controllers" },
171 {
EM_XIMO16,
"New Japan Radio (NJR) 16-bit DSP Processor" },
172 {
EM_MANIK,
"M2000 Reconfigurable RISC Microprocessor" },
173 {
EM_CRAYNV2,
"Cray Inc. NV2 vector architecture" },
174 {
EM_RX,
"Renesas RX family" },
175 {
EM_METAG,
"Imagination Technologies META processor architecture" },
176 {
EM_MCST_ELBRUS,
"MCST Elbrus general purpose hardware architecture" },
177 {
EM_ECOG16,
"Cyan Technology eCOG16 family" },
178 {
EM_CR16,
"National Semiconductor CompactRISC CR16 16-bit microprocessor" },
179 {
EM_ETPU,
"Freescale Extended Time Processing Unit" },
180 {
EM_SLE9X,
"Infineon Technologies SLE9X core" },
183 {
EM_AVR32,
"Atmel Corporation 32-bit microprocessor family" },
184 {
EM_STM8,
"STMicroeletronics STM8 8-bit microcontroller" },
185 {
EM_TILE64,
"Tilera TILE64 multicore architecture family" },
186 {
EM_TILEPRO,
"Tilera TILEPro multicore architecture family" },
187 {
EM_CUDA,
"NVIDIA CUDA architecture" },
188 {
EM_TILEGX,
"Tilera TILE-Gx multicore architecture family" },
190 {
EM_COREA_1ST,
"KIPO-KAIST Core-A 1st generation processor family" },
191 {
EM_COREA_2ND,
"KIPO-KAIST Core-A 2nd generation processor family" },
193 {
EM_OPEN8,
"Open8 8-bit RISC soft processor core" },
194 {
EM_RL78,
"Renesas RL78 family" },
196 {
EM_78KOR,
"Renesas 78KOR family" },
197 {
EM_BA1,
"Beyond BA1 CPU architecture" },
199 {
EM_BA2,
"Beyond BA2 CPU architecture" },
200 {
EM_XCORE,
"XMOS xCORE processor family" },
207 {
EM_KM32,
"KM211 KM32 32-bit processor" },
208 {
EM_KMX32,
"KM211 KMX32 32-bit processor" },
209 {
EM_KMX16,
"KM211 KMX16 16-bit processor" },
210 {
EM_KMX8,
"KM211 KMX8 8-bit processor" },
211 {
EM_KVARC,
"KM211 KVARC processor" },
212 {
EM_CDP,
"Paneve CDP architecture family" },
213 {
EM_COGE,
"Cognitive Smart Memory Processor" },
214 {
EM_COOL,
"Bluechip Systems CoolEngine" },
215 {
EM_NORC,
"Nanoradio Optimized RISC" },
218 {
EM_VISIUM,
"Controls and Data Services VISIUMcore processor" },
219 {
EM_FT32,
"FTDI Chip FT32 high performance 32-bit RISC architecture" },
220 {
EM_MOXIE,
"Moxie processor family" },
223 {
EM_KVX,
"Kalray VLIW core of the MPPA processor family" },
299 if (symbol->
name && !strcmp(symbol->
name,
"main")) {
301 return symbol->
paddr;
304 return symbol->
vaddr;
315 if (
buf[0] == 0xf3 &&
buf[1] == 0x0f &&
buf[2] == 0x1e &&
buf[3] == 0xfa) {
319 if (!memcmp(
buf + 19,
"\x45\x31\xc0\x31\xc9", 5)) {
323 if (
buf[bo] == 0x48) {
332 ut64 vmain = (
ut64)(ventry + bo + maindelta) + 7;
334 }
else if (ch == 0xc7) {
347 if (!memcmp(
buf,
"\x49\x89\xd9", 3) &&
buf[156] == 0xe8) {
350 if (!memcmp(
buf + 29,
"\x48\xc7\xc7", 3)) {
355 if (
buf[23] ==
'\x68') {
366 if (
buf[0x00] == 0x48 &&
buf[0x1e] == 0x8d &&
buf[0x11] == 0xe8) {
370 if (vmain >> 16 == ventry >> 16) {
375 if (
buf[0x1d] == 0x48 &&
buf[0x1e] == 0x8b) {
376 if (!memcmp(
buf,
"\x31\xed\x49\x89", 4)) {
378 ut8 n32s[
sizeof(
ut32)] = { 0 };
384 baddr = (
bin->ehdr.e_entry >> 16) << 16;
397 if (
buf[0] != 0xe8 && memcmp(
buf + 5,
"\x50\xe8\x00\x00\x00\x00\xb8\x01\x00\x00\x00\x53", 12)) {
401 size_t SIZEOF_CALL = 5;
410 if (memcmp(
buf,
"\x21\x00\xe0\x03\x01\x00\x11\x04", 8)) {
429 ut64 gp = got_offset + 0x7ff0;
431 for (
size_t i = 0;
i <
size;
i += 4) {
433 if ((instr & 0xffff0000) == 0x8f840000) {
434 const short delta = instr & 0x0000ffff;
446 if (!memcmp(
buf,
"\xf0\x00\x0b\x4f\xf0\x00\x0e\x02\xbc\x6a\x46", 11)) {
449 }
else if (!memcmp(
buf,
"\xf0\x00\x0b\x4f\xf0\x00\x0e\x5d\xf8\x04\x1b", 11)) {
466 if (!memcmp(
buf,
"\x00\xb0\xa0\xe3\x00\xe0\xa0\xe3", 8)) {
470 if (!memcmp(
buf,
"\x24\xc0\x9f\xe5\x00\xb0\xa0\xe3", 8)) {
489 if (
buf[0x18 + 3] != 0x58 ||
buf[0x2f] != 0x00) {
500 if (main_addr >> 16 == entry_vaddr >> 16) {
572 return segment && segment->is_valid;
648 size_t size = segment->data.p_filesz;
721 if (!
bin->shstrtab) {
777 char *head_flag =
NULL;
794 switch (
bin->ehdr.e_type) {
796 return strdup(
"NONE (None)");
798 return strdup(
"REL (Relocatable file)");
800 return strdup(
"EXEC (Executable file)");
802 return strdup(
"DYN (Shared object file)");
804 return strdup(
"CORE (Core file)");
819 return strdup(
" Unknown mips ISA");
991 ut64 verneed_entry_offset = verneed_offset;
993 for (
size_t i = 0;
i < verneed_num;
i++) {
994 Elf_(Verneed) verneed_entry;
999 ut64 vernaux_entry_offset = verneed_entry_offset + verneed_entry.vn_aux;
1001 for (
size_t j = 0; j < verneed_entry.vn_cnt; j++) {
1002 Elf_(Vernaux) vernaux_entry;
1007 if (vernaux_entry.vna_other != versym) {
1008 vernaux_entry_offset += vernaux_entry.vna_next;
1029 verneed_entry_offset += verneed_entry.vn_next;
1049 ut64 verdef_entry_offset = verdef_offset;
1051 for (
size_t i = 0;
i < verdef_num;
i++) {
1052 Elf_(Verdef) verdef_entry;
1057 if (!verdef_entry.vd_cnt || verdef_entry.vd_ndx != (versym &
VERSYM_VERSION)) {
1058 verdef_entry_offset += verdef_entry.vd_next;
1062 ut64 verdaux_entry_offset = verdef_entry_offset + verdef_entry.vd_aux;
1064 Elf_(Verdaux) verdaux_entry;
1102 ut64 number_of_symbols =
Elf_(rz_bin_elf_get_number_of_dynamic_symbols)(
bin);
1103 if (!number_of_symbols) {
1112 if (!
sdb_num_set(sdb,
"num_entries", number_of_symbols, 0) ||
1119 ut64 versym_entry_offset = versym_offset;
1121 for (
size_t i = 0;
i < number_of_symbols;
i++) {
1128 Elf_(Versym) versym_entry;
1134 switch (versym_entry) {
1180 !
sdb_num_set(sdb_vernaux,
"version", vernaux_entry.vna_other, 0) ||
1200 if (!
sdb_num_set(sdb_version,
"cnt", verneed_entry.vn_cnt, 0) ||
1202 !
sdb_num_set(sdb_version,
"vn_version", verneed_entry.vn_version, 0) ||
1203 !
sdb_set(sdb_version,
"file_name",
tmp, 0)) {
1217 ut64 vernaux_entry_offset =
offset + verneed_entry.vn_aux;
1219 for (
size_t i = 0;
i < verneed_entry.vn_cnt;
i++) {
1220 Elf_(Vernaux) vernaux_entry;
1241 vernaux_entry_offset += vernaux_entry.vna_next;
1257 RZ_LOG_WARN(
"Failed to convert verneed virtual address to physical address.\n");
1266 if (!
sdb_num_set(sdb,
"num_entries", verneed_num, 0) ||
1273 for (
size_t i = 0;
i < verneed_num;
i++) {
1274 Elf_(Verneed) verneed_entry;
1295 verneed_offset += verneed_entry.vn_next;
1314 if (sdb && !
sdb_ns_set(res,
"verneed", sdb)) {
1322 if (sdb && !
sdb_ns_set(res,
"versym", sdb)) {
1364 size_t result_len = strlen(result);
1365 char *
end = result + result_len;
1367 if (result_len !=
size &&
end[1]) {
1494 return strdup(
"unknown_flag");
1576 if (!segment || !segment->is_valid) {
1623 if (!segment || !segment->is_valid) {
1627 return !(segment->data.p_flags &
PF_X);
1678 if (segment && segment->is_valid) {
1683 if (segment && segment->is_valid) {
1739 if (has_gnu_relro) {
static ut64 baddr(RzBinFile *bf)
int bits(struct state *s, int need)
static static fork const void static count static fd const char const char static newpath const char static path const char path
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 key
ut64 Elf_() rz_bin_elf_p2v(RZ_NONNULL ELFOBJ *bin, ut64 paddr)
Convert a physical address to the virtual address.
ut64 Elf_() rz_bin_elf_v2p(RZ_NONNULL ELFOBJ *bin, ut64 vaddr)
Convert a virtual address to the physical address.
#define rz_bin_elf_foreach_segments(bin, segment)
#define RZ_BIN_ELF_NO_RELRO
#define rz_bin_elf_foreach_sections(bin, section)
#define rz_bin_elf_foreach_symbols(bin, symbol)
#define RZ_BIN_ELF_FULL_RELRO
bool Elf_() rz_bin_elf_has_dt_dynamic(RZ_NONNULL ELFOBJ *bin)
bool Elf_() rz_bin_elf_is_arm_binary_supporting_thumb(RZ_NONNULL ELFOBJ *bin)
bool Elf_() rz_bin_elf_is_thumb_addr(ut64 addr)
bool Elf_() rz_bin_elf_read_word(RZ_NONNULL ELFOBJ *bin, RZ_NONNULL RZ_INOUT ut64 *offset, RZ_NONNULL RZ_OUT Elf_(Word) *result)
RZ_BORROW RzBinElfSection *Elf_() rz_bin_elf_get_section_with_name(RZ_NONNULL ELFOBJ *bin, RZ_NONNULL const char *name)
bool Elf_() rz_bin_elf_read_half(RZ_NONNULL ELFOBJ *bin, RZ_NONNULL RZ_INOUT ut64 *offset, RZ_NONNULL RZ_OUT Elf_(Half) *result)
bool Elf_() rz_bin_elf_get_dt_info(RZ_NONNULL ELFOBJ *bin, ut64 key, RZ_OUT ut64 *info)
bool Elf_() rz_bin_elf_read_versym(RZ_NONNULL ELFOBJ *bin, RZ_NONNULL RZ_INOUT ut64 *offset, RZ_NONNULL RZ_OUT Elf_(Versym) *result)
RZ_BORROW RzVector *Elf_() rz_bin_elf_get_dt_needed(RZ_NONNULL ELFOBJ *bin)
#define RZ_BIN_ELF_PART_RELRO
bool Elf_() rz_bin_elf_has_segments(RZ_NONNULL ELFOBJ *bin)
bool Elf_() rz_bin_elf_has_sections(RZ_NONNULL ELFOBJ *bin)
RZ_OWN char *Elf_() rz_bin_elf_strtab_get_dup(RZ_NONNULL RzBinElfStrtab *strtab, ut64 index)
RZ_BORROW const char *Elf_() rz_bin_elf_strtab_get(RZ_NONNULL RzBinElfStrtab *strtab, ut64 index)
RZ_BORROW RzBinElfSegment *Elf_() rz_bin_elf_get_segment_with_type(RZ_NONNULL ELFOBJ *bin, Elf_(Word) type)
static ut64 get_main_offset_arm_glibc(ELFOBJ *bin, ut64 entry, ut8 *buf)
static bool file_type_is_processor_specific(ELFOBJ *bin)
RZ_IPI RZ_OWN Sdb *Elf_() rz_bin_elf_get_symbols_info(RZ_NONNULL ELFOBJ *bin)
bool Elf_() rz_bin_elf_is_big_endian(RZ_NONNULL ELFOBJ *bin)
Check the binary endianness.
static bool get_verneed_entry_aux(ELFOBJ *bin, ut64 offset, Elf_(Verneed) *entry)
static const struct arch_translation arch_translation_table[]
static bool get_verneed_entry(ELFOBJ *bin, ut64 offset, Elf_(Verneed) *entry)
static bool arch_is_mips(ELFOBJ *bin)
static int get_bits_common(ELFOBJ *bin)
bool Elf_() rz_bin_elf_is_static(RZ_NONNULL ELFOBJ *bin)
Check if the binary is statically-linked library.
bool Elf_() rz_bin_elf_is_stripped(RZ_NONNULL ELFOBJ *bin)
Check if the binary is stripped.
static ut64 get_main_offset_arm_glibc_thumb(ELFOBJ *bin, ut64 entry, ut8 *buf)
static const struct mips_bits_translation mips_bits_translation_table[]
static bool arch_is_arcompact(ELFOBJ *bin)
RZ_OWN char *Elf_() rz_bin_elf_get_file_type(RZ_NONNULL ELFOBJ *bin)
Return a string representing the file type.
static Sdb * get_gnu_verneed(ELFOBJ *bin)
bool Elf_() rz_bin_elf_is_executable(RZ_NONNULL ELFOBJ *bin)
Check if the elf binary is executable.
static bool get_verdaux_entry_aux(ELFOBJ *bin, ut64 offset, Elf_(Verdaux) *entry)
ut64 Elf_() rz_bin_elf_get_main_offset(RZ_NONNULL ELFOBJ *bin)
Compute the main offset of the binary.
static ut64 get_main_offset_x86_gcc(ELFOBJ *bin, ut64 entry, ut8 *buf)
static bool file_type_is_os_specific(ELFOBJ *bin)
static int get_bits_mips_common(Elf_(Word) mips_type)
bool Elf_() rz_bin_elf_has_va(ELFOBJ *bin)
Check if the elf use virtual address.
RZ_OWN char *Elf_() rz_bin_elf_get_elf_class(RZ_NONNULL ELFOBJ *bin)
Return a string representing the elf class.
static Sdb * get_verneed_entry_sdb(ELFOBJ *bin, Elf_(Verneed) verneed_entry, size_t offset)
static bool get_verdef_entry(ELFOBJ *bin, ut64 offset, Elf_(Verdef) *entry)
static bool is_mips_o32(ELFOBJ *bin)
static ut64 get_main_offset_arm_glibc_non_thumb(ELFOBJ *bin, ut64 entry, ut8 *buf)
static bool is_mips_n32(ELFOBJ *bin)
static ut64 get_main_offset_arm64(ELFOBJ *bin, ut64 entry, ut8 *buf)
static ut64 compute_baddr_from_phdr(ELFOBJ *bin)
bool Elf_() rz_bin_elf_has_nx(RZ_NONNULL ELFOBJ *bin)
Check if the stack is not executable.
RZ_OWN char *Elf_() rz_bin_elf_get_intrp(RZ_NONNULL ELFOBJ *bin)
Get the program interpreter.
static char * get_abi_mips(ELFOBJ *bin)
static const struct ver_flags_translation ver_flags_translation_table[]
static bool get_versym_entry_sdb_from_verneed(ELFOBJ *bin, Sdb *sdb, const char *key, Elf_(Versym) versym)
RZ_OWN char *Elf_() rz_bin_elf_get_abi(RZ_NONNULL ELFOBJ *bin)
Return a string representing the application binary interface.
static char * get_cpu_mips(ELFOBJ *bin)
static char * get_osabi_name_from_ehdr(ELFOBJ *bin)
static Sdb * get_vernaux_entry_sdb(ELFOBJ *bin, Elf_(Vernaux) vernaux_entry, size_t index)
static Sdb * get_gnu_versym(ELFOBJ *bin)
ut64 Elf_() rz_bin_elf_get_baddr(RZ_NONNULL ELFOBJ *bin)
Compute the base address of the binary.
static int get_bits_mips(ELFOBJ *bin)
RZ_OWN char *Elf_() rz_bin_elf_get_machine_name(RZ_NONNULL ELFOBJ *bin)
Return a string representing the machine name.
RZ_OWN RzList *Elf_() rz_bin_elf_get_libs(RZ_NONNULL ELFOBJ *bin)
List all imported lib.
static ut64 get_entry_offset_from_shdr(ELFOBJ *bin)
static const struct machine_name_translation machine_name_translation_table[]
static bool get_verdef_entry_aux(ELFOBJ *bin, ut64 offset, Elf_(Verdef) *entry)
static bool has_thumb_symbol(ELFOBJ *bin)
static char * get_head_flag(ELFOBJ *bin)
static char * get_osabi_name_from_shdr(ELFOBJ *bin)
static char * read_elf_intrp(ELFOBJ *bin, ut64 addr, size_t size)
static char * get_elf_intrp(ELFOBJ *bin, RzBinElfSegment *segment)
static ut64 get_main_offset_mips(ELFOBJ *bin, ut64 entry, ut8 *buf, size_t size)
static const struct class_translation class_translation_table[]
RZ_OWN char *Elf_() rz_bin_elf_get_rpath(RZ_NONNULL ELFOBJ *bin)
Get the rpath.
RZ_OWN char *Elf_() rz_bin_elf_get_arch(RZ_NONNULL ELFOBJ *bin)
Get the elf binary architecture.
static ut64 get_main_offset_x86_non_pie(ELFOBJ *bin, ut64 entry, ut8 *buf)
static bool has_dt_rpath_entry(ELFOBJ *bin)
static ut64 get_main_offset_from_symbol(ELFOBJ *bin)
static bool get_verdaux_entry(ELFOBJ *bin, ut64 offset, Elf_(Verdaux) *entry)
static ut64 compute_boffset_from_phdr(ELFOBJ *bin)
static bool get_vernaux_entry_aux(ELFOBJ *bin, ut64 offset, Elf_(Vernaux) *entry)
int Elf_() rz_bin_elf_get_bits(RZ_NONNULL ELFOBJ *bin)
Return the elf bits.
static bool is_elf_class64(ELFOBJ *bin)
static bool elf_is_bind_now(ELFOBJ *bin)
RZ_OWN char *Elf_() rz_bin_elf_get_head_flag(RZ_NONNULL ELFOBJ *bin)
Return the head flag.
bool Elf_() rz_bin_elf_is_relocatable(RZ_NONNULL ELFOBJ *bin)
Check if the elf binary is relocatable.
static const struct cpu_mips_translation cpu_mips_translation_table[]
static bool get_versym_entry_sdb_from_verdef(ELFOBJ *bin, Sdb *sdb, const char *key, Elf_(Versym) versym)
RZ_OWN char *Elf_() rz_bin_elf_get_osabi_name(RZ_NONNULL ELFOBJ *bin)
Return the os application binary interface name.
ut64 Elf_() rz_bin_elf_get_init_offset(RZ_NONNULL ELFOBJ *bin)
Compute the init offset of the binary.
static char * add_abi_info(ELFOBJ *bin, char *head_flag)
static char * add_cpu_info(ELFOBJ *bin, char *head_flag)
static Sdb * get_verneed_entry_sdb_aux(ELFOBJ *bin, Elf_(Verneed) verneed_entry, size_t index)
static bool elf_has_gnu_relro(ELFOBJ *bin)
ut64 Elf_() rz_bin_elf_get_entry_offset(RZ_NONNULL ELFOBJ *bin)
Get the entry offset.
ut64 Elf_() rz_bin_elf_get_boffset(RZ_NONNULL ELFOBJ *bin)
Compute the base offset of the binary.
int Elf_() rz_bin_elf_has_relro(RZ_NONNULL ELFOBJ *bin)
Analyse if the elf binary has relro or partial relro.
RZ_OWN char *Elf_() rz_bin_elf_get_cpu(RZ_NONNULL ELFOBJ *bin)
Return a string representing the cpu.
static int is_playstation_hack(ELFOBJ *bin, Elf_(Word) mips_type)
static char * get_file_type_basic(RZ_NONNULL ELFOBJ *bin)
static bool get_vernaux_entry(ELFOBJ *bin, ut64 offset, Elf_(Vernaux) *entry)
static ut64 get_main_offset_x86_pie(ELFOBJ *bin, ut64 entry, ut8 *buf)
RZ_OWN char *Elf_() rz_bin_elf_get_compiler(RZ_NONNULL ELFOBJ *bin)
Get the compiler info from the .comment section.
static char * get_ver_flags(ut32 flags)
static char * get_osabi_name_from_section_note(ELFOBJ *bin, RzBinElfSection *section)
static ut64 get_main_offset_linux_64_pie(ELFOBJ *bin, ut64 entry, ut8 *buf)
static const struct section_note_osabi_translation section_note_osabi_translation_table[]
ut64 Elf_() rz_bin_elf_get_fini_offset(RZ_NONNULL ELFOBJ *bin)
Compute the fini offset of the binary.
#define EF_MIPS_ARCH_32R2
#define EF_MIPS_ARCH_64R2
RZ_API void Ht_() free(HtName_(Ht) *ht)
#define EM_BA2_NON_STANDARD
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
void * malloc(size_t size)
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
RZ_API int sdb_ns_set(Sdb *s, const char *name, Sdb *r)
RZ_API int sdb_num_set(Sdb *s, const char *key, ut64 v, ut32 cas)
#define rz_return_val_if_fail(expr, val)
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 ut64 rz_buf_size(RZ_NONNULL RzBuffer *b)
Return the size of the buffer.
static ut32 rz_read_le32(const void *src)
#define RZ_LOG_WARN(fmtstr,...)
RZ_API char * rz_str_append_owned(char *ptr, char *string)
RZ_API char * rz_str_appendf(char *ptr, const char *fmt,...) RZ_PRINTF_CHECK(2
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API char * rz_str_append(char *ptr, const char *string)
RZ_API RZ_OWN char * rz_str_escape(RZ_NONNULL const char *buf)
#define RZ_STR_ISEMPTY(x)
RZ_API void rz_str_trim(RZ_NONNULL RZ_INOUT char *str)
Removes whitespace characters (space, tab, newline etc.) from the beginning and end of a string.
#define rz_strf(buf,...)
Convenience macro for local temporary strings.
#define rz_vector_foreach(vec, it)
RZ_API int sdb_set_owned(Sdb *s, const char *key, char *val, ut32 cas)
RZ_API int sdb_set(Sdb *s, const char *key, const char *val, ut32 cas)
RZ_API Sdb * sdb_new0(void)
RZ_API bool sdb_free(Sdb *s)
static struct sockaddr static addrlen static backlog const void static flags void flags
ut64(WINAPI *w32_GetEnabledXStateFeatures)()