#include <stdio.h>
#include <stdlib.h>
#include <capstone/platform.h>
#include <capstone/capstone.h>
Go to the source code of this file.
◆ EVM_CODE
#define EVM_CODE "\x60\x61\x50" |
◆ main()
◆ print_insn_detail()
static void print_insn_detail |
( |
csh |
cs_handle, |
|
|
cs_insn * |
ins |
|
) |
| |
|
static |
Definition at line 32 of file test_evm.c.
37 if (ins->detail ==
NULL)
40 evm = &(ins->detail->evm);
51 if (ins->detail->groups_count) {
55 for(j = 0; j < ins->detail->groups_count; j++) {
CAPSTONE_EXPORT const char *CAPSTONE_API cs_group_name(csh ud, unsigned int group)
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
unsigned int fee
gas fee for the instruction
unsigned char push
number of items pushed into the stack
unsigned char pop
number of items popped from the stack
References cs_group_name(), cs_evm::fee, handle, NULL, cs_evm::pop, printf(), and cs_evm::push.
Referenced by test().
◆ print_string_hex()
◆ test()
Definition at line 62 of file test_evm.c.
64 #define EVM_CODE "\x60\x61\x50"
84 printf(
"Failed on cs_open() with error returned: %u\n",
err);
93 printf(
"****************\n");
98 for (j = 0; j <
count; j++) {
107 printf(
"****************\n");
110 printf(
"ERROR: Failed to disasm given code!\n");
@ CS_ARCH_EVM
Ethereum architecture.
@ CS_OPT_DETAIL
Break down instruction structure into details.
@ CS_OPT_ON
Turn ON an option (CS_OPT_DETAIL, CS_OPT_SKIPDATA).
CAPSTONE_EXPORT size_t CAPSTONE_API cs_disasm(csh ud, const uint8_t *buffer, size_t size, uint64_t offset, size_t count, cs_insn **insn)
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_open(cs_arch arch, cs_mode mode, csh *handle)
CAPSTONE_EXPORT void CAPSTONE_API cs_free(cs_insn *insn, size_t count)
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_close(csh *handle)
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_option(csh ud, cs_opt_type type, size_t value)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
struct platform platforms[]
static void print_string_hex(const char *comment, unsigned char *str, size_t len)
static void print_insn_detail(csh cs_handle, cs_insn *ins)
References arch, platform::comment, count, CS_ARCH_EVM, cs_close(), cs_disasm(), cs_free(), cs_open(), CS_OPT_DETAIL, CS_OPT_ON, cs_option(), err, EVM_CODE, handle, i, platforms, print_insn_detail(), print_string_hex(), printf(), and PRIx64.
Referenced by main().
◆ handle