()
| 103 | |
| 104 | # ## Test class Cs |
| 105 | def 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() |
no test coverage detected
searching dependent graphs…