Rizin
unix-like reverse engineering framework and cli tools
evm.h
Go to the documentation of this file.
1 #ifndef CAPSTONE_EVM_H
2 #define CAPSTONE_EVM_H
3 
4 /* Capstone Disassembly Engine */
5 /* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2018 */
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 
11 #include "platform.h"
12 
13 #ifdef _MSC_VER
14 #pragma warning(disable:4201)
15 #endif
16 
18 typedef struct cs_evm {
19  unsigned char pop;
20  unsigned char push;
21  unsigned int fee;
23 
25 typedef enum evm_insn {
38  EVM_INS_LT = 16,
39  EVM_INS_GT = 17,
42  EVM_INS_EQ = 20,
45  EVM_INS_OR = 23,
79  EVM_INS_PC = 88,
161 
163  EVM_INS_ENDING, // <-- mark the end of the list of instructions
165 
167 typedef enum evm_insn_group {
169 
171 
180 
183 
184 #ifdef __cplusplus
185 }
186 #endif
187 
188 #endif
evm_insn
EVM instruction.
Definition: evm.h:25
@ EVM_INS_DUP12
Definition: evm.h:126
@ EVM_INS_AND
Definition: evm.h:44
@ EVM_INS_DUP14
Definition: evm.h:128
@ EVM_INS_CALLDATASIZE
Definition: evm.h:56
@ EVM_INS_PUSH11
Definition: evm.h:93
@ EVM_INS_PUSH12
Definition: evm.h:94
@ EVM_INS_PUSH15
Definition: evm.h:97
@ EVM_INS_DIV
Definition: evm.h:30
@ EVM_INS_CODECOPY
Definition: evm.h:59
@ EVM_INS_SLOAD
Definition: evm.h:75
@ EVM_INS_DUP11
Definition: evm.h:125
@ EVM_INS_RETURNDATACOPY
Definition: evm.h:64
@ EVM_INS_CALLDATALOAD
Definition: evm.h:55
@ EVM_INS_PUSH7
Definition: evm.h:89
@ EVM_INS_CALL
Definition: evm.h:153
@ EVM_INS_PUSH21
Definition: evm.h:103
@ EVM_INS_CALLBLACKBOX
Definition: evm.h:157
@ EVM_INS_MLOAD
Definition: evm.h:72
@ EVM_INS_SMOD
Definition: evm.h:33
@ EVM_INS_DUP1
Definition: evm.h:115
@ EVM_INS_MUL
Definition: evm.h:28
@ EVM_INS_PUSH13
Definition: evm.h:95
@ EVM_INS_PUSH9
Definition: evm.h:91
@ EVM_INS_PUSH5
Definition: evm.h:87
@ EVM_INS_DUP5
Definition: evm.h:119
@ EVM_INS_GT
Definition: evm.h:39
@ EVM_INS_COINBASE
Definition: evm.h:66
@ EVM_INS_GASPRICE
Definition: evm.h:60
@ EVM_INS_DELEGATECALL
Definition: evm.h:156
@ EVM_INS_LOG2
Definition: evm.h:149
@ EVM_INS_SWAP12
Definition: evm.h:142
@ EVM_INS_PUSH30
Definition: evm.h:112
@ EVM_INS_SWAP3
Definition: evm.h:133
@ EVM_INS_PUSH17
Definition: evm.h:99
@ EVM_INS_INVALID
Definition: evm.h:162
@ EVM_INS_RETURN
Definition: evm.h:155
@ EVM_INS_ADDMOD
Definition: evm.h:34
@ EVM_INS_ISZERO
Definition: evm.h:43
@ EVM_INS_STATICCALL
Definition: evm.h:158
@ EVM_INS_MSIZE
Definition: evm.h:80
@ EVM_INS_SWAP7
Definition: evm.h:137
@ EVM_INS_SWAP11
Definition: evm.h:141
@ EVM_INS_PUSH16
Definition: evm.h:98
@ EVM_INS_SSTORE
Definition: evm.h:76
@ EVM_INS_PUSH25
Definition: evm.h:107
@ EVM_INS_PUSH20
Definition: evm.h:102
@ EVM_INS_ADDRESS
Definition: evm.h:50
@ EVM_INS_CALLDATACOPY
Definition: evm.h:57
@ EVM_INS_GAS
Definition: evm.h:81
@ EVM_INS_DUP3
Definition: evm.h:117
@ EVM_INS_ADD
Definition: evm.h:27
@ EVM_INS_PUSH1
Definition: evm.h:83
@ EVM_INS_CALLVALUE
Definition: evm.h:54
@ EVM_INS_DUP9
Definition: evm.h:123
@ EVM_INS_PUSH3
Definition: evm.h:85
@ EVM_INS_PUSH18
Definition: evm.h:100
@ EVM_INS_PUSH24
Definition: evm.h:106
@ EVM_INS_TIMESTAMP
Definition: evm.h:67
@ EVM_INS_ENDING
Definition: evm.h:163
@ EVM_INS_DUP15
Definition: evm.h:129
@ EVM_INS_DUP13
Definition: evm.h:127
@ EVM_INS_SWAP8
Definition: evm.h:138
@ EVM_INS_PUSH19
Definition: evm.h:101
@ EVM_INS_POP
Definition: evm.h:71
@ EVM_INS_MSTORE8
Definition: evm.h:74
@ EVM_INS_ORIGIN
Definition: evm.h:52
@ EVM_INS_DUP4
Definition: evm.h:118
@ EVM_INS_SLT
Definition: evm.h:40
@ EVM_INS_EXP
Definition: evm.h:36
@ EVM_INS_RETURNDATASIZE
Definition: evm.h:63
@ EVM_INS_GASLIMIT
Definition: evm.h:70
@ EVM_INS_SUB
Definition: evm.h:29
@ EVM_INS_SWAP4
Definition: evm.h:134
@ EVM_INS_NOT
Definition: evm.h:47
@ EVM_INS_SWAP10
Definition: evm.h:140
@ EVM_INS_SWAP13
Definition: evm.h:143
@ EVM_INS_CALLER
Definition: evm.h:53
@ EVM_INS_DUP10
Definition: evm.h:124
@ EVM_INS_PUSH4
Definition: evm.h:86
@ EVM_INS_PUSH31
Definition: evm.h:113
@ EVM_INS_PUSH26
Definition: evm.h:108
@ EVM_INS_MULMOD
Definition: evm.h:35
@ EVM_INS_SWAP6
Definition: evm.h:136
@ EVM_INS_DUP7
Definition: evm.h:121
@ EVM_INS_PUSH2
Definition: evm.h:84
@ EVM_INS_OR
Definition: evm.h:45
@ EVM_INS_PUSH32
Definition: evm.h:114
@ EVM_INS_LOG0
Definition: evm.h:147
@ EVM_INS_PUSH29
Definition: evm.h:111
@ EVM_INS_DIFFICULTY
Definition: evm.h:69
@ EVM_INS_BYTE
Definition: evm.h:48
@ EVM_INS_EQ
Definition: evm.h:42
@ EVM_INS_EXTCODECOPY
Definition: evm.h:62
@ EVM_INS_PUSH23
Definition: evm.h:105
@ EVM_INS_STOP
Definition: evm.h:26
@ EVM_INS_SWAP9
Definition: evm.h:139
@ EVM_INS_PUSH22
Definition: evm.h:104
@ EVM_INS_CREATE
Definition: evm.h:152
@ EVM_INS_REVERT
Definition: evm.h:159
@ EVM_INS_MSTORE
Definition: evm.h:73
@ EVM_INS_PUSH10
Definition: evm.h:92
@ EVM_INS_SGT
Definition: evm.h:41
@ EVM_INS_LOG1
Definition: evm.h:148
@ EVM_INS_LOG4
Definition: evm.h:151
@ EVM_INS_CALLCODE
Definition: evm.h:154
@ EVM_INS_JUMP
Definition: evm.h:77
@ EVM_INS_EXTCODESIZE
Definition: evm.h:61
@ EVM_INS_SWAP5
Definition: evm.h:135
@ EVM_INS_DUP8
Definition: evm.h:122
@ EVM_INS_DUP6
Definition: evm.h:120
@ EVM_INS_SDIV
Definition: evm.h:31
@ EVM_INS_SIGNEXTEND
Definition: evm.h:37
@ EVM_INS_DUP16
Definition: evm.h:130
@ EVM_INS_SHA3
Definition: evm.h:49
@ EVM_INS_PUSH6
Definition: evm.h:88
@ EVM_INS_BLOCKHASH
Definition: evm.h:65
@ EVM_INS_NUMBER
Definition: evm.h:68
@ EVM_INS_MOD
Definition: evm.h:32
@ EVM_INS_XOR
Definition: evm.h:46
@ EVM_INS_JUMPI
Definition: evm.h:78
@ EVM_INS_DUP2
Definition: evm.h:116
@ EVM_INS_SWAP1
Definition: evm.h:131
@ EVM_INS_JUMPDEST
Definition: evm.h:82
@ EVM_INS_PC
Definition: evm.h:79
@ EVM_INS_SWAP14
Definition: evm.h:144
@ EVM_INS_SUICIDE
Definition: evm.h:160
@ EVM_INS_PUSH28
Definition: evm.h:110
@ EVM_INS_SWAP2
Definition: evm.h:132
@ EVM_INS_PUSH14
Definition: evm.h:96
@ EVM_INS_SWAP15
Definition: evm.h:145
@ EVM_INS_LT
Definition: evm.h:38
@ EVM_INS_BALANCE
Definition: evm.h:51
@ EVM_INS_CODESIZE
Definition: evm.h:58
@ EVM_INS_PUSH27
Definition: evm.h:109
@ EVM_INS_LOG3
Definition: evm.h:150
@ EVM_INS_PUSH8
Definition: evm.h:90
@ EVM_INS_SWAP16
Definition: evm.h:146
struct cs_evm cs_evm
Instruction structure.
evm_insn_group
Group of EVM instructions.
Definition: evm.h:167
@ EVM_GRP_MATH
math instructions
Definition: evm.h:172
@ EVM_GRP_STORE_READ
instructions read from storage
Definition: evm.h:178
@ EVM_GRP_STACK_WRITE
instructions write to stack
Definition: evm.h:173
@ EVM_GRP_JUMP
all jump instructions
Definition: evm.h:170
@ EVM_GRP_MEM_WRITE
instructions write to memory
Definition: evm.h:175
@ EVM_GRP_MEM_READ
instructions read from memory
Definition: evm.h:176
@ EVM_GRP_ENDING
<– mark the end of the list of groups
Definition: evm.h:181
@ EVM_GRP_INVALID
= CS_GRP_INVALID
Definition: evm.h:168
@ EVM_GRP_STACK_READ
instructions read from stack
Definition: evm.h:174
@ EVM_GRP_HALT
instructions halt execution
Definition: evm.h:179
@ EVM_GRP_STORE_WRITE
instructions write to storage
Definition: evm.h:177
Instruction structure.
Definition: evm.h:18
unsigned int fee
gas fee for the instruction
Definition: evm.h:21
unsigned char push
number of items pushed into the stack
Definition: evm.h:20
unsigned char pop
number of items popped from the stack
Definition: evm.h:19