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:
|
else:
|
||||||
self.daconfig.da2 = da2[:hashlen] + da2[hashlen:hashlen + da2sig_len]
|
self.daconfig.da2 = da2[:hashlen] + da2[hashlen:hashlen + da2sig_len]
|
||||||
else:
|
else:
|
||||||
self.daconfig.da2 = da2[:-da2sig_len]
|
self.daconfig.da2 = da2
|
||||||
else:
|
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.send_da(da1address, da1size, da1sig_len, da1):
|
||||||
if self.mtk.preloader.jump_da(da1address):
|
if self.mtk.preloader.jump_da(da1address):
|
||||||
sync = self.usbread(1)
|
sync = self.usbread(1)
|
||||||
|
@ -779,7 +779,6 @@ class DALegacy(metaclass=LogBase):
|
||||||
|
|
||||||
def brom_send(self, dasetup, dadata, stage, packetsize=0x1000):
|
def brom_send(self, dasetup, dadata, stage, packetsize=0x1000):
|
||||||
# offset = dasetup.da_loader.region[stage].m_buf
|
# offset = dasetup.da_loader.region[stage].m_buf
|
||||||
# dasize = len(dadata)
|
|
||||||
size = dasetup.da_loader.region[stage].m_len
|
size = dasetup.da_loader.region[stage].m_len
|
||||||
address = dasetup.da_loader.region[stage].m_start_addr
|
address = dasetup.da_loader.region[stage].m_start_addr
|
||||||
self.usbwrite(pack(">I", address))
|
self.usbwrite(pack(">I", address))
|
||||||
|
@ -792,7 +791,7 @@ class DALegacy(metaclass=LogBase):
|
||||||
buffer = self.usbread(1)
|
buffer = self.usbread(1)
|
||||||
if buffer != self.Rsp.ACK:
|
if buffer != self.Rsp.ACK:
|
||||||
self.error(
|
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"))
|
self.config.set_gui_status(self.config.tr("Error on sending brom stage"))
|
||||||
break
|
break
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
|
|
|
@ -227,8 +227,8 @@ class legacyext(metaclass=LogBase):
|
||||||
base = 0x122000
|
base = 0x122000
|
||||||
else:
|
else:
|
||||||
base = 0x100000
|
base = 0x100000
|
||||||
data = b"".join([pack("<I", val) for val in self.readmem(0x111418EC, 0x20000 // 4)])
|
#data = b"".join([pack("<I", val) for val in self.readmem(0x111418EC, 0x20000 // 4)])
|
||||||
print(data.hex())
|
#print(data.hex())
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
if self.config.meid is None:
|
if self.config.meid is None:
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -105,7 +105,10 @@ class DA_handler(metaclass=LogBase):
|
||||||
if preloader is None:
|
if preloader is None:
|
||||||
preloader = self.dump_preloader_ram()
|
preloader = self.dump_preloader_ram()
|
||||||
else:
|
else:
|
||||||
self.info("Device is unprotected.")
|
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:
|
if mtk.config.is_brom and not mtk.config.iot:
|
||||||
self.info("Device is in BROM-Mode. Bypassing security.")
|
self.info("Device is in BROM-Mode. Bypassing security.")
|
||||||
mtk.daloader.patch = False
|
mtk.daloader.patch = False
|
||||||
|
|
|
@ -200,6 +200,10 @@ class xflashext(metaclass=LogBase):
|
||||||
huawei = find_binary(da2, b"\x01\x2B\x03\xD1\x01\x23", pos)
|
huawei = find_binary(da2, b"\x01\x2B\x03\xD1\x01\x23", pos)
|
||||||
if huawei is not None:
|
if huawei is not None:
|
||||||
da2patched[huawei:huawei + 4] = b"\x00\x00\x00\x00"
|
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
|
# Patch oppo security
|
||||||
oppo = 0
|
oppo = 0
|
||||||
pos = 0
|
pos = 0
|
||||||
|
|
Loading…
Reference in a new issue