Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Classes | |
struct | rz_bin_wasm_init_expr_t |
struct | rz_bin_wasm_resizable_limits_t |
struct | rz_bin_wasm_name_t |
struct | rz_bin_wasm_section_t |
struct | rz_bin_wasm_type_t |
struct | rz_bin_wasm_global_type_t |
struct | rz_bin_wasm_table_type_t |
struct | rz_bin_wasm_memory_type_t |
struct | rz_bin_wasm_import_t |
struct | rz_bin_wasm_function_t |
struct | rz_bin_wasm_table_t |
struct | rz_bin_wasm_memory_t |
struct | rz_bin_wasm_global_t |
struct | rz_bin_wasm_export_t |
struct | rz_bin_wasm_start_t |
struct | rz_bin_wasm_local_entry_t |
struct | rz_bin_wasm_element_t |
struct | rz_bin_wasm_code_t |
struct | rz_bin_wasm_data_t |
struct | rz_bin_wasm_custom_name_function_names_t |
struct | rz_bin_wasm_custom_name_local_name_t |
struct | rz_bin_wasm_custom_name_local_names_t |
struct | rz_bin_wasm_custom_name_entry_t |
struct | rz_bin_wasm_obj_t |
Macros | |
#define | RZ_BIN_WASM_MAGIC_BYTES |
#define | RZ_BIN_WASM_VERSION 0x1 |
#define | RZ_BIN_WASM_STRING_LENGTH 256 |
#define | RZ_BIN_WASM_END_OF_CODE 0xb |
#define | RZ_BIN_WASM_SECTION_CUSTOM 0x0 |
#define | RZ_BIN_WASM_SECTION_TYPE 0x1 |
#define | RZ_BIN_WASM_SECTION_IMPORT 0x2 |
#define | RZ_BIN_WASM_SECTION_FUNCTION 0x3 |
#define | RZ_BIN_WASM_SECTION_TABLE 0x4 |
#define | RZ_BIN_WASM_SECTION_MEMORY 0x5 |
#define | RZ_BIN_WASM_SECTION_GLOBAL 0x6 |
#define | RZ_BIN_WASM_SECTION_EXPORT 0x7 |
#define | RZ_BIN_WASM_SECTION_START 0x8 |
#define | RZ_BIN_WASM_SECTION_ELEMENT 0x9 |
#define | RZ_BIN_WASM_SECTION_CODE 0xa |
#define | RZ_BIN_WASM_SECTION_DATA 0xb |
Enumerations | |
enum | rz_bin_wasm_value_type_t { RZ_BIN_WASM_VALUETYPE_i32 = 0x1 , RZ_BIN_WASM_VALUETYPE_i64 = 0x2 , RZ_BIN_WASM_VALUETYPE_f32 = 0x3 , RZ_BIN_WASM_VALUETYPE_f64 = 0x4 , RZ_BIN_WASM_VALUETYPE_v128 = 0x5 , RZ_BIN_WASM_VALUETYPE_ANYFUNC = 0x10 , RZ_BIN_WASM_VALUETYPE_FUNC = 0x20 , RZ_BIN_WASM_VALUETYPE_EMPTY = 0x40 } |
enum | rz_bin_wasm_external_kind_t { RZ_BIN_WASM_EXTERNALKIND_Function = 0x0 , RZ_BIN_WASM_EXTERNALKIND_Table = 0x1 , RZ_BIN_WASM_EXTERNALKIND_Memory = 0x2 , RZ_BIN_WASM_EXTERNALKIND_Global = 0x3 } |
enum | rz_bin_wasm_custom_name_type_t { RZ_BIN_WASM_NAMETYPE_Module = 0x0 , RZ_BIN_WASM_NAMETYPE_Function = 0x1 , RZ_BIN_WASM_NAMETYPE_Local = 0x2 } |
typedef struct rz_bin_wasm_code_t RzBinWasmCodeEntry |
typedef struct rz_bin_wasm_custom_name_entry_t RzBinWasmCustomNameEntry |
typedef struct rz_bin_wasm_custom_name_local_name_t RzBinWasmCustomNameLocalName |
typedef struct rz_bin_wasm_data_t RzBinWasmDataEntry |
typedef struct rz_bin_wasm_element_t RzBinWasmElementEntry |
typedef struct rz_bin_wasm_export_t RzBinWasmExportEntry |
typedef struct rz_bin_wasm_function_t RzBinWasmFunctionEntry |
typedef struct rz_bin_wasm_global_t RzBinWasmGlobalEntry |
typedef struct rz_bin_wasm_import_t RzBinWasmImportEntry |
typedef struct rz_bin_wasm_memory_t RzBinWasmMemoryEntry |
typedef struct rz_bin_wasm_obj_t RzBinWasmObj |
typedef struct rz_bin_wasm_section_t RzBinWasmSection |
typedef struct rz_bin_wasm_start_t RzBinWasmStartEntry |
typedef struct rz_bin_wasm_table_t RzBinWasmTableEntry |
typedef struct rz_bin_wasm_type_t RzBinWasmTypeEntry |
void rz_bin_wasm_destroy | ( | RzBinFile * | bf | ) |
Definition at line 789 of file wasm.c.
References rz_bin_object_t::bin_obj, bin::buf, free(), rz_bin_wasm_custom_name_entry_t::func, rz_bin_wasm_custom_name_entry_t::local, local, rz_bin_wasm_custom_name_local_names_t::locals, rz_bin_wasm_custom_name_entry_t::mod_name, rz_bin_wasm_custom_name_function_names_t::names, NULL, rz_bin_file_t::o, RZ_BIN_WASM_NAMETYPE_Function, RZ_BIN_WASM_NAMETYPE_Local, RZ_BIN_WASM_NAMETYPE_Module, rz_buf_free(), rz_id_storage_free(), rz_list_free(), and rz_bin_wasm_custom_name_entry_t::type.
Referenced by destroy().
RzList* rz_bin_wasm_get_codes | ( | RzBinWasmObj * | bin | ) |
Definition at line 1168 of file wasm.c.
References codes(), NULL, rz_bin_wasm_get_code_entries(), rz_bin_wasm_get_sections_by_id(), RZ_BIN_WASM_SECTION_CODE, rz_list_first(), rz_list_free(), and rz_list_new().
Referenced by entries(), rz_bin_wasm_init(), and symbols().
RzList* rz_bin_wasm_get_custom_names | ( | RzBinWasmObj * | bin | ) |
Definition at line 1215 of file wasm.c.
References rz_bin_wasm_section_t::name, NULL, rz_bin_wasm_get_custom_name_entries(), rz_bin_wasm_get_sections_by_id(), RZ_BIN_WASM_SECTION_CUSTOM, rz_list_first(), rz_list_free(), rz_list_new(), and rz_return_val_if_fail.
Referenced by rz_bin_wasm_init().
RzList* rz_bin_wasm_get_datas | ( | RzBinWasmObj * | bin | ) |
Definition at line 1192 of file wasm.c.
References NULL, rz_bin_wasm_get_data_entries(), rz_bin_wasm_get_sections_by_id(), RZ_BIN_WASM_SECTION_DATA, rz_list_first(), rz_list_free(), and rz_list_new().
Referenced by rz_bin_wasm_init().
RzList* rz_bin_wasm_get_elements | ( | RzBinWasmObj * | bin | ) |
Definition at line 1145 of file wasm.c.
References NULL, rz_bin_wasm_get_element_entries(), rz_bin_wasm_get_sections_by_id(), RZ_BIN_WASM_SECTION_ELEMENT, rz_list_first(), rz_list_free(), and rz_list_new().
ut32 rz_bin_wasm_get_entrypoint | ( | RzBinWasmObj * | bin | ) |
Definition at line 966 of file wasm.c.
References rz_bin_wasm_code_t::code, NULL, rz_bin_wasm_get_sections_by_id(), rz_bin_wasm_get_start(), RZ_BIN_WASM_SECTION_START, rz_list_first(), rz_list_free(), rz_list_get_n(), and start.
Referenced by entries(), and rz_bin_wasm_init().
RzList* rz_bin_wasm_get_exports | ( | RzBinWasmObj * | bin | ) |
Definition at line 1026 of file wasm.c.
References NULL, rz_bin_wasm_get_export_entries(), rz_bin_wasm_get_sections_by_id(), RZ_BIN_WASM_SECTION_EXPORT, rz_list_first(), rz_list_free(), and rz_list_new().
Referenced by rz_bin_wasm_init(), and symbols().
const char* rz_bin_wasm_get_function_name | ( | RzBinWasmObj * | bin, |
ut32 | idx | ||
) |
Definition at line 1237 of file wasm.c.
References rz_bin_wasm_custom_name_entry_t::func, setup::idx, n, rz_bin_wasm_custom_name_function_names_t::names, NULL, RZ_BIN_WASM_NAMETYPE_Function, rz_id_storage_get(), and rz_bin_wasm_custom_name_entry_t::type.
Referenced by symbols().
RzList* rz_bin_wasm_get_globals | ( | RzBinWasmObj * | bin | ) |
Definition at line 1122 of file wasm.c.
References NULL, rz_bin_wasm_get_global_entries(), rz_bin_wasm_get_sections_by_id(), RZ_BIN_WASM_SECTION_GLOBAL, rz_list_first(), rz_list_free(), and rz_list_new().
Referenced by rz_bin_wasm_init().
RzList* rz_bin_wasm_get_imports | ( | RzBinWasmObj * | bin | ) |
Definition at line 1003 of file wasm.c.
References imports(), NULL, rz_bin_wasm_get_import_entries(), rz_bin_wasm_get_sections_by_id(), RZ_BIN_WASM_SECTION_IMPORT, rz_list_first(), rz_list_free(), and rz_list_new().
Referenced by imports(), rz_bin_wasm_init(), and symbols().
RzList* rz_bin_wasm_get_memories | ( | RzBinWasmObj * | bin | ) |
Definition at line 1095 of file wasm.c.
References NULL, rz_bin_wasm_get_memory_entries(), rz_bin_wasm_get_sections_by_id(), RZ_BIN_WASM_SECTION_MEMORY, rz_list_first(), rz_list_free(), and rz_list_new().
Referenced by rz_bin_wasm_init().
RzList* rz_bin_wasm_get_sections | ( | RzBinWasmObj * | bin | ) |
Definition at line 846 of file wasm.c.
References b, bin::buf, consume_str_r(), consume_u32_r(), consume_u7_r(), rz_bin_wasm_section_t::count, free(), rz_bin_wasm_section_t::id, max, rz_bin_wasm_section_t::name, rz_bin_wasm_section_t::name_len, NULL, rz_bin_wasm_section_t::offset, rz_bin_wasm_section_t::payload_data, rz_bin_wasm_section_t::payload_len, RZ_BIN_WASM_SECTION_CODE, RZ_BIN_WASM_SECTION_CUSTOM, RZ_BIN_WASM_SECTION_DATA, RZ_BIN_WASM_SECTION_ELEMENT, RZ_BIN_WASM_SECTION_EXPORT, RZ_BIN_WASM_SECTION_FUNCTION, RZ_BIN_WASM_SECTION_GLOBAL, RZ_BIN_WASM_SECTION_IMPORT, RZ_BIN_WASM_SECTION_MEMORY, RZ_BIN_WASM_SECTION_START, RZ_BIN_WASM_SECTION_TABLE, RZ_BIN_WASM_SECTION_TYPE, RZ_BUF_CUR, rz_buf_seek(), RZ_BUF_SET, rz_buf_size(), rz_buf_tell(), rz_list_append(), rz_list_newf(), RZ_LOG_ERROR, RZ_NEW0, rz_bin_wasm_section_t::size, and ut64().
Referenced by rz_bin_wasm_init(), and sections().
RzList* rz_bin_wasm_get_tables | ( | RzBinWasmObj * | bin | ) |
Definition at line 1072 of file wasm.c.
References NULL, rz_bin_wasm_get_sections_by_id(), rz_bin_wasm_get_table_entries(), RZ_BIN_WASM_SECTION_TABLE, rz_list_first(), rz_list_free(), and rz_list_new().
Referenced by rz_bin_wasm_init().
RzList* rz_bin_wasm_get_types | ( | RzBinWasmObj * | bin | ) |
Definition at line 1049 of file wasm.c.
References NULL, rz_bin_wasm_get_sections_by_id(), rz_bin_wasm_get_type_entries(), RZ_BIN_WASM_SECTION_TYPE, rz_list_first(), rz_list_free(), rz_list_new(), type, and types.
Referenced by rz_bin_wasm_init().
RzBinWasmObj* rz_bin_wasm_init | ( | RzBinFile * | bf, |
RzBuffer * | buf | ||
) |
Definition at line 761 of file wasm.c.
References rz_bin_file_t::buf, bin::buf, NULL, rz_bin_wasm_get_codes(), rz_bin_wasm_get_custom_names(), rz_bin_wasm_get_datas(), rz_bin_wasm_get_entrypoint(), rz_bin_wasm_get_exports(), rz_bin_wasm_get_globals(), rz_bin_wasm_get_imports(), rz_bin_wasm_get_memories(), rz_bin_wasm_get_sections(), rz_bin_wasm_get_tables(), rz_bin_wasm_get_types(), rz_buf_ref(), rz_buf_size(), and RZ_NEW0.
Referenced by load_buffer().
const char* rz_bin_wasm_valuetype_to_string | ( | rz_bin_wasm_value_type_t | type | ) |