#!/usr/bin/env python3 """sbl_mains.py — кандидаты в sbl_main: плотность BL + близость строк boot-лога. Использование: ./tools/sbl_mains.py fw/sbl/img0.elf """ import struct import sys d = open(sys.argv[1], "rb").read() phoff = struct.unpack("> 25) == 0b101 and (y & 0x01000000): bls += 1 if bls >= 8: cands.append((bls, v + j)) cands.sort(reverse=True) print("top candidates (bl-count, addr):") for bls, a in cands[:15]: print(f" {bls:3d} {a:#x}")