mirror of
https://github.com/bkerler/mtkclient.git
synced 2024-11-14 19:25:05 -05:00
Minor fixes
This commit is contained in:
parent
98e8f4cca0
commit
79662e4ad0
2 changed files with 7 additions and 4 deletions
|
@ -390,6 +390,8 @@ class usb_class(DeviceClass):
|
|||
def usbread(self, resplen=None, maxtimeout=10):
|
||||
if maxtimeout == 0:
|
||||
timeout = 10
|
||||
else:
|
||||
timeout = maxtimeout
|
||||
if resplen is None:
|
||||
resplen = self.maxsize
|
||||
if resplen <= 0:
|
||||
|
|
|
@ -39,8 +39,8 @@ class Mtk(metaclass=LogBase):
|
|||
("A3687BB12846", "0123A3602846"), # oppo security
|
||||
("B3F5807F01D1", "B3F5807F01D14FF000004FF000007047"), # confirmed : mt6739 c30, mt6833
|
||||
("B3F5807F04BF4FF4807305F011B84FF0FF307047", "B3F5807F04BF4FF480734FF000004FF000007047"),
|
||||
("10B50C680268","10B5012010BD") # Ram blacklist
|
||||
]
|
||||
|
||||
i = 0
|
||||
for patchval in patches:
|
||||
pattern = bytes.fromhex(patchval[0])
|
||||
|
@ -52,9 +52,10 @@ class Mtk(metaclass=LogBase):
|
|||
# break
|
||||
i += 1
|
||||
if patched:
|
||||
# with open(sys.argv[1]+".patched","wb") as wf:
|
||||
# wf.write(data)
|
||||
# print("Patched !")
|
||||
import sys
|
||||
with open(sys.argv[1]+".patched","wb") as wf:
|
||||
wf.write(data)
|
||||
print("Patched !")
|
||||
self.info(f"Patched preloader security: {hex(i)}")
|
||||
else:
|
||||
self.warning(f"Failed to patch preloader security")
|
||||
|
|
Loading…
Reference in a new issue