Repository: bkerler/mtkclient

Issue #758: MT6789 da2 patching results in TypeError / Support for newer V6 / bootrom patched based devices (MT68xx/MT69xx)
Created: 2023-08-18T07:08:03Z
I see 81694c4 at least may be relevant, I ran mtkclient from commit 4549fdc. Let me know if I can help in any way. The device is a Gigaset GX4
$ mtk printgpt
MTK Flash/Exploit Client V1.6.3 (c) B.Kerler 2018-2023

Preloader - Status: Waiting for PreLoader VCOM, please connect mobile

Port - Hint:

Power off the phone before connecting.
For brom mode, press and hold vol up, vol dwn, or all hw buttons and connect usb.
For preloader mode, don't press any hw button and connect usb.
If it is already connected and on, hold power for 10 seconds to reset.


Port - Device detected :)
Preloader - 	CPU:			MT6789(MTK Helio G99)
Preloader - 	HW version:		0x0
Preloader - 	WDT:			0x10007000
Preloader - 	Uart:			0x11002000
Preloader - 	Brom payload addr:	0x100a00
Preloader - 	DA payload addr:	0x201000
Preloader - 	Var1:			0xa
Preloader - Disabling Watchdog...
Preloader - HW code:			0x1208
Preloader - Target config:		0x0
Preloader - 	SBC enabled:		False
Preloader - 	SLA enabled:		False
Preloader - 	DAA enabled:		False
Preloader - 	SWJTAG enabled:		False
Preloader - 	EPP_PARAM at 0x600 after EMMC_BOOT/SDMMC_BOOT:	False
Preloader - 	Root cert required:	False
Preloader - 	Mem read auth:		False
Preloader - 	Mem write auth:		False
Preloader - 	Cmd 0xC8 blocked:	False
Preloader - Get Target info
Preloader - 	HW subcode:		0x8a00
Preloader - 	HW Ver:			0xca00
Preloader - 	SW Ver:			0x0
DA_handler - Device is unprotected.
DA_handler - Device is in Preloader-Mode :(
DAXFlash - Uploading xflash stage 1 from MTK_AllInOne_DA_mt6789.bin
xflashext - Patching da1 ...
Mtk - Patched "Patched loader msg" in preloader
xflashext
xflashext - [LIB]: Error on patching da1 version check...
Mtk - Patched "Patched loader msg" in preloader
xflashext - Patching da2 ...
Traceback (most recent call last):
  File "/usr/bin/mtk", line 855, in <module>
    mtk = Main(args).run(parser)
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mtkclient/Library/mtk_main.py", line 635, in run
    mtk = da_handler.configure_da(mtk, preloader)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mtkclient/Library/mtk_da_cmd.py", line 119, in configure_da
    if not mtk.daloader.upload_da(preloader=preloader):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mtkclient/Library/mtk_daloader.py", line 211, in upload_da
    return self.da.upload_da()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mtkclient/Library/mtk_daxflash.py", line 1170, in upload_da
    if self.upload():
       ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mtkclient/Library/mtk_daxflash.py", line 1092, in upload
    da2 = self.xft.patch_da2(da2)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mtkclient/Library/xflash_ext.py", line 193, in patch_da2
    da2patched[is_security_enabled:is_security_enabled + 2] = b"\x00\x23"
                                   ~~~~~~~~~~~~~~~~~~~~^~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

Duplicate issue #577: Support for flash boot img for mt 6895 (dimencity 8100)
Created: 2022-12-23T16:12:24Z
Sir,
My device is redmi k50i ...
I've flashed twrp over wrong kernel which doesn't support the twrp...& Now my device is in boot loop on twrp logo , no fastboot no nothing
Now i need to flash the boot img to get my device working...
If i cant bypass it now for mtk high security issues...atleast can u plz add support for this please😢
0x1172: chipconfig(
var1=0xA,
watchdog=0x1c007000,
uart=0x11001000,
brom_payload_addr=0x100A00,
da_payload_addr=0x201000,
pl_payload_addr=0x40200000,
gcpu_base=0x10050000,
dxcc_base=0x10210000,
sej_base=0x1000a000,
cqdma_base=0x10212000,
ap_dma_mem=0x11300800 + 0x1a0,
#blacklist=[(0x102848, 0x0), (0x00106B60, 0x0)],
#blacklist_count=0x0000000A,
#send_ptr=(0x102888, 0xE79C),
#ctrl_buffer=0x00102A9C,
#cmd_handler=0x0000F569,
#brom_register_access=(0xeba4, 0xec5c),
#meid_addr=0x102B98,
#socid_addr=0x102BA8,
#prov_addr=0x1066C0,
damode=damodes.XFLASH,
dacode=0x6895,
name="MT6895",
description="Dimensity 8100"

Closing comment (2023-10-14T11:14:26Z): duplicate of #758