Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions archinfo/arch_aarch64.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ def __init__(self, endness=Endness.LE):
instruction_endness = Endness.LE
sizeof = {"short": 16, "int": 32, "long": 64, "long long": 64}
if _capstone:
if hasattr(_capstone, "CS_ARCH_AARCH64"):
cs_arch = _capstone.CS_ARCH_AARCH64
else:
cs_arch = _capstone.CS_ARCH_ARM64
cs_arch = _capstone.CS_ARCH_AARCH64
cs_mode = _capstone.CS_MODE_LITTLE_ENDIAN
if _keystone:
ks_arch = _keystone.KS_ARCH_ARM64
Expand Down
6 changes: 4 additions & 2 deletions archinfo/arch_riscv64.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ def __init__(self, endness=Endness.LE):
register_endness = Endness.LE
instruction_endness = Endness.LE
sizeof = {"short": 16, "int": 32, "long": 64, "long long": 64}
if _capstone and hasattr(_capstone, "CS_ARCH_RISCV"):
if _capstone:
cs_arch = _capstone.CS_ARCH_RISCV
cs_mode = _capstone.CS_MODE_RISCV64 | _capstone.CS_MODE_RISCVC
cs_mode = _capstone.CS_MODE_RISCV64 | getattr(
_capstone, "CS_MODE_RISCVC", getattr(_capstone, "CS_MODE_RISCV_C", 0)
)
# if _keystone:
# ks_arch = _keystone.KS_ARCH_RISCV
# ks_mode = _keystone.KS_MODE_LITTLE_ENDIAN
Expand Down
5 changes: 1 addition & 4 deletions archinfo/arch_s390x.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ def __init__(self, endness=Endness.BE):
initial_sp = 0x40000000000
sizeof = {"short": 16, "int": 32, "long": 64, "long long": 64}
if _capstone:
if hasattr(_capstone, "CS_ARCH_SYSTEMZ"):
cs_arch = _capstone.CS_ARCH_SYSTEMZ
else:
cs_arch = _capstone.CS_ARCH_SYSZ
cs_arch = _capstone.CS_ARCH_SYSTEMZ
cs_mode = _capstone.CS_MODE_BIG_ENDIAN
if _keystone:
ks_arch = _keystone.KS_ARCH_SYSTEMZ
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ Homepage = "https://api.angr.io/projects/archinfo/en/latest/"
Repository = "https://github.com/angr/archinfo"

[project.optional-dependencies]
capstone = [
"capstone>=6.0.0a1",
]
pcode = [
"pypcode~=4.0",
]
Expand Down
Loading