import sys

path = sys.argv[1] if len(sys.argv) > 1 else "blackbox.bin"
data = open(path, "rb").read()
print(f"total bytes: {len(data)}, records(16B): {len(data)//16}, remainder: {len(data)%16}")

recs = [data[i:i+16] for i in range(0, len(data), 16)]
from collections import Counter
types = Counter(r[2] for r in recs if len(r) == 16)
print("type counts:", {hex(k): v for k, v in sorted(types.items())})

for t in sorted(types):
    print(f"\n--- type 0x{t:02x} sample records ---")
    shown = 0
    for r in recs:
        if len(r) == 16 and r[2] == t:
            print(r.hex(' '))
            shown += 1
            if shown >= 6:
                break
