Merge commit '16a2cf3873e00fa08e587d1b05c9132d98c24f50' into back-to-imgui

This commit is contained in:
irisz64
2025-06-26 22:15:44 +02:00
876 changed files with 168071 additions and 411897 deletions

View File

@@ -1,5 +1,6 @@
/* Capstone Disassembly Engine */
/* By Nguyen Anh Quynh, 2018 */
/* By Andelf, 2025 */
#include <string.h>
#include <stddef.h> // offsetof macro
@@ -36,9 +37,9 @@ static const short opcodes[256] = {
EVM_INS_XOR,
EVM_INS_NOT,
EVM_INS_BYTE,
-1,
-1,
-1,
EVM_INS_SHL,
EVM_INS_SHR,
EVM_INS_SAR,
-1,
-1,
EVM_INS_SHA3,
@@ -79,11 +80,11 @@ static const short opcodes[256] = {
EVM_INS_NUMBER,
EVM_INS_DIFFICULTY,
EVM_INS_GASLIMIT,
-1,
-1,
-1,
-1,
-1,
EVM_INS_CHAINID,
EVM_INS_SELFBALANCE,
EVM_INS_BASEFEE,
EVM_INS_BLOBHASH,
EVM_INS_BLOBBASEFEE,
-1,
-1,
-1,
@@ -101,10 +102,10 @@ static const short opcodes[256] = {
EVM_INS_MSIZE,
EVM_INS_GAS,
EVM_INS_JUMPDEST,
-1,
-1,
-1,
-1,
EVM_INS_TLOAD,
EVM_INS_TSTORE,
EVM_INS_MCOPY,
EVM_INS_PUSH0,
EVM_INS_PUSH1,
EVM_INS_PUSH2,
EVM_INS_PUSH3,
@@ -254,7 +255,7 @@ static const short opcodes[256] = {
EVM_INS_CALLCODE,
EVM_INS_RETURN,
EVM_INS_DELEGATECALL,
EVM_INS_CALLBLACKBOX,
EVM_INS_CREATE2,
-1,
-1,
-1,
@@ -264,7 +265,7 @@ static const short opcodes[256] = {
-1,
EVM_INS_REVERT,
-1,
EVM_INS_SUICIDE,
EVM_INS_SELFDESTRUCT,
};
bool EVM_getInstruction(csh ud, const uint8_t *code, size_t code_len,
@@ -326,6 +327,9 @@ bool EVM_getInstruction(csh ud, const uint8_t *code, size_t code_len,
case EVM_INS_MULMOD:
case EVM_INS_EXP:
case EVM_INS_SIGNEXTEND:
case EVM_INS_SHL:
case EVM_INS_SHR:
case EVM_INS_SAR:
MI->flat_insn->detail->groups[MI->flat_insn->detail->groups_count] = EVM_GRP_MATH;
MI->flat_insn->detail->groups_count++;
break;
@@ -335,6 +339,7 @@ bool EVM_getInstruction(csh ud, const uint8_t *code, size_t code_len,
case EVM_INS_CALLDATACOPY:
case EVM_INS_CODECOPY:
case EVM_INS_EXTCODECOPY:
case EVM_INS_MCOPY:
MI->flat_insn->detail->groups[MI->flat_insn->detail->groups_count] = EVM_GRP_MEM_WRITE;
MI->flat_insn->detail->groups_count++;
break;
@@ -346,16 +351,19 @@ bool EVM_getInstruction(csh ud, const uint8_t *code, size_t code_len,
case EVM_INS_RETURN:
case EVM_INS_DELEGATECALL:
case EVM_INS_REVERT:
case EVM_INS_CREATE2:
MI->flat_insn->detail->groups[MI->flat_insn->detail->groups_count] = EVM_GRP_MEM_READ;
MI->flat_insn->detail->groups_count++;
break;
case EVM_INS_SSTORE:
case EVM_INS_TSTORE:
MI->flat_insn->detail->groups[MI->flat_insn->detail->groups_count] = EVM_GRP_STORE_WRITE;
MI->flat_insn->detail->groups_count++;
break;
case EVM_INS_SLOAD:
case EVM_INS_TLOAD:
MI->flat_insn->detail->groups[MI->flat_insn->detail->groups_count] = EVM_GRP_STORE_READ;
MI->flat_insn->detail->groups_count++;
break;
@@ -367,7 +375,7 @@ bool EVM_getInstruction(csh ud, const uint8_t *code, size_t code_len,
break;
case EVM_INS_STOP:
case EVM_INS_SUICIDE:
case EVM_INS_SELFDESTRUCT:
MI->flat_insn->detail->groups[MI->flat_insn->detail->groups_count] = EVM_GRP_HALT;
MI->flat_insn->detail->groups_count++;
break;