Rizin
unix-like reverse engineering framework and cli tools
cstool_evm.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <capstone/capstone.h>

Go to the source code of this file.

Functions

void print_string_hex (char *comment, unsigned char *str, size_t len)
 
void print_insn_detail_evm (csh handle, cs_insn *ins)
 

Function Documentation

◆ print_insn_detail_evm()

void print_insn_detail_evm ( csh  handle,
cs_insn *  ins 
)

Definition at line 8 of file cstool_evm.c.

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 }
#define NULL
Definition: cris-opc.c:27
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
Definition: cs_driver.c:93
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

References cs_evm::fee, NULL, cs_evm::pop, printf(), and cs_evm::push.

Referenced by print_details().

◆ print_string_hex()

void print_string_hex ( char *  comment,
unsigned char *  str,
size_t  len 
)