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 <string.h>
#include "../format/xbe/xbe.h"
#include "../format/xbe/kernel.h"
Go to the source code of this file.
Functions | |
static bool | read_xbe_header (xbe_header *hdr, RzBuffer *b, ut64 off) |
static bool | read_xbe_section (xbe_section *sect, RzBuffer *b, ut64 off) |
static bool | read_xbe_lib (xbe_lib *lib, RzBuffer *b, ut64 off) |
static bool | check_buffer (RzBuffer *b) |
static bool | load_buffer (RzBinFile *bf, RzBinObject *o, RzBuffer *buf, Sdb *sdb) |
static void | destroy (RzBinFile *bf) |
static RzBinAddr * | binsym (RzBinFile *bf, RzBinSpecialSymbol type) |
static RzList * | entries (RzBinFile *bf) |
static RzList * | sections (RzBinFile *bf) |
static char * | describe_xbe_lib_at (RzBuffer *b, ut64 off, ut64 filesz) |
static RzList * | libs (RzBinFile *bf) |
static RzList * | symbols (RzBinFile *bf) |
static RzBinInfo * | info (RzBinFile *bf) |
static ut64 | baddr (RzBinFile *bf) |
Variables | |
static const char * | kt_name [] |
RzBinPlugin | rz_bin_plugin_xbe |
RZ_API RzLibStruct | rizin_plugin |
Definition at line 366 of file bin_xbe.c.
References xbe_header::base, rz_bin_object_t::bin_obj, rz_bin_xbe_obj_t::header, and rz_bin_file_t::o.
|
static |
Definition at line 113 of file bin_xbe.c.
References xbe_header::base, rz_bin_object_t::bin_obj, rz_bin_file_t::buf, xbe_header::ep, rz_bin_xbe_obj_t::ep_key, rz_bin_xbe_obj_t::header, NULL, rz_bin_file_t::o, rz_bin_addr_t::paddr, RZ_BIN_SPECIAL_SYMBOL_MAIN, RZ_NEW0, type, and rz_bin_addr_t::vaddr.
Definition at line 74 of file bin_xbe.c.
References b, and rz_buf_read_at().
Generate a string like "<LIBNAME> <MAJOR>.<MINOR>.<BUILD>" by reading an xbe_lib at the given offset.
Definition at line 219 of file bin_xbe.c.
References b, xbe_lib::build, xbe_lib::major, memcpy(), xbe_lib::minor, xbe_lib::name, NULL, off, read_xbe_lib(), RZ_STATIC_ASSERT, and rz_str_newf().
Referenced by libs().
|
static |
Definition at line 109 of file bin_xbe.c.
References rz_bin_object_t::bin_obj, rz_bin_file_t::o, and RZ_FREE.
Definition at line 127 of file bin_xbe.c.
References xbe_header::base, rz_bin_object_t::bin_obj, rz_bin_file_t::buf, xbe_header::ep, rz_bin_xbe_obj_t::ep_key, rz_list_t::free, free(), rz_bin_xbe_obj_t::header, NULL, rz_bin_file_t::o, rz_bin_addr_t::paddr, rz_list_append(), rz_list_new(), RZ_NEW0, and rz_bin_addr_t::vaddr.
Definition at line 333 of file bin_xbe.c.
References rz_bin_info_t::arch, xbe_header::base, rz_bin_info_t::bclass, rz_bin_info_t::big_endian, rz_bin_object_t::bin_obj, rz_bin_info_t::bits, rz_bin_file_t::buf, rz_bin_info_t::dbg_info, xbe_header::debug_name_addr, rz_bin_info_t::file, rz_bin_info_t::has_va, rz_bin_xbe_obj_t::header, rz_bin_info_t::lang, rz_bin_info_t::machine, memset(), NULL, rz_bin_file_t::o, rz_bin_info_t::os, rz_buf_read_at(), RZ_NEW0, strdup(), and rz_bin_info_t::type.
Definition at line 235 of file bin_xbe.c.
References addr, rz_bin_object_t::bin_obj, rz_bin_file_t::buf, describe_xbe_lib_at(), free(), h, rz_bin_xbe_obj_t::header, i, NULL, rz_bin_file_t::o, rz_list_newf(), rz_list_push(), rz_bin_file_t::size, and ut64().
|
static |
Definition at line 82 of file bin_xbe.c.
References rz_bin_object_t::bin_obj, xbe_header::ep, rz_bin_xbe_obj_t::ep_key, rz_bin_xbe_obj_t::header, rz_bin_xbe_obj_t::kt_key, read_xbe_header(), RZ_FREE, RZ_NEW, XBE_EP_CHIHIRO, XBE_EP_DEBUG, XBE_EP_RETAIL, XBE_KP_CHIHIRO, XBE_KP_DEBUG, and XBE_KP_RETAIL.
|
static |
Definition at line 17 of file bin_xbe.c.
References b, xbe_header::base, xbe_header::cert_addr, xbe_header::debug_name_addr, xbe_header::debug_path_addr, xbe_header::debug_uname_addr, xbe_header::ep, xbe_header::headers_size, i, xbe_header::image_header_size, xbe_header::image_size, xbe_header::init_flags, xbe_header::kernel_lib_addr, xbe_header::kernel_thunk_addr, xbe_header::lib_versions, xbe_header::lib_versions_addr, xbe_header::magic, xbe_header::nonkernel_import_dir_addr, off, xbe_header::padding, xbe_header::pe_data, RZ_ARRAY_SIZE, rz_buf_read_at(), rz_buf_read_le32_at, xbe_header::sechdr_addr, xbe_header::sections, xbe_header::signature, xbe_header::timestamp, xbe_header::tls_addr, and xbe_header::xapi_lib_addr.
Referenced by load_buffer().
Definition at line 66 of file bin_xbe.c.
References b, xbe_lib::build, xbe_lib::flags, xbe_lib::major, xbe_lib::minor, xbe_lib::name, off, rz_buf_read_at(), and rz_buf_read_le16_at.
Referenced by describe_xbe_lib_at().
|
static |
Definition at line 53 of file bin_xbe.c.
References b, xbe_section::digest, xbe_section::flags, xbe_section::name_addr, off, xbe_section::offset, xbe_section::padding, xbe_section::refcount, rz_buf_read_at(), rz_buf_read_le32_at, xbe_section::size, xbe_section::vaddr, and xbe_section::vsize.
Referenced by sections(), and symbols().
Definition at line 148 of file bin_xbe.c.
References addr, rz_bin_object_t::bin_obj, rz_bin_file_t::buf, xbe_section::flags, rz_list_t::free, free(), h, rz_bin_xbe_obj_t::header, i, rz_bin_section_t::name, xbe_section::name_addr, NULL, rz_bin_file_t::o, xbe_section::offset, rz_bin_section_t::paddr, rz_bin_section_t::perm, r, read_xbe_section(), rz_buf_read_at(), rz_list_append(), rz_list_free(), rz_list_new(), RZ_NEW0, RZ_PERM_R, RZ_PERM_W, RZ_PERM_X, rz_str_newf(), SECT_FLAG_W, SECT_FLAG_X, xbe_section::size, rz_bin_file_t::size, rz_bin_section_t::size, autogen_x86imm::tmp, xbe_section::vaddr, rz_bin_section_t::vaddr, xbe_section::vsize, and rz_bin_section_t::vsize.
Definition at line 262 of file bin_xbe.c.
References addr, rz_bin_object_t::bin_obj, rz_bin_file_t::buf, found, free(), h, rz_bin_xbe_obj_t::header, i, rz_bin_xbe_obj_t::kt_key, kt_name, limit, rz_bin_symbol_t::name, NULL, rz_bin_file_t::o, xbe_section::offset, rz_bin_symbol_t::ordinal, rz_bin_symbol_t::paddr, read_xbe_section(), RZ_ARRAY_SIZE, rz_bin_symbol_free(), rz_buf_read_le32_at, rz_list_append(), rz_list_free(), rz_list_newf(), RZ_NEW0, rz_str_newf(), rz_bin_file_t::size, rz_bin_symbol_t::size, xbe_section::vaddr, rz_bin_symbol_t::vaddr, xbe_section::vsize, and XBE_MAX_THUNK.
|
static |
RZ_API RzLibStruct rizin_plugin |
RzBinPlugin rz_bin_plugin_xbe |