Correct. HID was swapped for webusb at 1.7.0.
I strongly recommend figuring out that part. It’s easier than doing everything you need by hand.
(it’s not really different from using any other Python library. have a look at tools/helloworld.py in the python subdir.)
So uhh you want to be able to invoke the PIN dialog on Trezor, and then, like, brute-force the PIN from host? So you would need to change the layout to not be randomized for every attempt, or just to use the host-provided input directly against the stored pin, instead of going through the matrix?
That would be a change you need to do in the firmware, yes. But when you do that, you can basically just call normal GetAddress, which triggers the PIN dialog, then send the PIN from host, and you get back either another PIN request, or the address.
Two ways to do this:
- implement a custom
uiobject to give to theTrezorClientconstructor. It is something that has aget_pinmethod. This will get called every time the PIN is shown on screen, and should return whatever the user has actually typed (so like"123"for all bottom row buttons). - maybe easier for you: construct a
GetAddressby hand (seebtc.py::get_address), call it viaclient.call_raw(), and then check the return value. if it is aPinMatrixRequest, send aPinMatrixAck(seeclient.py::TrezorClient::_callback_pin). You can do that in a loop.