python: make test_evm.py to output like test_evm.c
This commit is contained in:
parent
64880d2493
commit
ba12645cdc
|
@ -4,11 +4,17 @@
|
|||
|
||||
from __future__ import print_function
|
||||
from capstone import *
|
||||
from xprint import to_hex
|
||||
|
||||
CODE = "\x60\x61\x50"
|
||||
cs = Cs(CS_ARCH_EVM, 0)
|
||||
cs.detail = True
|
||||
|
||||
for i in cs.disasm("\x60\x61\x55", 0x100):
|
||||
print("Platform: EVM")
|
||||
print("Code: %s" %to_hex(CODE))
|
||||
print("Disasm:")
|
||||
|
||||
for i in cs.disasm(CODE, 0x80001000):
|
||||
print("0x%x:\t%s\t%s" %(i.address, i.mnemonic, i.op_str))
|
||||
if i.pop > 0:
|
||||
print("\tPop: %u" %i.pop)
|
||||
|
@ -17,7 +23,7 @@ for i in cs.disasm("\x60\x61\x55", 0x100):
|
|||
if i.fee > 0:
|
||||
print("\tGas fee: %u" %i.fee)
|
||||
if len(i.groups) > 0:
|
||||
print("\tThis instruction belongs to groups: ", end=''),
|
||||
print("\tGroups: ", end=''),
|
||||
for m in i.groups:
|
||||
print("%s " % i.group_name(m), end=''),
|
||||
print()
|
||||
|
|
Loading…
Reference in New Issue