Seregon/Hermes

Hermes/Dyforge is a program written in c++ allows you to inject a dll that can analyze all processes in a program, can be used for mod and reverse engeneering

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