Created
January 31, 2022 05:57
-
-
Save morimolymoly/7c640ffa0a43866b16abc2e6ceefc0c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import capstone | |
from capstone import * | |
cs = Cs(CS_ARCH_MIPS, CS_MODE_32 + CS_MODE_BIG_ENDIAN) | |
cs.detail = True | |
print(f"Capstone version: {capstone.__version__}") | |
# 0c1001f5 | |
call_encoding = b'\x0c\x10\x01\xf5' # jal 4007d4 <funcc> | |
for i in cs.disasm(call_encoding, 0): | |
print(f"\n0x{i.address:x}\t{i.mnemonic}\t{i.op_str}\t(Groups: {i.groups})") | |
print(f"Is call? {capstone.CS_GRP_CALL in i.groups}") | |
print(f"Is jump? {capstone.CS_GRP_JUMP in i.groups}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
capstone-engine/capstone#1680