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
963a1b52d8
commit
f9fe6ca65c
4 changed files with 13 additions and 7 deletions
|
@ -564,9 +564,9 @@ class DALegacy(metaclass=LogBase):
|
|||
else:
|
||||
self.daconfig.da2 = da2[:hashlen] + da2[hashlen:hashlen + da2sig_len]
|
||||
else:
|
||||
self.daconfig.da2 = da2[:-da2sig_len]
|
||||
self.daconfig.da2 = da2
|
||||
else:
|
||||
self.daconfig.da2 = da2[:-da2sig_len]
|
||||
self.daconfig.da2 = da2
|
||||
if self.mtk.preloader.send_da(da1address, da1size, da1sig_len, da1):
|
||||
if self.mtk.preloader.jump_da(da1address):
|
||||
sync = self.usbread(1)
|
||||
|
@ -779,7 +779,6 @@ class DALegacy(metaclass=LogBase):
|
|||
|
||||
def brom_send(self, dasetup, dadata, stage, packetsize=0x1000):
|
||||
# offset = dasetup.da_loader.region[stage].m_buf
|
||||
# dasize = len(dadata)
|
||||
size = dasetup.da_loader.region[stage].m_len
|
||||
address = dasetup.da_loader.region[stage].m_start_addr
|
||||
self.usbwrite(pack(">I", address))
|
||||
|
@ -792,7 +791,7 @@ class DALegacy(metaclass=LogBase):
|
|||
buffer = self.usbread(1)
|
||||
if buffer != self.Rsp.ACK:
|
||||
self.error(
|
||||
f"Error on sending brom stage {stage} addr {hex(pos)}: " + hexlify(buffer).decode('utf-8'))
|
||||
f"Error on sending brom stage {stage} addr {hex(address+pos)}: " + hexlify(buffer).decode('utf-8'))
|
||||
self.config.set_gui_status(self.config.tr("Error on sending brom stage"))
|
||||
break
|
||||
time.sleep(0.5)
|
||||
|
|
|
@ -227,8 +227,8 @@ class legacyext(metaclass=LogBase):
|
|||
base = 0x122000
|
||||
else:
|
||||
base = 0x100000
|
||||
data = b"".join([pack("<I", val) for val in self.readmem(0x111418EC, 0x20000 // 4)])
|
||||
print(data.hex())
|
||||
#data = b"".join([pack("<I", val) for val in self.readmem(0x111418EC, 0x20000 // 4)])
|
||||
#print(data.hex())
|
||||
sys.stdout.flush()
|
||||
if self.config.meid is None:
|
||||
try:
|
||||
|
|
|
@ -104,6 +104,9 @@ class DA_handler(metaclass=LogBase):
|
|||
self.info("Device is in BROM mode. Trying to dump preloader.")
|
||||
if preloader is None:
|
||||
preloader = self.dump_preloader_ram()
|
||||
else:
|
||||
if mtk.config.target_config["sbc"]:
|
||||
self.info("Device is protected.")
|
||||
else:
|
||||
self.info("Device is unprotected.")
|
||||
if mtk.config.is_brom and not mtk.config.iot:
|
||||
|
|
|
@ -200,6 +200,10 @@ class xflashext(metaclass=LogBase):
|
|||
huawei = find_binary(da2, b"\x01\x2B\x03\xD1\x01\x23", pos)
|
||||
if huawei is not None:
|
||||
da2patched[huawei:huawei + 4] = b"\x00\x00\x00\x00"
|
||||
# Patch oppo security mt6765
|
||||
oppo = find_binary(da2, b"\x01\x4B\x18\x78\x70\x47")
|
||||
if oppo is not None:
|
||||
da2patched[oppo:oppo + 4] = b"\x4F\xF0\x01\x00"
|
||||
# Patch oppo security
|
||||
oppo = 0
|
||||
pos = 0
|
||||
|
|
Loading…
Reference in a new issue