From b6737a265b2f709d01e38bdaa18a7a4b83d5ec70 Mon Sep 17 00:00:00 2001 From: "info@revskills.de" Date: Sun, 11 Jun 2023 10:43:22 +0200 Subject: [PATCH] Add error codes, fix legacy peek --- mtkclient/Library/error.py | 10 ++++++++++ mtkclient/Library/legacy_ext.py | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/mtkclient/Library/error.py b/mtkclient/Library/error.py index ff1cc12..1307fac 100755 --- a/mtkclient/Library/error.py +++ b/mtkclient/Library/error.py @@ -639,6 +639,16 @@ ErrorCodes_XFlash = { 0xc0020052: "Invalid Partition name", 0xc0020053: "DA version Anti-Rollback error", 0xc0020054: "Invalid msg size", + 0xc0020055: "Security level unsupported", + 0xc0020056: "Security level mismatch", + 0xc0020057: "Fault injection error", + 0xc0020058: "Public Key hash group invalid - too many root keys", + 0xc0020059: "Security level too large", + 0xc002005a: "Security config is formatted", + 0xc002005b: "Security config unknown error", + 0xc002005c: "Lockstate seccfg fail", + 0xc002005d: "Lockstate custom fail", + 0xc002005e: "Lockstate inconsistent", 0xc0030001: "Scatter file invalid", 0xc0030002: "DA file invalid", 0xc0030003: "DA selection error", diff --git a/mtkclient/Library/legacy_ext.py b/mtkclient/Library/legacy_ext.py index 6bd3521..fc4f2d9 100644 --- a/mtkclient/Library/legacy_ext.py +++ b/mtkclient/Library/legacy_ext.py @@ -107,9 +107,9 @@ class legacyext(metaclass=LogBase): dwords=length//4 if length%4!=0: dwords+=1 - #data = bytearray(b"".join(int.to_bytes(val,4,'little') for val in [self.legacy.read_reg32(addr + pos * 4) for pos in range(dwords)])) - res = self.legacy.custom_F0(addr, dwords) - data = bytearray(b"".join([int.to_bytes(val,4,'little') for val in res])) + data = bytearray(b"".join(int.to_bytes(val,4,'little') for val in [self.legacy.read_reg32(addr + pos * 4) for pos in range(dwords)])) + #res = self.legacy.custom_F0(addr, dwords) + #data = bytearray(b"".join([int.to_bytes(val,4,'little') for val in res])) return data[:length] def writeregister(self, addr, dwords):