-
-
Notifications
You must be signed in to change notification settings - Fork 380
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split
RzAnalysisOpType
in a different file
* This way, files like `librz/util/print.c` and `Colors.cpp` in Cutter don't need to include the entire `rz_analysis.h`, but only need to include `rz_analysis_optype.h`
- Loading branch information
Showing
8 changed files
with
97 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#ifndef RZ_ANALYSIS_OPTYPE_H | ||
#define RZ_ANALYSIS_OPTYPE_H | ||
|
||
// XXX: this definition is plain wrong. use enum or empower bits | ||
#define RZ_ANALYSIS_OP_TYPE_MASK 0x8000ffff | ||
#define RZ_ANALYSIS_OP_HINT_MASK 0xf0000000 | ||
|
||
typedef enum { | ||
RZ_ANALYSIS_OP_TYPE_COND = 0x80000000, // TODO must be moved to prefix? | ||
// TODO: MOVE TO PREFIX .. it is used by analysis_java.. must be updated | ||
RZ_ANALYSIS_OP_TYPE_REP = 0x40000000, /* repeats next instruction N times */ | ||
RZ_ANALYSIS_OP_TYPE_MEM = 0x20000000, // TODO must be moved to prefix? | ||
RZ_ANALYSIS_OP_TYPE_REG = 0x10000000, // operand is a register | ||
RZ_ANALYSIS_OP_TYPE_IND = 0x08000000, // operand is indirect | ||
RZ_ANALYSIS_OP_TYPE_SIMD = 0x04000000, // SIMD | ||
RZ_ANALYSIS_OP_TYPE_NULL = 0, | ||
RZ_ANALYSIS_OP_TYPE_JMP = 1, /* mandatory jump */ | ||
RZ_ANALYSIS_OP_TYPE_UJMP = 2, /* unknown jump (register or so) */ | ||
RZ_ANALYSIS_OP_TYPE_RJMP = RZ_ANALYSIS_OP_TYPE_REG | RZ_ANALYSIS_OP_TYPE_UJMP, | ||
RZ_ANALYSIS_OP_TYPE_IJMP = RZ_ANALYSIS_OP_TYPE_IND | RZ_ANALYSIS_OP_TYPE_UJMP, | ||
RZ_ANALYSIS_OP_TYPE_IRJMP = RZ_ANALYSIS_OP_TYPE_IND | RZ_ANALYSIS_OP_TYPE_REG | RZ_ANALYSIS_OP_TYPE_UJMP, | ||
RZ_ANALYSIS_OP_TYPE_CJMP = RZ_ANALYSIS_OP_TYPE_COND | RZ_ANALYSIS_OP_TYPE_JMP, /* conditional jump */ | ||
RZ_ANALYSIS_OP_TYPE_RCJMP = RZ_ANALYSIS_OP_TYPE_REG | RZ_ANALYSIS_OP_TYPE_CJMP, /* conditional jump register */ | ||
RZ_ANALYSIS_OP_TYPE_MJMP = RZ_ANALYSIS_OP_TYPE_MEM | RZ_ANALYSIS_OP_TYPE_JMP, /* memory jump */ | ||
RZ_ANALYSIS_OP_TYPE_MCJMP = RZ_ANALYSIS_OP_TYPE_MEM | RZ_ANALYSIS_OP_TYPE_CJMP, /* memory conditional jump */ | ||
RZ_ANALYSIS_OP_TYPE_UCJMP = RZ_ANALYSIS_OP_TYPE_COND | RZ_ANALYSIS_OP_TYPE_UJMP, /* conditional unknown jump */ | ||
RZ_ANALYSIS_OP_TYPE_CALL = 3, /* call to subroutine (branch+link) */ | ||
RZ_ANALYSIS_OP_TYPE_UCALL = 4, /* unknown call (register or so) */ | ||
RZ_ANALYSIS_OP_TYPE_RCALL = RZ_ANALYSIS_OP_TYPE_REG | RZ_ANALYSIS_OP_TYPE_UCALL, | ||
RZ_ANALYSIS_OP_TYPE_ICALL = RZ_ANALYSIS_OP_TYPE_IND | RZ_ANALYSIS_OP_TYPE_UCALL, | ||
RZ_ANALYSIS_OP_TYPE_IRCALL = RZ_ANALYSIS_OP_TYPE_IND | RZ_ANALYSIS_OP_TYPE_REG | RZ_ANALYSIS_OP_TYPE_UCALL, | ||
RZ_ANALYSIS_OP_TYPE_CCALL = RZ_ANALYSIS_OP_TYPE_COND | RZ_ANALYSIS_OP_TYPE_CALL, /* conditional call to subroutine */ | ||
RZ_ANALYSIS_OP_TYPE_UCCALL = RZ_ANALYSIS_OP_TYPE_COND | RZ_ANALYSIS_OP_TYPE_UCALL, /* conditional unknown call */ | ||
RZ_ANALYSIS_OP_TYPE_RET = 5, /* returns from subroutine */ | ||
RZ_ANALYSIS_OP_TYPE_CRET = RZ_ANALYSIS_OP_TYPE_COND | RZ_ANALYSIS_OP_TYPE_RET, /* conditional return from subroutine */ | ||
RZ_ANALYSIS_OP_TYPE_ILL = 6, /* illegal instruction // trap */ | ||
RZ_ANALYSIS_OP_TYPE_UNK = 7, /* unknown opcode type */ | ||
RZ_ANALYSIS_OP_TYPE_NOP = 8, /* does nothing */ | ||
RZ_ANALYSIS_OP_TYPE_MOV = 9, /* register move */ | ||
RZ_ANALYSIS_OP_TYPE_CMOV = 9 | RZ_ANALYSIS_OP_TYPE_COND, /* conditional move */ | ||
RZ_ANALYSIS_OP_TYPE_TRAP = 10, /* it's a trap! */ | ||
RZ_ANALYSIS_OP_TYPE_SWI = 11, /* syscall, software interrupt */ | ||
RZ_ANALYSIS_OP_TYPE_CSWI = 11 | RZ_ANALYSIS_OP_TYPE_COND, /* syscall, software interrupt */ | ||
RZ_ANALYSIS_OP_TYPE_UPUSH = 12, /* unknown push of data into stack */ | ||
RZ_ANALYSIS_OP_TYPE_RPUSH = RZ_ANALYSIS_OP_TYPE_UPUSH | RZ_ANALYSIS_OP_TYPE_REG, /* push register */ | ||
RZ_ANALYSIS_OP_TYPE_PUSH = 13, /* push value into stack */ | ||
RZ_ANALYSIS_OP_TYPE_POP = 14, /* pop value from stack to register */ | ||
RZ_ANALYSIS_OP_TYPE_CMP = 15, /* compare something */ | ||
RZ_ANALYSIS_OP_TYPE_ACMP = 16, /* compare via and */ | ||
RZ_ANALYSIS_OP_TYPE_ADD = 17, | ||
RZ_ANALYSIS_OP_TYPE_SUB = 18, | ||
RZ_ANALYSIS_OP_TYPE_IO = 19, | ||
RZ_ANALYSIS_OP_TYPE_MUL = 20, | ||
RZ_ANALYSIS_OP_TYPE_DIV = 21, | ||
RZ_ANALYSIS_OP_TYPE_SHR = 22, | ||
RZ_ANALYSIS_OP_TYPE_SHL = 23, | ||
RZ_ANALYSIS_OP_TYPE_SAL = 24, | ||
RZ_ANALYSIS_OP_TYPE_SAR = 25, | ||
RZ_ANALYSIS_OP_TYPE_OR = 26, | ||
RZ_ANALYSIS_OP_TYPE_AND = 27, | ||
RZ_ANALYSIS_OP_TYPE_XOR = 28, | ||
RZ_ANALYSIS_OP_TYPE_NOR = 29, | ||
RZ_ANALYSIS_OP_TYPE_NOT = 30, | ||
RZ_ANALYSIS_OP_TYPE_STORE = 31, /* store from register to memory */ | ||
RZ_ANALYSIS_OP_TYPE_LOAD = 32, /* load from memory to register */ | ||
RZ_ANALYSIS_OP_TYPE_LEA = 33, /* TODO add ulea */ | ||
RZ_ANALYSIS_OP_TYPE_LEAVE = 34, | ||
RZ_ANALYSIS_OP_TYPE_ROR = 35, | ||
RZ_ANALYSIS_OP_TYPE_ROL = 36, | ||
RZ_ANALYSIS_OP_TYPE_XCHG = 37, | ||
RZ_ANALYSIS_OP_TYPE_MOD = 38, | ||
RZ_ANALYSIS_OP_TYPE_SWITCH = 39, | ||
RZ_ANALYSIS_OP_TYPE_CASE = 40, | ||
RZ_ANALYSIS_OP_TYPE_LENGTH = 41, | ||
RZ_ANALYSIS_OP_TYPE_CAST = 42, | ||
RZ_ANALYSIS_OP_TYPE_NEW = 43, | ||
RZ_ANALYSIS_OP_TYPE_ABS = 44, | ||
RZ_ANALYSIS_OP_TYPE_CPL = 45, /* complement */ | ||
RZ_ANALYSIS_OP_TYPE_CRYPTO = 46, | ||
RZ_ANALYSIS_OP_TYPE_SYNC = 47, | ||
// RZ_ANALYSIS_OP_TYPE_DEBUG = 43, // monitor/trace/breakpoint | ||
#if 0 | ||
RZ_ANALYSIS_OP_TYPE_PRIV = 40, /* privileged instruction */ | ||
RZ_ANALYSIS_OP_TYPE_FPU = 41, /* floating point stuff */ | ||
#endif | ||
} RzAnalysisOpType; | ||
|
||
#endif // RZ_ANALYSIS_OPTYPE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters