#!/usr/bin/env python3 # Offline host verification for Qualcomm ELF32 MCFG (.mbn) parser, # profile store, PLMN auto-matching, and duress blocking in bananarchy-imsctl. import hashlib import os import struct import subprocess import sys import tempfile from pathlib import Path BASE_DIR = Path(__file__).resolve().parents[1] IMSCTL_SRC = BASE_DIR / "src/bananarchy-daemons/bananarchy-imsctl.c" INC_DIR = BASE_DIR / "src/bananarchy-daemons" def build_synthetic_mbn(config_type=1, desc="Telia_SE-Commercial", version=(5, 1, 1, 1), plmns=((240, 1), (240, 5)), include_ims_nv=True): # Build MCFG_TRL TLVs trl_body = bytearray() trl_body += struct.pack("