Fix MT6768 BROM USB handshake and interface selection (0e8d:0003) - #264
Fix MT6768 BROM USB handshake and interface selection (0e8d:0003)#264chinmayabansal wants to merge 2 commits into
Conversation
- usb_ids: use interface 1 for PID 0x0003 (bulk endpoints on CDC data iface) - Port: accept same-byte handshake echo over USB (MT6768 BROM command mode) - mtk_da_handler: init preloader when USB device already connected in BROM - exploit_handler: surface exception details on payload send failure Tested: Lenovo Tab M9 TB310XU (MT6768, HW 0x707), sudo python3 mtk.py e frp
Keeps the error message string on failure; stack trace only with --debugmode.
|
Re Pushed a follow-up commit — stack trace now goes through Happy to adjust further if you prefer a different logging pattern. |
|
I don't think I can add this patch, as it would break a lot of other devices. Can you please explain why you did the changes the way you did ? because some of them do not even make sense (connect is happening after connected state is checked - thus will never work) |
|
At this point nake it it's own thing like how it is with the Redmi 13c |
|
Thanks for the review. Re the Other fixes (TB310XU / MT6768, HW
Verified with Happy to gate |
| @@ -1,5 +1,5 @@ | |||
| default_ids = { | |||
| 0x0E8D: {0x0003: -1, # MTK Brom | |||
| 0x0E8D: {0x0003: 1, # MTK Brom - interface 1 has bulk endpoints (interface 0 is CDC comm/control only) | |||
| step = self.mtk.step | ||
| mtk.preloader.dump_internal_flash(offset=offset,length=length,step=step,filename="internal_flash.bin") | ||
| else: | ||
| if mtk.serialportname is not None: |
There was a problem hiding this comment.
This is also critical, why remove it ?
|
at this state of the PR, I cannot merge it right now. I took parts of your PR and integrated it in the upcoming version. Will keep this as draft for now. Once you tested it with your device, I will merge this and add credits to you :) |
|
Thanks for taking parts of this into the upcoming version — and for the notes on When the draft or next release is ready to try, I’ll re-test |
Summary
Fixes BROM communication for MediaTek MT6768 (Helio P65/G85) over USB CDC when the device enumerates as
0e8d:0003.Problems fixed
0x0003used interface-1(auto); auto-select picked CDC comm interface 0 (interrupt only, no bulk). Bulk endpoints are on interface 1.Handshake failed, retrying...).preloader.init()was skipped →Please disconnect, start mtkclient and reconnect.AttributeErrorwhen--serialportwas used).Test device
0x707Setup/Linux/, ModemManager maskedsudo python3 mtk.py e frp0x1508000, device boots to setup wizard without account lockNotes
--serialport(Kamakiri2 requires USBctrl_transfer).Checklist