Files

56 lines
1.5 KiB
C
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
/*
* XZ decompressor - Private/internal header
*
* Based on xz-embedded by Lasse Collin (public domain).
*/
#ifndef XZ_PRIVATE_H
#define XZ_PRIVATE_H
#include "xz.h"
#include <stdlib.h>
#include <string.h>
/* Six-byte magic at the start of every .xz stream: 0xFD, '7', 'z', 'X', 'Z', 0x00 */
#define XZ_HEADER_MAGIC "\3757zXZ\0"
#define XZ_HEADER_MAGIC_SIZE 6
/* Two-byte magic in stream footer: 'Y', 'Z' */
#define XZ_FOOTER_MAGIC "YZ"
#define XZ_FOOTER_MAGIC_SIZE 2
#ifndef min_t
#define min_t(type, a, b) ((type)(a) < (type)(b) ? (type)(a) : (type)(b))
#endif
#ifndef max_t
#define max_t(type, a, b) ((type)(a) > (type)(b) ? (type)(a) : (type)(b))
#endif
/* Get an unaligned 32-bit little-endian value */
static inline uint32_t get_le32(const uint8_t *buf)
{
return (uint32_t)buf[0]
| ((uint32_t)buf[1] << 8)
| ((uint32_t)buf[2] << 16)
| ((uint32_t)buf[3] << 24);
}
/* CRC lookup tables */
extern uint32_t xz_crc32_table[256];
extern uint64_t xz_crc64_table[256];
/* CRC functions */
uint32_t xz_crc32(const uint8_t *buf, size_t size, uint32_t crc);
uint64_t xz_crc64(const uint8_t *buf, size_t size, uint64_t crc);
/* LZMA2 decoder */
struct xz_dec_lzma2;
struct xz_dec_lzma2 *xz_dec_lzma2_create(enum xz_mode mode, uint32_t dict_max);
enum xz_ret xz_dec_lzma2_run(struct xz_dec_lzma2 *s, struct xz_buf *b);
enum xz_ret xz_dec_lzma2_reset(struct xz_dec_lzma2 *s, uint8_t props);
void xz_dec_lzma2_end(struct xz_dec_lzma2 *s);
#endif /* XZ_PRIVATE_H */