Skip to content

Commit

Permalink
fix: do not parse fonts if symbol not present
Browse files Browse the repository at this point in the history
  • Loading branch information
yhql committed Sep 28, 2023
1 parent 6a34680 commit a39c6d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions speculos/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ def get_elf_infos(app_path):
fonts_addr = bagl_fonts_symbol[0]['st_value']
fonts_size = bagl_fonts_symbol[0]['st_size']
logger.info(f"Found C_bagl_fonts at 0x{fonts_addr:X} ({fonts_size} bytes)\n")
else:
logger.info("Disabling OCR.")

supp_ram = elf.get_section_by_name('.rfbss')
ram_addr, ram_size = (supp_ram['sh_addr'], supp_ram['sh_size']) if supp_ram is not None else (0, 0)
Expand Down
6 changes: 4 additions & 2 deletions src/launcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,10 @@ static int run_app(char *name, unsigned long *parameters)
app = get_current_app();

// Parse fonts and build bitmap -> character table
parse_fonts(memory.code, app->elf.text_load_addr, app->elf.fonts_addr,
app->elf.fonts_size);
if ((app->elf.fonts_addr != 0) && (hw_model != MODEL_STAX)) {
parse_fonts(memory.code, app->elf.text_load_addr, app->elf.fonts_addr,
app->elf.fonts_size);
}

/* thumb mode */
f = (void *)((unsigned long)p | 1);
Expand Down

0 comments on commit a39c6d0

Please sign in to comment.