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>
Go to the source code of this file.
Macros | |
#define | X_OP(i) (((i) >> 30) & 0x3) |
#define | X_OP2(i) (((i) >> 22) & 0x7) |
#define | X_OP3(i) (((i) >> 19) & 0x3f) |
#define | X_COND(i) (((i) >> 25) & 0x1f) |
#define | X_RD(i) (((i) >> 25) & 0x1f) |
#define | X_RS1(i) (((i) >> 14) & 0x1f) |
#define | X_LDST_I(i) (((i) >> 13) & 1) |
#define | X_ASI(i) (((i) >> 5) & 0xff) |
#define | X_RS2(i) (((i) >> 0) & 0x1f) |
#define | X_IMM(i, n) (((i) >> 0) & ((1 << (n)) - 1)) |
#define | X_SIMM(i, n) SIGN_EXT(X_IMM((i), (n)), (n)) |
#define | X_DISP22(i) (((i) >> 0) & 0x3fffff) |
#define | X_IMM22(i) X_DISP22(i) |
#define | X_DISP30(i) (((i) >> 0) & 0x3fffffff) |
#define | X_DISP16(i) (((((i) >> 20) & 3) << 14) | (((i) >> 0) & 0x3fff)) |
#define | X_DISP19(i) (((i) >> 0) & 0x7ffff) |
#define | X_MEMBAR(i) ((i)&0x7f) |
Enumerations | |
enum | { GPR_G0 = 0 , GPR_G1 = 1 , GPR_G2 = 2 , GPR_G3 = 3 , GPR_G4 = 4 , GPR_G5 = 5 , GPR_G6 = 6 , GPR_G7 = 7 , GPR_O0 = 8 , GPR_O1 = 9 , GPR_O2 = 10 , GPR_O3 = 11 , GPR_O4 = 12 , GPR_O5 = 13 , GPR_O6 = 14 , GPR_O7 = 15 , GPR_L0 = 16 , GPR_L1 = 17 , GPR_L2 = 18 , GPR_L3 = 19 , GPR_L4 = 20 , GPR_L5 = 21 , GPR_L6 = 22 , GPR_L7 = 23 , GPR_I0 = 24 , GPR_I1 = 25 , GPR_I2 = 26 , GPR_I3 = 27 , GPR_I4 = 28 , GPR_I5 = 29 , GPR_I6 = 30 , GPR_I7 = 31 } |
enum | { ICC_A = 0x8 , ICC_CC = 0xd , ICC_CS = 0x5 , ICC_E = 0x1 , ICC_G = 0xa , ICC_GE = 0xb , ICC_GU = 0xc , ICC_L = 0x3 , ICC_LE = 0x2 , ICC_LEU = 0x4 , ICC_N = 0x0 , ICC_NE = 0x9 , ICC_NEG = 0x6 , ICC_POS = 0xe , ICC_VC = 0xf , ICC_VS = 0x7 } |
enum | { FCC_A = 0x8 , FCC_E = 0x9 , FCC_G = 0x6 , FCC_GE = 0xb , FCC_L = 0x4 , FCC_LE = 0xd , FCC_LG = 0x2 , FCC_N = 0x0 , FCC_NE = 0x1 , FCC_O = 0xf , FCC_U = 0x7 , FCC_UE = 0xa , FCC_UG = 0x5 , FCC_UGE = 0xc , FCC_UL = 0x3 , FCC_ULE = 0xe } |
enum | { RZ_TYPE_COND_ALWAYS = -1 , RZ_TYPE_COND_NEVER = -2 , RZ_TYPE_COND_UNKNOWN = -3 } |
enum | { OP_0 = 0 , OP_1 = 1 , OP_2 = 2 , OP_3 = 3 } |
enum | { OP2_ILLTRAP = 0 , OP2_BPcc = 1 , OP2_Bicc = 2 , OP2_BPr = 3 , OP2_SETHI = 4 , OP2_FBPfcc = 5 , OP2_FBfcc = 6 , OP2_INV = 7 } |
enum | { OP32_ADD = 0x00 , OP32_ADDcc = 0x10 , OP32_TADDcc = 0x20 , OP32_WRY = 0x30 , OP32_AND = 0x01 , OP32_ANDcc = 0x11 , OP32_TSUBcc = 0x21 , OP32_SAVED = 0x31 , OP32_OR = 0x02 , OP32_ORcc = 0x12 , OP32_TADDccTV = 0x22 , OP32_WRPR = 0x32 , OP32_XOR = 0x03 , OP32_XORcc = 0x13 , OP32_TSUBccTV = 0x23 , OP32_SUB = 0x04 , OP32_SUBcc = 0x14 , OP32_MULSccD = 0x24 , OP32_FPop1 = 0x34 , OP32_ANDN = 0x05 , OP32_ANDNcc = 0x15 , OP32_SLL = 0x25 , OP32_FPop2 = 0x35 , OP32_ORN = 0x06 , OP32_ORNcc = 0x16 , OP32_SRL = 0x26 , OP32_XNOR = 0x07 , OP32_XNORcc = 0x17 , OP32_SRA = 0x27 , OP32_ADDC = 0x08 , OP32_ADDCcc = 0x18 , OP32_RDY = 0x28 , OP32_JMPL = 0x38 , OP32_MULX = 0x09 , OP32_RETURN = 0x39 , OP32_UMUL = 0x0a , OP32_UMULcc = 0x1a , OP32_RDPR = 0x2a , OP32_Tcc = 0x3a , OP32_SMULD = 0x0b , OP32_SMULcc = 0x1b , OP32_FLUSHW = 0x2b , OP32_FLUSH = 0x3b , OP32_SUBC = 0x0c , OP32_SUBCcc = 0x1c , OP32_MOVcc = 0x2c , OP32_SAVE = 0x3c , OP32_UDIVX = 0x0d , OP32_SDIVX = 0x2d , OP32_RESTORE = 0x3d , OP32_UDIV = 0x0e , OP32_UDIVcc = 0x1e , OP32_POPC = 0x2e , OP32_DONE = 0x3e , OP32_SDIV = 0x0f , OP32_SDIVcc = 0x1f , OP32_MOVr = 0x2f , OP32_INV1 = 0x33 , OP32_INV2 = 0x19 , OP32_INV3 = 0x29 , OP32_INV4 = 0x1d , OP32_INV5 = 0x3f , OP32_CONDINV1 = 0x30 , OP32_CONDINV2 = 0x28 , OP32_CONDINV3 = 0x2e } |
enum | { OP33_INV1 = 0x31 , OP33_INV2 = 0x35 , OP33_INV3 = 0x28 , OP33_INV4 = 0x38 , OP33_INV5 = 0x29 , OP33_INV6 = 0x39 , OP33_INV7 = 0x2a , OP33_INV8 = 0x3a , OP33_INV9 = 0x2b , OP33_INV10 = 0x3b , OP33_INV11 = 0x0c , OP33_INV12 = 0x1c , OP33_INV13 = 0x2c , OP33_INV14 = 0x2e , OP33_INV15 = 0x2f , OP33_INV16 = 0x3f } |
Functions | |
static int | icc_to_r_cond (const int cond) |
static int | fcc_to_r_cond (const int cond) |
static st64 | get_immed_sgnext (const ut64 insn, const ut8 nbit) |
static RzAnalysisValue * | value_fill_addr_pc_disp (const ut64 addr, const st64 disp) |
static RzAnalysisValue * | value_fill_addr_reg_regdelta (RzAnalysis const *const analysis, const int ireg, const int iregdelta) |
static RzAnalysisValue * | value_fill_addr_reg_disp (RzAnalysis const *const analysis, const int ireg, const st64 disp) |
static void | analysis_call (RzAnalysisOp *op, const ut32 insn, const ut64 addr) |
static void | analysis_jmpl (RzAnalysis const *const analysis, RzAnalysisOp *op, const ut32 insn, const ut64 addr) |
static void | analysis_branch (RzAnalysisOp *op, const ut32 insn, const ut64 addr) |
static int | sparc_op (RzAnalysis *analysis, RzAnalysisOp *op, ut64 addr, const ut8 *data, int len, RzAnalysisOpMask mask) |
static char * | get_reg_profile (RzAnalysis *analysis) |
static int | archinfo (RzAnalysis *analysis, int q) |
Variables | |
const char * | gpr_regs [] |
RzAnalysisPlugin | rz_analysis_plugin_sparc_gnu |
RZ_API RzLibStruct | rizin_plugin |
Definition at line 151 of file analysis_sparc_gnu.c.
Definition at line 146 of file analysis_sparc_gnu.c.
Definition at line 160 of file analysis_sparc_gnu.c.
Definition at line 161 of file analysis_sparc_gnu.c.
Definition at line 155 of file analysis_sparc_gnu.c.
Definition at line 157 of file analysis_sparc_gnu.c.
Definition at line 153 of file analysis_sparc_gnu.c.
Definition at line 156 of file analysis_sparc_gnu.c.
Definition at line 150 of file analysis_sparc_gnu.c.
Definition at line 162 of file analysis_sparc_gnu.c.
Definition at line 143 of file analysis_sparc_gnu.c.
Definition at line 144 of file analysis_sparc_gnu.c.
Definition at line 145 of file analysis_sparc_gnu.c.
Definition at line 148 of file analysis_sparc_gnu.c.
Definition at line 149 of file analysis_sparc_gnu.c.
Definition at line 152 of file analysis_sparc_gnu.c.
Definition at line 154 of file analysis_sparc_gnu.c.
anonymous enum |
Definition at line 11 of file analysis_sparc_gnu.c.
anonymous enum |
Enumerator | |
---|---|
ICC_A | |
ICC_CC | |
ICC_CS | |
ICC_E | |
ICC_G | |
ICC_GE | |
ICC_GU | |
ICC_L | |
ICC_LE | |
ICC_LEU | |
ICC_N | |
ICC_NE | |
ICC_NEG | |
ICC_POS | |
ICC_VC | |
ICC_VS |
Definition at line 51 of file analysis_sparc_gnu.c.
anonymous enum |
Enumerator | |
---|---|
FCC_A | |
FCC_E | |
FCC_G | |
FCC_GE | |
FCC_L | |
FCC_LE | |
FCC_LG | |
FCC_N | |
FCC_NE | |
FCC_O | |
FCC_U | |
FCC_UE | |
FCC_UG | |
FCC_UGE | |
FCC_UL | |
FCC_ULE |
Definition at line 70 of file analysis_sparc_gnu.c.
anonymous enum |
Enumerator | |
---|---|
RZ_TYPE_COND_ALWAYS | |
RZ_TYPE_COND_NEVER | |
RZ_TYPE_COND_UNKNOWN |
Definition at line 91 of file analysis_sparc_gnu.c.
anonymous enum |
anonymous enum |
Enumerator | |
---|---|
OP2_ILLTRAP | |
OP2_BPcc | |
OP2_Bicc | |
OP2_BPr | |
OP2_SETHI | |
OP2_FBPfcc | |
OP2_FBfcc | |
OP2_INV |
Definition at line 171 of file analysis_sparc_gnu.c.
anonymous enum |
Definition at line 182 of file analysis_sparc_gnu.c.
anonymous enum |
Enumerator | |
---|---|
OP33_INV1 | |
OP33_INV2 | |
OP33_INV3 | |
OP33_INV4 | |
OP33_INV5 | |
OP33_INV6 | |
OP33_INV7 | |
OP33_INV8 | |
OP33_INV9 | |
OP33_INV10 | |
OP33_INV11 | |
OP33_INV12 | |
OP33_INV13 | |
OP33_INV14 | |
OP33_INV15 | |
OP33_INV16 |
Definition at line 253 of file analysis_sparc_gnu.c.
|
static |
Definition at line 330 of file analysis_sparc_gnu.c.
References addr, fcc_to_r_cond(), get_immed_sgnext(), icc_to_r_cond(), OP2_Bicc, OP2_BPcc, OP2_BPr, OP2_FBfcc, OP2_FBPfcc, RZ_ANALYSIS_OP_TYPE_CJMP, RZ_ANALYSIS_OP_TYPE_JMP, RZ_ANALYSIS_OP_TYPE_NOP, RZ_TYPE_COND_ALWAYS, RZ_TYPE_COND_NEVER, RZ_TYPE_COND_UNKNOWN, st64, value_fill_addr_pc_disp(), X_COND, X_DISP16, and X_OP2.
Referenced by sparc_op().
|
static |
Definition at line 297 of file analysis_sparc_gnu.c.
References addr, get_immed_sgnext(), RZ_ANALYSIS_OP_TYPE_CALL, st64, and value_fill_addr_pc_disp().
Referenced by sparc_op().
|
static |
Definition at line 305 of file analysis_sparc_gnu.c.
References addr, get_immed_sgnext(), GPR_G0, GPR_I7, GPR_O7, RZ_ANALYSIS_OP_TYPE_RET, RZ_ANALYSIS_OP_TYPE_UCALL, RZ_ANALYSIS_OP_TYPE_UJMP, st64, value_fill_addr_reg_disp(), value_fill_addr_reg_regdelta(), X_LDST_I, X_RD, X_RS1, and X_RS2.
Referenced by sparc_op().
|
static |
Definition at line 600 of file analysis_sparc_gnu.c.
Definition at line 120 of file analysis_sparc_gnu.c.
References cond, FCC_A, FCC_E, FCC_G, FCC_GE, FCC_L, FCC_LE, FCC_LG, FCC_N, FCC_NE, FCC_O, FCC_U, FCC_UE, FCC_UG, FCC_UGE, FCC_UL, FCC_ULE, RZ_TYPE_COND_ALWAYS, RZ_TYPE_COND_EQ, RZ_TYPE_COND_GE, RZ_TYPE_COND_GT, RZ_TYPE_COND_LE, RZ_TYPE_COND_LT, RZ_TYPE_COND_NE, RZ_TYPE_COND_NEVER, and RZ_TYPE_COND_UNKNOWN.
Referenced by analysis_branch().
Definition at line 272 of file analysis_sparc_gnu.c.
References mask, st64, and ut64().
Referenced by analysis_branch(), analysis_call(), and analysis_jmpl().
|
static |
Definition at line 461 of file analysis_sparc_gnu.c.
Definition at line 97 of file analysis_sparc_gnu.c.
References cond, ICC_A, ICC_CC, ICC_CS, ICC_E, ICC_G, ICC_GE, ICC_GU, ICC_L, ICC_LE, ICC_LEU, ICC_N, ICC_NE, ICC_NEG, ICC_POS, ICC_VC, ICC_VS, RZ_TYPE_COND_ALWAYS, RZ_TYPE_COND_EQ, RZ_TYPE_COND_GE, RZ_TYPE_COND_GT, RZ_TYPE_COND_LE, RZ_TYPE_COND_LT, RZ_TYPE_COND_NE, RZ_TYPE_COND_NEVER, and RZ_TYPE_COND_UNKNOWN.
Referenced by analysis_branch().
|
static |
Definition at line 367 of file analysis_sparc_gnu.c.
References addr, analysis_branch(), analysis_call(), analysis_jmpl(), rz_analysis_t::big_endian, memcpy(), OP2_Bicc, OP2_BPcc, OP2_BPr, OP2_FBfcc, OP2_FBPfcc, OP2_ILLTRAP, OP2_INV, OP32_CONDINV1, OP32_CONDINV2, OP32_CONDINV3, OP32_INV1, OP32_INV2, OP32_INV3, OP32_INV4, OP32_INV5, OP32_JMPL, OP33_INV1, OP33_INV10, OP33_INV11, OP33_INV12, OP33_INV13, OP33_INV14, OP33_INV15, OP33_INV16, OP33_INV2, OP33_INV3, OP33_INV4, OP33_INV5, OP33_INV6, OP33_INV7, OP33_INV8, OP33_INV9, OP_0, OP_1, OP_2, OP_3, RZ_ANALYSIS_OP_FAMILY_CPU, RZ_ANALYSIS_OP_TYPE_ILL, X_OP, X_OP2, X_OP3, X_RD, and X_RS1.
|
static |
Definition at line 277 of file analysis_sparc_gnu.c.
References addr, rz_analysis_value_new(), and val.
Referenced by analysis_branch(), and analysis_call().
|
static |
Definition at line 290 of file analysis_sparc_gnu.c.
References gpr_regs, rz_analysis_t::reg, rz_analysis_value_new(), rz_reg_get(), RZ_REG_TYPE_GPR, and val.
Referenced by analysis_jmpl().
|
static |
Definition at line 283 of file analysis_sparc_gnu.c.
References gpr_regs, rz_analysis_t::reg, rz_analysis_value_new(), rz_reg_get(), RZ_REG_TYPE_GPR, and val.
Referenced by analysis_jmpl().
const char* gpr_regs[] |
Definition at line 46 of file analysis_sparc_gnu.c.
Referenced by value_fill_addr_reg_disp(), and value_fill_addr_reg_regdelta().
RZ_API RzLibStruct rizin_plugin |
Definition at line 616 of file analysis_sparc_gnu.c.
RzAnalysisPlugin rz_analysis_plugin_sparc_gnu |
Definition at line 604 of file analysis_sparc_gnu.c.