Rizin
unix-like reverse engineering framework and cli tools
cstool_evm.c
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <stdlib.h>
3 
4 #include <capstone/capstone.h>
5 
6 void print_string_hex(char *comment, unsigned char *str, size_t len);
7 
8 void print_insn_detail_evm(csh handle, cs_insn *ins)
9 {
10  cs_evm *evm;
11 
12  // detail can be NULL on "data" instruction if SKIPDATA option is turned ON
13  if (ins->detail == NULL)
14  return;
15 
16  evm = &(ins->detail->evm);
17 
18  if (evm->pop)
19  printf("\tPop: %u\n", evm->pop);
20 
21  if (evm->push)
22  printf("\tPush: %u\n", evm->push);
23 
24  if (evm->fee)
25  printf("\tGas fee: %u\n", evm->fee);
26 }
size_t len
Definition: 6502dis.c:15
static mcore_handle handle
Definition: asm_mcore.c:8
size_t csh
Definition: capstone.h:71
#define NULL
Definition: cris-opc.c:27
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
Definition: cs_driver.c:93
void print_string_hex(char *comment, unsigned char *str, size_t len)
void print_insn_detail_evm(csh handle, cs_insn *ins)
Definition: cstool_evm.c:8
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