GaryOderNichts / StadiaController

Stadia Controller tools for reverse engineering and experimenting.

Home Page:https://garyodernichts.blogspot.com/2023/01/looking-into-stadia-controller.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IndexError: pop from empty list

BoneGoat opened this issue · comments

Running on x86 MacOS Ventura 13.6.1.
libusb 1.0.26
Python 3.11.4
pyusb 1.2.1

Always crashes at different addresses. hid.py should handle empty queue but doesn't.
Maybe something to do with how MacOS handles HIDs. Going to try Ubuntu when possible.

python3 stadiatool.py info
Found: 18d1:9400 (Google Inc. Stadia Controller)
Controller serial number:
Controller is a pvt device
Current firmware is gotham build 169429
Current battery level: 100%

sudo python3 stadiatool.py flashloader data/restricted_ivt_flashloader.bin
Found: 1fc9:0135 (NXP SemiConductors Inc SP Blank RT Family )
flashloader image is 100672 bytes
SDP load result: 0x88888888

sudo python3 stadiatool.py dump 0 0x01000000 dump.bin
Found: 15a2:0073 (FREESCALE SEMICONDUCTOR INC. USB COMPOSITE DEVICE)
Detecting MCU type...
MCU: 6c0000 (106XA0)
Detecting Flash type...
Flash: 17c8 (Giga-16m)
Setting up flash
Reading [0x0001f7bc / 0x01000000]
Failed to read from 0x0001f7c0 (Failed to read register for masking), trying again...

Failed to read from 0x0001f7c0 (Failed to read register for masking), trying again...
Reading [0x00056568 / 0x01000000]
Failed to read from 0x0005656c (Failed to read register for masking), trying again...

Failed to read from 0x0005656c (Failed to read register for masking), trying again...
Reading [0x0005aa48 / 0x01000000]
Failed to read from 0x0005aa4c (Failed to read register for masking), trying again...

Failed to read from 0x0005aa4c (Failed to read register for masking), trying again...
Reading [0x000d3018 / 0x01000000]
Failed to read from 0x000d301c (Failed to read RFDR), trying again...

Failed to read from 0x000d301c (Failed to read register for masking), trying again...
Reading [0x0010200c / 0x01000000]
Failed to read from 0x00102010 (Failed to read register for masking), trying again...

Failed to read from 0x00102010 (Failed to read register for masking), trying again...
Reading [0x001e80b4 / 0x01000000]
Failed to read from 0x001e80b8 (Failed to read register for masking), trying again...

Failed to read from 0x001e80b8 (Failed to read register for masking), trying again...
Reading [0x0020ce94 / 0x01000000]
Failed to read from 0x0020ce98 (Failed to read RFDR), trying again...

Failed to read from 0x0020ce98 (Failed to read register for masking), trying again...
Reading [0x0022d174 / 0x01000000]
Failed to read from 0x0022d178 (Failed to read register for masking), trying again...

Failed to read from 0x0022d178 (Failed to read register for masking), trying again...
Reading [0x002b2df4 / 0x01000000]
Failed to read from 0x002b2df8 (Failed to read register for masking), trying again...

Failed to read from 0x002b2df8 (Failed to read register for masking), trying again...
Reading [0x002d4ac8 / 0x01000000]
Failed to read from 0x002d4acc (Failed to read RFDR), trying again...

Failed to read from 0x002d4acc (Failed to read register for masking), trying again...
Reading [0x002dfbe4 / 0x01000000]Traceback (most recent call last):
File "/Users/tobias/dev/git/StadiaController/stadiatool/stadiatool.py", line 323, in
dumpFlash(dev)
File "/Users/tobias/dev/git/StadiaController/stadiatool/stadiatool.py", line 286, in dumpFlash
flash_data = struct.pack('<I', flashRead32(fl, i * 4, 4))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tobias/dev/git/StadiaController/stadiatool/stadiatool.py", line 107, in flashRead32
writeFlashRegister(fl, 0x80, 0x80000000, True)
File "/Users/tobias/dev/git/StadiaController/stadiatool/stadiatool.py", line 95, in writeFlashRegister
cur = fl.read32(0x402A8000 + reg)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tobias/dev/git/StadiaController/stadiatool/flashloader.py", line 151, in read32
data = self.read_memory(address, 4)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tobias/dev/git/StadiaController/stadiatool/flashloader.py", line 119, in read_memory
return self.receive_response()
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tobias/dev/git/StadiaController/stadiatool/flashloader.py", line 89, in receive_response
frame = self.receive_frame(1)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/tobias/dev/git/StadiaController/stadiatool/flashloader.py", line 52, in receive_frame
report = self.hid.read_report(wait)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tobias/dev/git/StadiaController/stadiatool/hid.py", line 101, in read_report
return self.report_queue.pop()
^^^^^^^^^^^^^^^^^^^^^^^
IndexError: pop from empty list

Confirmed working on Ubuntu. Closing.