aboutsummaryrefslogtreecommitdiffstats
path: root/capstone/arch/EVM/EVMInstPrinter.c
blob: 7f452800ece5b99c4be84c84bdf08a4055f5f83c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Capstone Disassembly Engine */
/* By Nguyen Anh Quynh, 2018 */

#include "EVMInstPrinter.h"
#include "EVMMapping.h"


void EVM_printInst(MCInst *MI, struct SStream *O, void *PrinterInfo)
{
	SStream_concat(O, EVM_insn_name((csh)MI->csh, MI->Opcode));

	if (MI->Opcode >= EVM_INS_PUSH1 && MI->Opcode <= EVM_INS_PUSH32) {
		unsigned int i;

		SStream_concat0(O, "\t");
		for (i = 0; i < MI->Opcode - EVM_INS_PUSH1 + 1; i++) {
			SStream_concat(O, "%02x", MI->evm_data[i]);
		}
	}
}