Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Functions | |
static ut64 | rz_bin_mz_va_to_la (const ut16 segment, const ut16 offset) |
static ut64 | rz_bin_mz_la_to_pa (const struct rz_bin_mz_obj_t *bin, ut64 la) |
RzBinAddr * | rz_bin_mz_get_entrypoint (const struct rz_bin_mz_obj_t *bin) |
static int | cmp_sections (const void *a, const void *b) |
static RzBinSection * | rz_bin_mz_init_section (const struct rz_bin_mz_obj_t *bin, ut64 laddr) |
RzList * | rz_bin_mz_get_segments (const struct rz_bin_mz_obj_t *bin) |
struct rz_bin_mz_reloc_t * | rz_bin_mz_get_relocs (const struct rz_bin_mz_obj_t *bin) |
void * | rz_bin_mz_free (struct rz_bin_mz_obj_t *bin) |
static int | rz_bin_mz_init_hdr (struct rz_bin_mz_obj_t *bin) |
static bool | rz_bin_mz_init (struct rz_bin_mz_obj_t *bin) |
struct rz_bin_mz_obj_t * | rz_bin_mz_new (const char *file) |
struct rz_bin_mz_obj_t * | rz_bin_mz_new_buf (RzBuffer *buf) |
RzBinAddr * | rz_bin_mz_get_main_vaddr (struct rz_bin_mz_obj_t *bin) |
Definition at line 41 of file mz.c.
References a, b, and rz_bin_section_t::vaddr.
Referenced by rz_bin_mz_get_segments().
void* rz_bin_mz_free | ( | struct rz_bin_mz_obj_t * | bin | ) |
Definition at line 188 of file mz.c.
References free(), NULL, and rz_buf_free().
Referenced by destroy(), rz_bin_mz_new(), and rz_bin_mz_new_buf().
RzBinAddr* rz_bin_mz_get_entrypoint | ( | const struct rz_bin_mz_obj_t * | bin | ) |
Definition at line 16 of file mz.c.
References MZ_image_dos_header::cs, MZ_image_dos_header::ip, NULL, rz_bin_addr_t::paddr, rz_bin_mz_la_to_pa(), rz_bin_mz_va_to_la(), RZ_LOG_ERROR, RZ_NEW0, ut64(), and rz_bin_addr_t::vaddr.
Referenced by entries(), and rz_bin_mz_get_main_vaddr().
RzBinAddr* rz_bin_mz_get_main_vaddr | ( | struct rz_bin_mz_obj_t * | bin | ) |
Definition at line 330 of file mz.c.
References b, free(), n, NULL, PFMT64x, rz_bin_mz_get_entrypoint(), rz_bin_mz_la_to_pa(), rz_bin_mz_va_to_la(), rz_buf_read_at(), RZ_FREE, RZ_LOG_ERROR, rz_read_ble16(), ut64(), and ZERO_FILL.
Referenced by binsym().
struct rz_bin_mz_reloc_t* rz_bin_mz_get_relocs | ( | const struct rz_bin_mz_obj_t * | bin | ) |
Definition at line 163 of file mz.c.
References calloc(), i, NULL, relocs(), rz_bin_mz_la_to_pa(), rz_bin_mz_va_to_la(), RZ_LOG_ERROR, and rz_bin_mz_reloc_t::vaddr.
Referenced by relocs().
RzList* rz_bin_mz_get_segments | ( | const struct rz_bin_mz_obj_t * | bin | ) |
Definition at line 62 of file mz.c.
References c, cmp_sections(), i, NULL, relocs(), rz_bin_mz_init_section(), rz_bin_mz_la_to_pa(), rz_bin_mz_va_to_la(), rz_bin_section_free(), rz_buf_read_le16_at, rz_buf_size(), rz_list_add_sorted(), rz_list_find(), rz_list_free(), rz_list_get_top(), rz_list_newf(), RZ_LOG_ERROR, rz_str_newf(), rz_str_rwx(), section::size, rz_bin_section_t::size, ut64(), rz_bin_section_t::vaddr, and rz_bin_section_t::vsize.
Referenced by sections().
|
static |
Definition at line 281 of file mz.c.
References NULL, rz_bin_mz_init_hdr(), RZ_LOG_WARN, and sdb_new0().
Referenced by rz_bin_mz_new(), and rz_bin_mz_new_buf().
|
static |
Definition at line 201 of file mz.c.
References MZ_image_dos_header::blocks_in_file, MZ_image_dos_header::bytes_in_last_block, MZ_image_dos_header::cs, MZ_image_dos_header::header_paragraphs, MZ_image_dos_header::ip, malloc(), MZ_image_dos_header::num_relocs, MZ_image_dos_header::overlay_number, MZ_image_dos_header::reloc_table_offset, rz_buf_read_at(), RZ_FREE, RZ_LOG_ERROR, RZ_NEW0, sdb_num_set(), sdb_set(), MZ_image_dos_header::sp, and MZ_image_dos_header::ss.
Referenced by rz_bin_mz_init().
|
static |
|
static |
Definition at line 12 of file mz.c.
Referenced by rz_bin_mz_get_entrypoint(), rz_bin_mz_get_main_vaddr(), rz_bin_mz_get_relocs(), and rz_bin_mz_get_segments().
struct rz_bin_mz_obj_t* rz_bin_mz_new | ( | const char * | file | ) |
Definition at line 293 of file mz.c.
References file, free(), NULL, rz_bin_mz_free(), rz_bin_mz_init(), rz_buf_new_with_bytes(), rz_buf_set_bytes(), rz_file_slurp(), and RZ_NEW0.
struct rz_bin_mz_obj_t* rz_bin_mz_new_buf | ( | RzBuffer * | buf | ) |
Definition at line 317 of file mz.c.
References NULL, rz_bin_mz_free(), rz_bin_mz_init(), rz_buf_new_with_buf(), rz_buf_size(), and RZ_NEW0.
Referenced by load().
Definition at line 8 of file mz.c.
Referenced by rz_bin_mz_get_entrypoint(), rz_bin_mz_get_main_vaddr(), rz_bin_mz_get_relocs(), and rz_bin_mz_get_segments().