Rizin
unix-like reverse engineering framework and cli tools
|
#include <string.h>
#include <rz_types.h>
#include <rz_lib.h>
#include <rz_asm.h>
#include <rz_analysis.h>
#include "../../bin/format/wasm/wasm.h"
#include "../../asm/arch/wasm/wasm.c"
Go to the source code of this file.
Macros | |
#define | RZ_IPI static |
#define | WASM_NO_ASM |
#define | WASM_STACK_SIZE 256 |
Functions | |
static ut64 | get_cf_offset (RzAnalysis *analysis, const ut8 *data, int len) |
static bool | advance_till_scope_end (RzAnalysis *analysis, RzAnalysisOp *op, ut64 address, ut32 expected_type, ut32 depth, bool use_else) |
static int | wasm_op (RzAnalysis *analysis, RzAnalysisOp *op, ut64 addr, const ut8 *data, int len, RzAnalysisOpMask mask) |
static int | archinfo (RzAnalysis *a, int q) |
static char * | get_reg_profile (RzAnalysis *analysis) |
Variables | |
static ut64 | scope_hint = UT64_MAX |
static ut64 | addr_old = UT64_MAX |
RzAnalysisPlugin | rz_analysis_plugin_wasm |
RZ_API RzLibStruct | rizin_plugin |
#define RZ_IPI static |
Definition at line 11 of file analysis_wasm.c.
#define WASM_NO_ASM |
Definition at line 12 of file analysis_wasm.c.
#define WASM_STACK_SIZE 256 |
Definition at line 16 of file analysis_wasm.c.
|
static |
Definition at line 41 of file analysis_wasm.c.
References test_evm::end, rz_io_bind_t::io, rz_analysis_t::iob, rz_io_bind_t::read_at, wasm_dis(), WASM_OP_BLOCK, WASM_OP_ELSE, WASM_OP_END, WASM_OP_IF, WASM_OP_LOOP, WASM_OP_TRAP, and WASM_TYPE_OP_CORE.
Referenced by wasm_op().
|
static |
Definition at line 438 of file analysis_wasm.c.
|
static |
Definition at line 22 of file analysis_wasm.c.
References rz_core_bind_t::cmdstrf, rz_core_bind_t::core, rz_analysis_t::coreb, free(), len, n, NULL, read_u32_leb128(), rz_cons_pop(), rz_cons_push(), rz_num_get(), s, ut64(), and UT64_MAX.
Referenced by wasm_op().
|
static |
Definition at line 442 of file analysis_wasm.c.
References strdup().
|
static |
Definition at line 77 of file analysis_wasm.c.
References addr, addr_old, advance_till_scope_end(), WasmOp::atomic, WasmOp::core, free(), get_cf_offset(), rz_analysis_hint_t::jump, len, NULL, WasmOp::op, rz_analysis_hint_t::opcode, PFMT64x, read_u32_leb128(), rz_analysis_hint_del(), rz_analysis_hint_free(), rz_analysis_hint_get(), rz_analysis_hint_set_jump(), rz_analysis_hint_set_opcode(), RZ_ANALYSIS_OP_TYPE_ADD, RZ_ANALYSIS_OP_TYPE_AND, RZ_ANALYSIS_OP_TYPE_CALL, RZ_ANALYSIS_OP_TYPE_CJMP, RZ_ANALYSIS_OP_TYPE_CMP, RZ_ANALYSIS_OP_TYPE_CRET, RZ_ANALYSIS_OP_TYPE_ILL, RZ_ANALYSIS_OP_TYPE_JMP, RZ_ANALYSIS_OP_TYPE_LOAD, RZ_ANALYSIS_OP_TYPE_MOD, RZ_ANALYSIS_OP_TYPE_MOV, RZ_ANALYSIS_OP_TYPE_NOP, RZ_ANALYSIS_OP_TYPE_OR, RZ_ANALYSIS_OP_TYPE_RET, RZ_ANALYSIS_OP_TYPE_STORE, RZ_ANALYSIS_OP_TYPE_SUB, RZ_ANALYSIS_OP_TYPE_UNK, RZ_ANALYSIS_OP_TYPE_XCHG, RZ_ANALYSIS_OP_TYPE_XOR, RZ_LOG_ERROR, rz_strbuf_setf(), scope_hint, WasmOp::txt, WasmOp::type, UT64_MAX, val, wasm_dis(), WASM_OP_BLOCK, WASM_OP_BR, WASM_OP_BRIF, WASM_OP_CALL, WASM_OP_CALLINDIRECT, WASM_OP_ELSE, WASM_OP_END, WASM_OP_F32ADD, WASM_OP_F32CONST, WASM_OP_F32EQ, WASM_OP_F32GE, WASM_OP_F32GT, WASM_OP_F32LE, WASM_OP_F32LOAD, WASM_OP_F32LT, WASM_OP_F32NE, WASM_OP_F32SUB, WASM_OP_F64ADD, WASM_OP_F64CONST, WASM_OP_F64EQ, WASM_OP_F64GE, WASM_OP_F64GT, WASM_OP_F64LE, WASM_OP_F64LOAD, WASM_OP_F64LT, WASM_OP_F64NE, WASM_OP_F64SUB, WASM_OP_GETLOCAL, WASM_OP_I32ADD, WASM_OP_I32ATOMICLOAD, WASM_OP_I32ATOMICLOAD16U, WASM_OP_I32ATOMICLOAD8U, WASM_OP_I32ATOMICRMW16UADD, WASM_OP_I32ATOMICRMW16UAND, WASM_OP_I32ATOMICRMW16UOR, WASM_OP_I32ATOMICRMW16USUB, WASM_OP_I32ATOMICRMW16UXCHG, WASM_OP_I32ATOMICRMW16UXOR, WASM_OP_I32ATOMICRMW8UADD, WASM_OP_I32ATOMICRMW8UAND, WASM_OP_I32ATOMICRMW8UOR, WASM_OP_I32ATOMICRMW8USUB, WASM_OP_I32ATOMICRMW8UXCHG, WASM_OP_I32ATOMICRMW8UXOR, WASM_OP_I32ATOMICRMWADD, WASM_OP_I32ATOMICRMWAND, WASM_OP_I32ATOMICRMWOR, WASM_OP_I32ATOMICRMWSUB, WASM_OP_I32ATOMICRMWXCHG, WASM_OP_I32ATOMICRMWXOR, WASM_OP_I32ATOMICSTORE, WASM_OP_I32ATOMICSTORE16, WASM_OP_I32ATOMICSTORE8, WASM_OP_I32CONST, WASM_OP_I32EQ, WASM_OP_I32EQZ, WASM_OP_I32GES, WASM_OP_I32GEU, WASM_OP_I32GTS, WASM_OP_I32GTU, WASM_OP_I32LES, WASM_OP_I32LEU, WASM_OP_I32LOAD, WASM_OP_I32LOAD16S, WASM_OP_I32LOAD16U, WASM_OP_I32LOAD8S, WASM_OP_I32LOAD8U, WASM_OP_I32LTS, WASM_OP_I32LTU, WASM_OP_I32NE, WASM_OP_I32OR, WASM_OP_I32REMS, WASM_OP_I32REMU, WASM_OP_I32SUB, WASM_OP_I32XOR, WASM_OP_I64ADD, WASM_OP_I64ATOMICLOAD, WASM_OP_I64ATOMICLOAD16U, WASM_OP_I64ATOMICLOAD32U, WASM_OP_I64ATOMICLOAD8U, WASM_OP_I64ATOMICRMW16UADD, WASM_OP_I64ATOMICRMW16UAND, WASM_OP_I64ATOMICRMW16UOR, WASM_OP_I64ATOMICRMW16USUB, WASM_OP_I64ATOMICRMW16UXCHG, WASM_OP_I64ATOMICRMW16UXOR, WASM_OP_I64ATOMICRMW32UADD, WASM_OP_I64ATOMICRMW32UAND, WASM_OP_I64ATOMICRMW32UOR, WASM_OP_I64ATOMICRMW32USUB, WASM_OP_I64ATOMICRMW32UXCHG, WASM_OP_I64ATOMICRMW32UXOR, WASM_OP_I64ATOMICRMW8UADD, WASM_OP_I64ATOMICRMW8UAND, WASM_OP_I64ATOMICRMW8UOR, WASM_OP_I64ATOMICRMW8USUB, WASM_OP_I64ATOMICRMW8UXCHG, WASM_OP_I64ATOMICRMW8UXOR, WASM_OP_I64ATOMICRMWADD, WASM_OP_I64ATOMICRMWAND, WASM_OP_I64ATOMICRMWOR, WASM_OP_I64ATOMICRMWSUB, WASM_OP_I64ATOMICRMWXCHG, WASM_OP_I64ATOMICRMWXOR, WASM_OP_I64ATOMICSTORE, WASM_OP_I64ATOMICSTORE16, WASM_OP_I64ATOMICSTORE32, WASM_OP_I64ATOMICSTORE8, WASM_OP_I64CONST, WASM_OP_I64EQ, WASM_OP_I64EQZ, WASM_OP_I64GES, WASM_OP_I64GEU, WASM_OP_I64GTS, WASM_OP_I64GTU, WASM_OP_I64LES, WASM_OP_I64LEU, WASM_OP_I64LOAD, WASM_OP_I64LOAD16S, WASM_OP_I64LOAD16U, WASM_OP_I64LOAD32S, WASM_OP_I64LOAD32U, WASM_OP_I64LOAD8S, WASM_OP_I64LOAD8U, WASM_OP_I64LTS, WASM_OP_I64LTU, WASM_OP_I64NE, WASM_OP_I64OR, WASM_OP_I64SUB, WASM_OP_I64XOR, WASM_OP_IF, WASM_OP_LOOP, WASM_OP_NOP, WASM_OP_RETURN, WASM_OP_SETLOCAL, WASM_OP_TEELOCAL, WASM_TYPE_OP_ATOMIC, WASM_TYPE_OP_CORE, and WASM_TYPE_OP_SIMD.
Definition at line 19 of file analysis_wasm.c.
Referenced by wasm_op().
RZ_API RzLibStruct rizin_plugin |
Definition at line 467 of file analysis_wasm.c.
RzAnalysisPlugin rz_analysis_plugin_wasm |
Definition at line 454 of file analysis_wasm.c.
Definition at line 18 of file analysis_wasm.c.
Referenced by wasm_op().