• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python
2
3# Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com>
4
5from __future__ import print_function
6from capstone import *
7
8cs = Cs(CS_ARCH_EVM, 0)
9cs.detail = True
10
11for i in cs.disasm("\x60\x61\x55", 0x100):
12    print("0x%x:\t%s\t%s" %(i.address, i.mnemonic, i.op_str))
13    if i.pop > 0:
14        print("\tPop:     %u" %i.pop)
15    if i.push > 0:
16        print("\tPush:    %u" %i.push)
17    if i.fee > 0:
18        print("\tGas fee: %u" %i.fee)
19    if len(i.groups) > 0:
20        print("\tThis instruction belongs to groups: ", end=''),
21        for m in i.groups:
22            print("%s " % i.group_name(m), end=''),
23        print()
24