Conversation
Empty SPF placeholder frames carry non-positive (often negative) dimensions and no pixel data. The EPF/EFA render paths guarded this but the shared SimpleRender helper did not, so rendering such a frame threw NullReferenceException. Guard centrally; empty frames render as 1x1 transparent images. Regression test included (test project gains the Linux Skia natives so render tests run on Linux). Co-Authored-By: Imbas <imbas@eris.co>
Per external review (Codex): - ExtractTo: entry names come from archive bytes; canonicalize each output path and refuse any that resolves outside the destination directory (path traversal via "../x" or rooted names) - ctor: reject negative entry-count words with InvalidDataException instead of silently yielding an empty archive (the extended-format layout leads with 0xFFFFFFFF, which read as count -1) - FromFile: honor an existing path as-given; WithExtension remains only the extensionless-name convenience (it rewrote "FOO.DAT" to "FOO.dat", which does not exist on case-sensitive filesystems) Co-Authored-By: Imbas <imbas@eris.co>
foscail unpack extracts every entry from one or more DAT archives, optionally converting the self-contained image formats (SPF, EFA) to PNG. Palette-dependent formats (EPF/HPF/MPF/tiles) are raw-extracted; converting those via TBL/PAL resolution is a later milestone. Includes hardening from external review (Codex): extraction runs inside the per-archive failure boundary so one bad archive cannot abort the batch, extended-format (0xFFFFFFFF) archives are reported as unsupported rather than silently parsed as empty, .dat discovery is case-insensitive, and PNG output paths get the same containment check as extraction. Foscail.Tests covers the CLI end-to-end over synthetic archives, including the hostile and extended-format cases. Verified against 3.61 and 7.41 client corpora: 55,518 entries extracted, 3,605 PNGs, no failures. Co-Authored-By: Imbas <imbas@eris.co>
Usage, the self-contained vs palette-dependent conversion split, and behavior notes (failure handling, extended-format reporting, output containment). Wired as PackageReadmeFile so nuget.org displays it. Co-Authored-By: Imbas <imbas@eris.co>
Member
Author
|
Milestone 2 pushed (86c6642): the palette-dependent tier now converts — stc HPF statics, MPF monsters (embedded palette number → mns pals, named sequences), effect and item-sheet EPFs, all khan part sprites (letter→family mapping incl. shared families and the palm skin ramp, m/w overrides), ground tiles from the tilea bank, and a gated legend.pal fallback for single-palette-era archives (3.61). Verified: 7.41 corpus 55,518 entries → 536,125 images, zero failures (99%+ of image-format entries); 3.61 → 52,693 images. 17 Foscail tests pin the conventions at pixel level. Generated with Imbas imbas@eris.co |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
foscail (Irish, "open") — a
dotnet toolCLI shipped alongside DALib.foscail unpackextracts every entry from one or more DAT archives into per-archive directories;--convertadditionally renders the self-contained image formats (SPF, EFA) to PNG. Palette-dependent formats (EPF/HPF/MPF/tiles) are raw-extracted for now — TBL/PAL resolution is the next milestone.Verified against 3.61 and 7.41 client corpora: 20 archives, 55,518 entries, 3,605 PNGs, zero failures.
Library fixes along the way
SimpleRenderhelper; the EPF/EFA paths were guarded but the helper wasn't. Fixed centrally — degenerate frames render as 1×1 transparent — with a regression test.DataArchivehardening (from an external Codex review of the tool, all four findings verified against source before fixing):ExtractTocanonicalizes each output path and refuses entry names that resolve outside the destination (path traversal via../xor rooted names — latent for all DALib consumers, not just foscail)InvalidDataException) instead of silently yielding an empty archive when handed the extended0xFFFFFFFF-headed layout or other garbage — note this is a small public behavior changeFromFilehonors an existing path as-given;WithExtensionremains only the extensionless-name convenience (it used to rewriteFOO.DAT→FOO.dat, which breaks on case-sensitive filesystems)Tool robustness (same review)
.datdiscovery is case-insensitive (the 3.61 corpus's ownFILE00XX.DATwas previously invisible on Linux)Tests
New
Foscail.Testsproject drivesUnpackCommand.Runend-to-end over synthetic archives: happy path, hostile-archive batch continuation, extended-format reporting, uppercase-extension discovery (glob and direct path). NewDataArchiveTestscovers the library guards, including fail-without-fix cases for traversal and the negative-count parse. 940 tests green.Generated with Imbas imbas@eris.co