Files
setec_fs_manager/tools/generate_lic.py

34 lines
835 B
Python
Raw Permalink Normal View History

v1.2.0 — Linux Flasher, Kali Creator, fixed flashing & counterfeit detection New features: - Linux Flasher tab: download+decompress+flash pipeline for RPi OS, Ubuntu, Debian, Fedora, Kali, DietPi, Alpine, Arch ARM with built-in image catalog - Kali Creator tab: 4 sub-tabs for USB/SD, VM creation, Docker/Podman container pulls, and cloud image downloads - DownloadManager: async downloads with resume support and speed tracking - Decompressor: streaming .xz (xz-embedded), .gz (zlib), .zip decompression - ImageCatalog: built-in catalog + remote fetch from rpi-imager JSON endpoint - SevenZipExtractor: QProcess wrapper for 7z.exe with progress parsing - Bundled xz-embedded third-party library for native XZ decompression Bug fixes: - Fixed VirtualDisk::flashToDisk() — added FSCTL_ALLOW_EXTENDED_DASD_IO, FSCTL_LOCK_VOLUME, FSCTL_DISMOUNT_VOLUME, 32MB aligned buffers, WriteFile retry logic (3 attempts), FlushFileBuffers before close - Fixed VirtualDisk::captureFromDisk() with same improvements - Fixed ImagingTab::onFlashIso() — now populates targetVolumeLetters from disk snapshot so IsoFlasher can properly lock/dismount volumes - Fixed SD card counterfeit detection false positives: - Changed from write-one-read-one to write-all-then-read-all algorithm to properly detect NAND address wrapping on fake cards - Added volume lock/dismount before probing to prevent filesystem interference (journal writes, metadata updates) - Added FSCTL_ALLOW_EXTENDED_DASD_IO for probes near end of disk - Fixed overly aggressive vendor string check — USB card readers legitimately report "USB"/"Mass Storage", no longer flagged - Added handle re-open between write and verify phases to defeat USB reader hardware cache - README: documented how to unlock the secret menu, added new feature docs
2026-03-12 12:51:35 -07:00
#!/usr/bin/env python3
"""
Generate the .key unlock file for Setec Partition Wizard.
Usage:
python generate_lic.py
Then use the resulting unlock.key in Tools > Unlock Features
"""
import base64
import hashlib
import os
UNLOCK_TEXT = "Snake Says Unlock!"
EXPECTED_HASH = "f2cd6920ba4b09c79c105810f9eff9d73beb1f689b8f67099c1a39e5634059c5"
script_dir = os.path.dirname(os.path.abspath(__file__))
key_path = os.path.join(script_dir, "unlock.key")
encoded = base64.b64encode(UNLOCK_TEXT.encode("utf-8"))
sha = hashlib.sha256(encoded + b"\n").hexdigest()
print(f"SHA-256: {sha}")
print(f"Expected: {EXPECTED_HASH}")
if sha == EXPECTED_HASH:
print("Hash matches!")
else:
print("WARNING: Hash mismatch.")
with open(key_path, "wb") as f:
f.write(encoded + b"\n")
print(f"Written: {key_path} ({len(encoded) + 1} bytes)")