aboutsummaryrefslogtreecommitdiffstats
path: root/capstone/cstool/cstool_evm.c
diff options
context:
space:
mode:
Diffstat (limited to 'capstone/cstool/cstool_evm.c')
-rw-r--r--capstone/cstool/cstool_evm.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/capstone/cstool/cstool_evm.c b/capstone/cstool/cstool_evm.c
new file mode 100644
index 000000000..d3ecb5c34
--- /dev/null
+++ b/capstone/cstool/cstool_evm.c
@@ -0,0 +1,26 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <capstone/capstone.h>
+
+void print_insn_detail_evm(csh handle, cs_insn *ins);
+
+void print_insn_detail_evm(csh handle, cs_insn *ins)
+{
+ cs_evm *evm;
+
+ // detail can be NULL on "data" instruction if SKIPDATA option is turned ON
+ if (ins->detail == NULL)
+ return;
+
+ evm = &(ins->detail->evm);
+
+ if (evm->pop)
+ printf("\tPop: %u\n", evm->pop);
+
+ if (evm->push)
+ printf("\tPush: %u\n", evm->push);
+
+ if (evm->fee)
+ printf("\tGas fee: %u\n", evm->fee);
+}