• v4.0 f9c4911fe5

    UFS2Tool v4.0 Stable

    archiver-bot released this 2026-02-15 10:45:15 -06:00 | 7 commits to main since this release

    🗄️ UFS2Tool v4.0

    🖥️ New GUI Features

    • UFS Image Content Browser
      • Tree-view content browser for inspecting and manipulating UFS image contents, with drag & drop for adding files.
      • Refresh, Extract, Add File, Add Folder & Delete options
    • Write Filesystem
      • Write UFS images to USB/HDD/SSD drives on Windows, Linux, and macOS
    • PS5
      • Batch Processing to convert multiple folders to UFS images in one operation.
    • Language auto-detection
      • Auto-applies language from OS locale on startup

    📟 New UFS Image Commands

    • du
      • Display disk usage for files and directories in a UFS1/UFS2 filesystem image, similar to FreeBSD's du(1).
    • find
      • Searches recursively for files and directories matching a name pattern within a UFS1/UFS2 filesystem image. Similar to the Unix find(1) command with -name matching.
    • stat
      • Displays detailed inode information for a file, directory, or symbolic link inside a UFS1/UFS2 filesystem image. Similar to the Unix stat(1) command.

    🌍 New Languages

    • Bahasa Indonesia
    • Magyar
    • Nederlands
    • Português (Brasil)
    • 中文 (繁體) (Traditional Chinese)

    🔧 Fixes

    • Core Fixes
      • Nullable _writer field (Ufs2Image.cs): _writer is only initialized when readOnly=false but was declared non-nullable, producing CS8618 warnings.
      • Constructor resource leak (Ufs2Image.cs): If ReadSuperblock() throws (invalid image), the already-opened FileStream/BinaryReader/BinaryWriter were never disposed.
      • GetDiskFreeSpace reports wrong free space — was computing FreeBlocks * FSize but FreeBlocks is free blocks (not fragments), underreporting by BSize/FSize (typically 8x).
      • ls command ignores [path] argument — always called ListRoot() regardless of user-specified path; now resolves and lists the given directory.
      • Buffer overread in Ufs2DirectoryEntry.ReadFrom — corrupt entries with NameLength > nameAreaSize would index out of bounds.
      • ReadInode() / WriteInode() — totalInodes bounds check used int multiplication; changed to long to prevent overflow bypassing the validation.
      • FsckUfs() — Same overflow in totalInodes used to size per-inode tracking arrays; added explicit overflow guard since arrays require int length.
      • AllocateInode() / FsckUfs() Phase 5 — globalIno = cgIndex * inodesPerGroup + i overflows.
    • GUI
      • False success message on invalid input: Mode parsing (octal conversion) was inside the Task.Run lambda. On FormatException/OverflowException, the lambda returned early but the outer async method still logged "Successfully changed permissions".
      • Directories inaccessible after recursive chmod: image.ChmodAll(mode, mode) applied the same mode to files and directories. Setting 644 recursively stripped execute bits from directories, making them untraversable. Added AddExecuteBits helper (matching CLI behavior) to derive directory mode.
    • Reliability
      • Stream.Read partial read handling — added ReadFully helper that loops until all bytes are read and throws EndOfStreamException on truncated data.
      • Bounds validation in ReadInode/WriteInode — validates inode number against total count and computed offset against stream length before I/O.
      • Removed redundant new BinaryReader(_stream) in ReadIndirectBlock/ReadDoubleIndirectBlock/ReadTripleIndirectBlock — reuses existing _reader field.
    • Dokan mount error handling
      • SetEndOfFile: reject negative or > int.MaxValue lengths with InvalidParameter.
      • WriteFile: reject negative offsets; return InvalidParameter on newSize > int.MaxValue overflow.
      • Explicit (int) casts on validated long values for type safety.
    Downloads