Implement coprocessor register read/write for python bindings

This commit is contained in:
lazymio
2022-02-11 23:03:56 +01:00
parent 89a1da9a33
commit 15f3b58d9b
3 changed files with 100 additions and 2 deletions

View File

@ -64,5 +64,25 @@ def test_arm64():
print("ERROR: %s" % e)
def test_arm64_read_sctlr():
print("Read SCTLR_EL1")
try:
# Initialize emulator in ARM mode
mu = Uc(UC_ARCH_ARM64, UC_MODE_ARM)
# Read SCTLR_EL1
# crn = 1;
# crm = 0;
# op0 = 3;
# op1 = 0;
# op2 = 0;
val = mu.reg_read(UC_ARM64_REG_CP_REG, (1, 0, 3, 0, 0))
print(">>> SCTLR_EL1 = 0x%x" % val)
except UcError as e:
print("ERROR: %s" % e)
if __name__ == '__main__':
test_arm64()
print("=" * 26)
test_arm64_read_sctlr()