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 "wasm/wasm.h"
#include "../format/wasm/wasm.h"
Go to the source code of this file.
Macros | |
#define | B(x, y) rz_buf_append_bytes(buf, (const ut8 *)(x), y) |
#define | D(x) rz_buf_append_ut32(buf, x) |
Functions | |
static bool | check_buffer (RzBuffer *rbuf) |
static bool | find_export (const ut32 *p, const RzBinWasmExportEntry *q) |
static bool | load_buffer (RzBinFile *bf, RzBinObject *obj, RzBuffer *buf, Sdb *sdb) |
static void | destroy (RzBinFile *bf) |
static ut64 | baddr (RzBinFile *bf) |
static RzBinAddr * | binsym (RzBinFile *bf, RzBinSpecialSymbol type) |
static RzList * | sections (RzBinFile *bf) |
static RzList * | entries (RzBinFile *bf) |
static RzList * | symbols (RzBinFile *bf) |
static RzList * | imports (RzBinFile *bf) |
static RzList * | libs (RzBinFile *bf) |
static RzBinInfo * | info (RzBinFile *bf) |
static ut64 | size (RzBinFile *bf) |
static RzBuffer * | create (RzBin *bin, const ut8 *code, int codelen, const ut8 *data, int datalen, RzBinArchOptions *opt) |
Variables | |
RzBinPlugin | rz_bin_plugin_wasm |
RZ_API RzLibStruct | rizin_plugin |
#define D | ( | x | ) | rz_buf_append_ut32(buf, x) |
Definition at line 41 of file bin_wasm.c.
|
static |
Definition at line 45 of file bin_wasm.c.
References NULL.
Definition at line 15 of file bin_wasm.c.
References RZ_BIN_WASM_MAGIC_BYTES, and rz_buf_read_at().
Referenced by load_buffer().
|
static |
Definition at line 316 of file bin_wasm.c.
References B, NULL, and rz_buf_new_with_bytes().
|
static |
Definition at line 51 of file bin_wasm.c.
References addr, rz_bin_object_t::bin_obj, rz_bin_wasm_code_t::code, codes(), free(), NULL, rz_bin_file_t::o, rz_bin_addr_t::paddr, rz_bin_wasm_get_codes(), rz_bin_wasm_get_entrypoint(), rz_list_append(), rz_list_free(), rz_list_newf(), RZ_NEW0, ut64(), and rz_bin_addr_t::vaddr.
|
static |
Definition at line 20 of file bin_wasm.c.
References rz_bin_wasm_export_t::index, rz_bin_wasm_export_t::kind, and RZ_BIN_WASM_EXTERNALKIND_Function.
Referenced by symbols().
Definition at line 232 of file bin_wasm.c.
References rz_bin_object_t::bin_obj, rz_bin_import_t::bind, rz_bin_import_t::classname, i, rz_bin_import_t::name, NULL, rz_bin_file_t::o, rz_bin_import_t::ordinal, rz_bin_import_free(), RZ_BIN_WASM_EXTERNALKIND_Function, RZ_BIN_WASM_EXTERNALKIND_Global, RZ_BIN_WASM_EXTERNALKIND_Memory, RZ_BIN_WASM_EXTERNALKIND_Table, rz_bin_wasm_get_imports(), rz_list_append(), rz_list_free(), rz_list_newf(), RZ_NEW0, strdup(), and rz_bin_import_t::type.
Referenced by symbols().
Definition at line 287 of file bin_wasm.c.
References rz_bin_info_t::arch, rz_bin_info_t::bclass, rz_bin_info_t::big_endian, rz_bin_info_t::bits, rz_bin_info_t::dbg_info, rz_bin_info_t::file, rz_bin_file_t::file, rz_bin_info_t::has_va, rz_bin_info_t::machine, NULL, rz_bin_info_t::os, rz_bin_info_t::rclass, RZ_NEW0, strdup(), rz_bin_info_t::subsystem, and rz_bin_info_t::type.
|
static |
Definition at line 27 of file bin_wasm.c.
References rz_bin_object_t::bin_obj, check_buffer(), rz_bin_wasm_init(), rz_buf_size(), rz_return_val_if_fail, and UT64_MAX.
Definition at line 86 of file bin_wasm.c.
References rz_bin_object_t::bin_obj, free(), rz_bin_wasm_section_t::id, rz_bin_section_t::is_data, rz_bin_wasm_section_t::name, rz_bin_section_t::name, NULL, rz_bin_file_t::o, rz_bin_wasm_section_t::offset, rz_bin_section_t::paddr, rz_bin_wasm_section_t::payload_len, rz_bin_section_t::perm, rz_bin_wasm_get_sections(), RZ_BIN_WASM_SECTION_DATA, RZ_BIN_WASM_SECTION_MEMORY, rz_list_append(), rz_list_free(), rz_list_newf(), RZ_NEW0, rz_bin_section_t::size, strdup(), rz_bin_section_t::vaddr, and rz_bin_section_t::vsize.
Definition at line 122 of file bin_wasm.c.
References rz_bin_object_t::bin_obj, rz_bin_symbol_t::bind, rz_bin_wasm_code_t::code, codes(), rz_bin_wasm_import_t::field_str, find_export(), rz_bin_symbol_t::forwarder, i, imports(), rz_bin_symbol_t::is_imported, rz_bin_wasm_import_t::kind, rz_bin_wasm_code_t::len, rz_bin_symbol_t::libname, rz_bin_wasm_import_t::module_str, rz_bin_symbol_t::name, NULL, rz_bin_file_t::o, rz_bin_symbol_t::ordinal, rz_bin_symbol_t::paddr, RZ_BIN_BIND_GLOBAL_STR, rz_bin_symbol_free(), RZ_BIN_TYPE_FUNC_STR, RZ_BIN_WASM_EXTERNALKIND_Function, RZ_BIN_WASM_EXTERNALKIND_Global, RZ_BIN_WASM_EXTERNALKIND_Memory, RZ_BIN_WASM_EXTERNALKIND_Table, rz_bin_wasm_get_codes(), rz_bin_wasm_get_exports(), rz_bin_wasm_get_function_name(), rz_bin_wasm_get_imports(), rz_list_append(), rz_list_find(), rz_list_free(), rz_list_newf(), RZ_NEW0, rz_str_newf(), rz_bin_symbol_t::size, strdup(), rz_bin_symbol_t::type, ut64(), and rz_bin_symbol_t::vaddr.
RZ_API RzLibStruct rizin_plugin |
Definition at line 348 of file bin_wasm.c.
RzBinPlugin rz_bin_plugin_wasm |
Definition at line 327 of file bin_wasm.c.