feat(core/bootloader_emu): record screen refreshes from startup with -r [no changelog]
What changed, and why it matters
This commit adds a new command-line option to the Trezor bootloader emulator that lets developers record every screen refresh as a PNG image. It is a debugging/testing feature for the emulator only and does not change how real hardware wallets behave. There is no indication this is a security fix or that it introduces a security problem.
No security action required. Treat as a normal feature commit for the bootloader emulator.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change modifies core/embed/projects/bootloader/emulator.c to add a -r DIR argument. When used, it calls display_record_start() so that screen refreshes are captured as PNG files into the specified directory from emulator startup. This is intended for automated testing of boot-path screens that appear before a host can attach DebugLinkRecordScreen. The change is purely additive to the emulator build and does not alter firmware, cryptographic, or trust-boundary behavior on physical devices.
Changed components
core/embed/projects/bootloader/emulator.cInspect captured patch +6 / −1
### core/embed/projects/bootloader/emulator.c
@@ -23,6 +23,7 @@
#include "emulator.h"
#include "rust_ui_common.h"
+#include <io/display_utils.h>
#include <sys/systask.h>
#include <sys/unix/bootutils_emu.h>
@@ -57,6 +58,7 @@ void usage(void) {
#endif
printf(" -B FILE boot with the command and arguments from FILE (the\n");
printf(" format a previous run wrote to trezor.bootargs)\n");
+ printf(" -r DIR record every screen refresh as PNG into DIR\n");
printf(" -w wipe any firmware before booting\n");
printf(" -e MESSAGE [TITLE [FOOTER]] display error screen and stop\n");
printf(" -c COLOR_VARIANT set color variant\n");
@@ -170,7 +172,7 @@ int main(int argc, char **argv) {
uint8_t set_variant = 0xff;
uint8_t color_variant = 0;
uint8_t bitcoin_only = 0;
- while ((opt = getopt(argc, argv, "ahslewc:b:f:i:B:WR")) != -1) {
+ while ((opt = getopt(argc, argv, "ahslewc:b:f:i:r:B:WR")) != -1) {
switch (opt) {
case 'a':
disable_animation(true);
@@ -200,6 +202,9 @@ int main(int argc, char **argv) {
bootargs_set(BOOT_COMMAND_SHOW_RSOD, &pminfo, sizeof(pminfo));
} break;
#endif
+ case 'r':
+ display_record_start((uint8_t *)optarg, strlen(optarg), 0);
+ break;
case 'B':
if (!bootargs_emu_load_file(optarg)) {
exit(BOOTUTILS_EMU_EXIT_USAGE);Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.