Rizin
unix-like reverse engineering framework and cli tools
|
#include "ne.h"
Go to the source code of this file.
Functions | |
static char * | __get_target_os (rz_bin_ne_obj_t *bin) |
static int | __translate_perms (int flags) |
static char * | __read_nonnull_str_at (RzBuffer *buf, ut64 offset) |
static char * | __func_name_from_ord (char *module, ut16 ordinal) |
RzList * | rz_bin_ne_get_segments (rz_bin_ne_obj_t *bin) |
static int | __find_symbol_by_paddr (const void *paddr, const void *sym) |
static void | ne_sanitize_name (char *name, ut16 count) |
RzList * | rz_bin_ne_get_symbols (rz_bin_ne_obj_t *bin) |
static char * | __resource_type_str (int type) |
static void | __free_resource_entry (void *entry) |
static void | __free_resource (void *resource) |
static bool | __ne_get_resources (rz_bin_ne_obj_t *bin) |
RzList * | rz_bin_ne_get_imports (rz_bin_ne_obj_t *bin) |
RzList * | rz_bin_ne_get_entrypoints (rz_bin_ne_obj_t *bin) |
RzList * | rz_bin_ne_get_relocs (rz_bin_ne_obj_t *bin) |
bool | rz_bin_ne_buf_init (RzBuffer *buf, rz_bin_ne_obj_t *bin) |
void | rz_bin_ne_free (rz_bin_ne_obj_t *bin) |
rz_bin_ne_obj_t * | rz_bin_ne_new_buf (RzBuffer *buf, bool verbose) |
Definition at line 108 of file ne.c.
References ut64().
Referenced by rz_bin_ne_get_symbols().
|
static |
Definition at line 285 of file ne.c.
References rz_ne_resource::entry, free(), rz_ne_resource::name, and rz_list_free().
Referenced by __ne_get_resources().
|
static |
Definition at line 279 of file ne.c.
References free(), and rz_ne_resource_entry::name.
Referenced by __ne_get_resources().
|
static |
Definition at line 55 of file ne.c.
References free(), name, NULL, path, rz_file_exists(), RZ_JOIN_3_PATHS, rz_path_system(), RZ_SDB_FORMAT, rz_str_newf(), sdb_close(), sdb_get(), and sdb_new().
Referenced by rz_bin_ne_get_relocs().
|
static |
|
static |
Definition at line 292 of file ne.c.
References __free_resource(), __free_resource_entry(), __read_nonnull_str_at(), __resource_type_str(), bin::buf, rz_ne_resource::entry, i, rz_ne_resource_entry::name, rz_ne_resource::name, off, rz_ne_resource_entry::offset, _NAMEINFO::rnID, _NAMEINFO::rnLength, _NAMEINFO::rnOffset, _TYPEINFO::rtResourceCount, _TYPEINFO::rtTypeID, rz_buf_read_at(), rz_buf_read_le16_at, rz_list_append(), rz_list_newf(), RZ_NEW0, rz_str_newf(), rz_ne_resource_entry::size, and ut64().
Referenced by rz_bin_ne_buf_init().
Definition at line 38 of file ne.c.
References malloc(), NULL, rz_buf_read8_at(), rz_buf_read_at(), cmd_descs_generate::str, and ut64().
Referenced by __ne_get_resources(), and rz_bin_ne_get_relocs().
|
static |
Definition at line 204 of file ne.c.
References rz_str_newf(), strdup(), and type.
Referenced by __ne_get_resources().
Definition at line 23 of file ne.c.
References flags, IS_DATA, IS_RX, RZ_PERM_R, RZ_PERM_RWX, and RZ_PERM_X.
Referenced by rz_bin_ne_get_segments().
|
static |
Definition at line 112 of file ne.c.
References count, i, and IS_PRINTABLE.
Referenced by rz_bin_ne_get_symbols().
bool rz_bin_ne_buf_init | ( | RzBuffer * | buf, |
rz_bin_ne_obj_t * | bin | ||
) |
Definition at line 616 of file ne.c.
References __get_target_os(), __ne_get_resources(), bin::buf, calloc(), rz_bin_ne_get_imports(), rz_buf_read_at(), rz_buf_read_le16_at, RZ_NEW0, and ut64().
Referenced by rz_bin_ne_new_buf().
void rz_bin_ne_free | ( | rz_bin_ne_obj_t * | bin | ) |
Definition at line 659 of file ne.c.
References free(), and rz_list_free().
Referenced by destroy(), and rz_bin_ne_new_buf().
RzList* rz_bin_ne_get_entrypoints | ( | rz_bin_ne_obj_t * | bin | ) |
Definition at line 384 of file ne.c.
References entries(), free(), i, NULL, off, p, rz_bin_ne_get_segments(), rz_list_append(), rz_list_free(), rz_list_get_n(), rz_list_newf(), RZ_NEW0, s, and ut64().
Referenced by entries(), and rz_bin_ne_get_symbols().
RzList* rz_bin_ne_get_imports | ( | rz_bin_ne_obj_t * | bin | ) |
Definition at line 348 of file ne.c.
References bin::buf, i, imports(), malloc(), name, rz_bin_import_t::name, NULL, off, rz_bin_import_t::ordinal, rz_bin_import_free(), rz_buf_read8_at(), rz_buf_read_at(), rz_list_append(), rz_list_newf(), RZ_NEW0, and ut64().
Referenced by imports(), and rz_bin_ne_buf_init().
RzList* rz_bin_ne_get_relocs | ( | rz_bin_ne_obj_t * | bin | ) |
Definition at line 457 of file ne.c.
References __func_name_from_ord(), __read_nonnull_str_at(), rz_bin_reloc_t::addend, ADDITIVE, rz_bin_reloc_t::additive, bin::buf, calloc(), entries(), _RELOC::entry_ordinal, _RELOC::flags, free(), _RELOC::func_ord, rz_bin_reloc_t::import, IMPORTED_NAME, IMPORTED_ORD, _RELOC::index, length, LOBYTE, rz_bin_section_t::name, rz_bin_import_t::name, _RELOC::name_off, NULL, off, OFF_16, OFF_32, _RELOC::offset, rz_bin_import_t::ordinal, OSFIXUP, rz_bin_section_t::paddr, rz_bin_symbol_t::paddr, rz_bin_reloc_t::paddr, POI_32, POI_48, RELOCINFO, relocs(), RZ_BIN_RELOC_16, RZ_BIN_RELOC_32, RZ_BIN_RELOC_64, RZ_BIN_RELOC_8, rz_buf_read_at(), rz_buf_read_le16_at, rz_buf_size(), rz_list_append(), rz_list_get_n(), rz_list_newf(), RZ_NEW0, rz_str_newf(), s, _RELOC::segnum, _RELOC::segoff, SEL_16, rz_bin_section_t::size, start, rz_bin_reloc_t::symbol, symbols(), autogen_x86imm::tmp, _RELOC::type, rz_bin_reloc_t::type, and ut64().
Referenced by relocs().
RzList* rz_bin_ne_get_segments | ( | rz_bin_ne_obj_t * | bin | ) |
Definition at line 78 of file ne.c.
References __translate_perms(), rz_bin_section_t::bits, _SEGMENT::flags, free(), i, IS_DATA, rz_bin_section_t::is_data, IS_MOVEABLE, rz_bin_section_t::is_segment, _SEGMENT::length, _SEGMENT::minAllocSz, rz_bin_section_t::name, NULL, _SEGMENT::offset, rz_bin_section_t::paddr, rz_bin_section_t::perm, PFMT64d, rz_bin_section_free(), rz_list_append(), rz_list_newf(), RZ_NEW0, rz_str_newf(), RZ_SYS_BITS_16, rz_bin_section_t::size, ut64(), and rz_bin_section_t::vsize.
Referenced by rz_bin_ne_get_entrypoints(), and sections().
RzList* rz_bin_ne_get_symbols | ( | rz_bin_ne_obj_t * | bin | ) |
Definition at line 121 of file ne.c.
References __find_symbol_by_paddr(), rz_bin_symbol_t::bind, bin::buf, entries(), free(), i, malloc(), name, rz_bin_symbol_t::name, ne_sanitize_name(), NULL, off, rz_bin_symbol_t::ordinal, rz_bin_addr_t::paddr, rz_bin_symbol_t::paddr, RZ_BIN_BIND_GLOBAL_STR, rz_bin_ne_get_entrypoints(), rz_bin_symbol_free(), rz_buf_read8_at(), rz_buf_read_at(), rz_buf_read_le16_at, rz_list_append(), rz_list_find(), rz_list_get_n(), rz_list_newf(), RZ_NEW0, rz_str_newf(), symbols(), and ut64().
Referenced by symbols().
rz_bin_ne_obj_t* rz_bin_ne_new_buf | ( | RzBuffer * | buf, |
bool | verbose | ||
) |
Definition at line 672 of file ne.c.
References NULL, rz_bin_ne_buf_init(), rz_bin_ne_free(), and RZ_NEW0.
Referenced by load_buffer().