Emulator broken for versions <1.8.0 ?

Hello Everyone, it’s me again with a problem on older versions from firmware :sweat_smile:

I know it’s kind of irrelevant to work on older versions of firmware since they are probably not used on any device nowadays. But it is important to break through older (and obviously more vulnerable) versions in order to understand the security updates.

To make it short, I think something is broken in the emulator of versions before 1.8.0. I don’t know if the emulator was developped with the intention to communicate with it (using trezoctl command line or Trezor Suite app).
In fact the emulator is lanched and i can see the init screen, but I can’t get to communicate with it, not with the trezor Suite app (launched with --bridge-dev option) nor with the trezorctl command line.
Small example :
I used the following command line to test if I can communicate with the emulator, and the result is different :

  • for versions >= 1.8.0 : I get Hello in return
  • for versions < 1.8.0 : it just kept running, even if the wait-for-emulator command line detects the presence of an emulator (through udp socket i guess)
trezorctl ping Hello

I tried to look for the reason behind this behavior, but the udp.c file (found in emulator folder) is identical for different versions. Any idea what could cause this problem ?

I managed to reproduce a similar situation. In my case, it turned out that the file firmware/protob/messages_map.h was empty.

That looks like a build problem, and rerunning ./script/setup and ./script/cibuild solves it. My suspicion is that I first run script/cibuild, Python was not found, so I re-ran it in the pipenv, and then it worked, but the problematic file was not regenerated.