Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_types.h>
#include <rz_util.h>
#include <rz_lib.h>
#include <rz_bin.h>
#include <ht_up.h>
#include <ht_uu.h>
#include "coff_specs.h"
Go to the source code of this file.
Classes | |
struct | rz_bin_coff_obj |
Macros | |
#define | COFF_IS_BIG_ENDIAN 1 |
#define | COFF_IS_LITTLE_ENDIAN 0 |
#define | RZ_COFF_RELOC_TARGET_SIZE 8 |
Functions | |
RZ_API bool | rz_coff_supported_arch (const ut8 *buf) |
RZ_API ut64 | rz_coff_perms_from_section_flags (ut32 flags) |
RZ_API struct rz_bin_coff_obj * | rz_bin_coff_new_buf (RzBuffer *buf, bool verbose) |
RZ_API void | rz_bin_coff_free (struct rz_bin_coff_obj *obj) |
RZ_API RzBinAddr * | rz_coff_get_entry (struct rz_bin_coff_obj *obj) |
RZ_API char * | rz_coff_symbol_name (struct rz_bin_coff_obj *obj, void *ptr) |
RZ_API ut64 | rz_coff_import_index_addr (struct rz_bin_coff_obj *obj, ut64 imp_index) |
RZ_API ut64 | rz_coff_get_reloc_targets_map_base (struct rz_bin_coff_obj *obj) |
base vaddr where to map the artificial reloc target vfile More... | |
RZ_API RzList * | rz_coff_get_relocs (struct rz_bin_coff_obj *bin) |
RZ_API ut64 | rz_coff_get_reloc_targets_vfile_size (struct rz_bin_coff_obj *obj) |
size of the artificial reloc target vfile More... | |
RZ_API RZ_BORROW RzBuffer * | rz_coff_get_patched_buf (struct rz_bin_coff_obj *bin) |
RZ_API void rz_bin_coff_free | ( | struct rz_bin_coff_obj * | obj | ) |
Definition at line 266 of file coff.c.
References rz_bin_coff_obj::b, rz_bin_coff_obj::buf_patched, free(), rz_bin_coff_obj::imp_ht, rz_bin_coff_obj::imp_index, rz_buf_free(), rz_bin_coff_obj::scn_hdrs, rz_bin_coff_obj::scn_va, rz_bin_coff_obj::sym_ht, and rz_bin_coff_obj::symbols.
Referenced by destroy().
RZ_API struct rz_bin_coff_obj* rz_bin_coff_new_buf | ( | RzBuffer * | buf, |
bool | verbose | ||
) |
Definition at line 278 of file coff.c.
References rz_bin_coff_init(), RZ_NEW0, and verbose.
Referenced by load_buffer().
RZ_API RzBinAddr* rz_coff_get_entry | ( | struct rz_bin_coff_obj * | obj | ) |
Definition at line 89 of file coff.c.
References addr, COFF_SCN_MEM_EXECUTE, free(), rz_bin_coff_obj::hdr, i, NULL, rz_bin_coff_obj::opt_hdr, rz_coff_rebase_sym(), RZ_NEW0, rz_bin_coff_obj::scn_hdrs, and rz_bin_coff_obj::symbols.
Referenced by entries().
RZ_API RZ_BORROW RzBuffer* rz_coff_get_patched_buf | ( | struct rz_bin_coff_obj * | bin | ) |
Definition at line 219 of file coff_reloc.c.
References NULL, patch_reloc_cb(), relocs_foreach(), rz_buf_new_sparse_overlay(), rz_buf_sparse_set_write_mode(), RZ_BUF_SPARSE_WRITE_MODE_SPARSE, RZ_BUF_SPARSE_WRITE_MODE_THROUGH, and rz_return_val_if_fail.
Referenced by virtual_files().
RZ_API ut64 rz_coff_get_reloc_targets_map_base | ( | struct rz_bin_coff_obj * | obj | ) |
base vaddr where to map the artificial reloc target vfile
Definition at line 9 of file coff_reloc.c.
References rz_bin_coff_obj::hdr, i, max, rz_bin_coff_obj::reloc_targets_map_base, rz_bin_coff_obj::reloc_targets_map_base_calculated, RZ_COFF_RELOC_TARGET_SIZE, rz_num_align_delta(), rz_return_val_if_fail, rz_bin_coff_obj::scn_hdrs, rz_bin_coff_obj::scn_va, ut64(), and val.
Referenced by maps(), and rz_coff_import_index_addr().
RZ_API ut64 rz_coff_get_reloc_targets_vfile_size | ( | struct rz_bin_coff_obj * | obj | ) |
size of the artificial reloc target vfile
Definition at line 206 of file coff_reloc.c.
References count, rz_bin_coff_obj::imp_index, RZ_COFF_RELOC_TARGET_SIZE, rz_return_val_if_fail, and ut64().
Referenced by maps(), and virtual_files().
RZ_API RzList* rz_coff_get_relocs | ( | struct rz_bin_coff_obj * | bin | ) |
Definition at line 195 of file coff_reloc.c.
References free(), get_relocs_list_cb(), NULL, r, relocs_foreach(), rz_list_newf(), and rz_return_val_if_fail.
Referenced by relocs().
RZ_API ut64 rz_coff_import_index_addr | ( | struct rz_bin_coff_obj * | obj, |
ut64 | imp_index | ||
) |
Definition at line 32 of file coff_reloc.c.
References rz_coff_get_reloc_targets_map_base(), and RZ_COFF_RELOC_TARGET_SIZE.
Referenced by _fill_bin_symbol(), and relocs_foreach().
Definition at line 36 of file coff.c.
References COFF_SCN_MEM_EXECUTE, COFF_SCN_MEM_READ, COFF_SCN_MEM_WRITE, flags, r, RZ_PERM_R, RZ_PERM_W, and RZ_PERM_X.
Referenced by maps(), and sections().
Definition at line 9 of file coff.c.
References arch, COFF_FILE_MACHINE_AMD29KBE, COFF_FILE_MACHINE_AMD29KLE, COFF_FILE_MACHINE_AMD64, COFF_FILE_MACHINE_ARM, COFF_FILE_MACHINE_ARM64, COFF_FILE_MACHINE_ARMNT, COFF_FILE_MACHINE_H8300, COFF_FILE_MACHINE_I386, COFF_FILE_MACHINE_MIPS16, COFF_FILE_MACHINE_MIPSFPU, COFF_FILE_MACHINE_MIPSFPU16, COFF_FILE_MACHINE_R4000, COFF_FILE_MACHINE_SH3, COFF_FILE_MACHINE_SH3DSP, COFF_FILE_MACHINE_SH4, COFF_FILE_MACHINE_SH5, COFF_FILE_MACHINE_THUMB, COFF_FILE_TI_COFF, and rz_read_le16().
Referenced by check_buffer().
RZ_API char* rz_coff_symbol_name | ( | struct rz_bin_coff_obj * | obj, |
void * | ptr | ||
) |
Definition at line 50 of file coff.c.
References rz_bin_coff_obj::b, rz_bin_coff_obj::hdr, len, n, p, rz_buf_read_at(), rz_str_ndup(), rz_bin_coff_obj::size, and strdup().
Referenced by _fill_bin_import(), _fill_bin_symbol(), maps(), and sections().