()
| 18 | |
| 19 | |
| 20 | def test_class(): |
| 21 | address = 0x80001000 |
| 22 | for (arch, mode, code, comment) in all_tests: |
| 23 | print("Platform: %s" % comment) |
| 24 | print("Code: %s " % code.hex(' ')) |
| 25 | print("Disasm:") |
| 26 | |
| 27 | try: |
| 28 | md = Cs(arch, mode) |
| 29 | md.detail = True |
| 30 | for i in md.disasm(code, address): |
| 31 | print("0x%x:\t%s\t%s" %(i.address, i.mnemonic, i.op_str)) |
| 32 | if i.pop > 0: |
| 33 | print("\tPop: %u" %i.pop) |
| 34 | if i.push > 0: |
| 35 | print("\tPush: %u" %i.push) |
| 36 | if i.fee > 0: |
| 37 | print("\tGas fee: %u" %i.fee) |
| 38 | if len(i.groups) > 0: |
| 39 | print("\tGroups: ", end=''), |
| 40 | for m in i.groups: |
| 41 | print("%s " % i.group_name(m), end=''), |
| 42 | print() |
| 43 | |
| 44 | except CsError as e: |
| 45 | print("ERROR: %s" % e.__str__()) |
| 46 | |
| 47 | |
| 48 | if __name__ == '__main__': |
no test coverage detected
searching dependent graphs…