Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usb.core.USBError: [Errno 5] Input/Output Error with disconnected battery #63

Open
saper opened this issue Nov 11, 2021 · 0 comments
Open

Comments

@saper
Copy link

saper commented Nov 11, 2021

Running bypass utility commit 87a2541 and exploits_collection at MTK-bypass/exploits_collection@5efcfbb

Because sometimes trying to flash the device (Xiaomi Redmi 9 aka lancelot) in the unusable state (USB device does not get recognized at all), I have tried to disconnect the internal battery.

Without battery, the python tool behaves as follows:

(venv) PS D:\mtk\bypass_utility> python .\main.py
[2021-11-11 02:37:20.201729] Waiting for device
[2021-11-11 02:37:35.653905] Found device = 0e8d:0003

[2021-11-11 02:37:36.444424] Device hw code: 0x707
[2021-11-11 02:37:36.492641] Device hw sub code: 0x8a00
[2021-11-11 02:37:36.515264] Device hw version: 0xca00
[2021-11-11 02:37:36.530893] Device sw version: 0x0
[2021-11-11 02:37:36.546514] Device secure boot: True
[2021-11-11 02:37:36.562134] Device serial link authorization: True
[2021-11-11 02:37:36.577761] Device download agent authorization: True

[2021-11-11 02:37:36.624635] Disabling watchdog timer
Traceback (most recent call last):
  File "D:\mtk\bypass_utility\main.py", line 237, in <module>
    main()
  File "D:\mtk\bypass_utility\main.py", line 49, in main
    device.write32(config.watchdog_address, 0x22000064)
  File "D:\mtk\bypass_utility\src\device.py", line 234, in write32
    self.echo(0xD4)
  File "D:\mtk\bypass_utility\src\device.py", line 175, in echo
    self.write(words, size)
  File "D:\mtk\bypass_utility\src\device.py", line 226, in write
    self.ep_out.write(data[offset:][:self.ep_out.wMaxPacketSize if len(data) - offset > self.ep_out.wMaxPacketSize else len(data) - offset], self.timeout * 1000)
  File "D:\mtk\venv\lib\site-packages\usb\core.py", line 408, in write
    return self.device.write(self, data, timeout)
  File "D:\mtk\venv\lib\site-packages\usb\core.py", line 989, in write
    return fn(
  File "D:\mtk\venv\lib\site-packages\usb\backend\libusb1.py", line 837, in bulk_write
    return self.__write(self.lib.libusb_bulk_transfer,
  File "D:\mtk\venv\lib\site-packages\usb\backend\libusb1.py", line 938, in __write
    _check(retval)
  File "D:\mtk\venv\lib\site-packages\usb\backend\libusb1.py", line 604, in _check
    raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 5] Input/Output Error

The device appears for some time as the MTK virtual COM port but after error 5 the device manager is flashing few times.

With a battery I sometimes get the exploit to work (but reading the flash does not).

Any way to get it working without battery maybe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant