MCPcopy Create free account
hub / github.com/capstone-engine/capstone / test_class

Function test_class

bindings/python/tests/test_basic.py:105–126  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

103
104# ## Test class Cs
105def test_class():
106 for arch, mode, code, comment, syntax in all_tests:
107 print('*' * 16)
108 print("Platform: %s" % comment)
109 print("Code: %s" % code.hex(' '))
110 print("Disasm:")
111
112 try:
113 md = Cs(arch, mode)
114
115 if syntax is not None:
116 md.syntax = syntax
117
118 for insn in md.disasm(code, 0x1000):
119 # bytes = binascii.hexlify(insn.bytes)
120 # print("0x%x:\t%s\t%s\t// hex-code: %s" %(insn.address, insn.mnemonic, insn.op_str, bytes))
121 print("0x%x:\t%s\t%s" % (insn.address, insn.mnemonic, insn.op_str))
122
123 print("0x%x:" % (insn.address + insn.size))
124 print()
125 except CsError as e:
126 print("ERROR: %s" % e)
127
128
129# test_cs_disasm_quick()

Callers 1

test_basic.pyFile · 0.70

Calls 3

disasmMethod · 0.95
CsClass · 0.85
hexMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…