Skip to content

Commit

Permalink
Add test case for EVM
Browse files Browse the repository at this point in the history
  • Loading branch information
andelf committed Jan 12, 2025
1 parent bd33d38 commit 49a1352
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/EVM/EVMDisassembler.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ 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;
Expand Down
42 changes: 42 additions & 0 deletions tests/details/evm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,46 @@ test_cases:
pop: 1
fee: 2
groups: [ EVM_GRP_STACK_READ ]
input:
bytes: [ 0x60, 0xe0, 0x1c, 0x59, 0x47, 0xff ]
arch: "evm"
options: [ CS_OPT_DETAIL ]
address: 0x0
expected:
insns:
-
asm_text: "push1 224"
details:
evm:
push: 1
fee: 3
groups: [ EVM_GRP_STACK_WRITE ]
-
asm_text: "shr"
details:
evm:
pop: 2
push: 1
fee: 3
groups: [ EVM_GRP_MATH ]
-
asm_text: "push0"
details:
evm:
push: 1
fee: 3
groups: [ EVM_GRP_STACK_WRITE ]
-
asm_text: "selfbalance"
details:
evm:
push: 1
fee: 5
-
asm_text: "selfdestruct"
details:
evm:
pop: 1
fee: 5000
groups: [ EVM_GRP_HALT ]

0 comments on commit 49a1352

Please sign in to comment.