Skip to content

* edit LucasArts GOB v2 through its trailing directory - #202

Open
Hawkynt wants to merge 1 commit into
mainfrom
perf/gob-trailing-directory-editing-v2
Open

* edit LucasArts GOB v2 through its trailing directory#202
Hawkynt wants to merge 1 commit into
mainfrom
perf/gob-trailing-directory-editing-v2

Conversation

@Hawkynt

@Hawkynt Hawkynt commented Sep 6, 2026

Copy link
Copy Markdown
Owner

What changed

  • add a changed-byte editor for canonical GOB v2 archives whose directory is the exact physical trailer
  • batch add/replace writes changed stored payloads where the old directory began, regenerates the directory after them, and patches only the 32-bit directory-offset field in the 12-byte header
  • remove rewrites the directory in place and leaves survivor payloads at their original offsets
  • wipe replaced/removed payload ranges only when no surviving directory entry overlaps them, so aliased/shared data is preserved
  • unsupported non-trailing layouts reject before the first write and keep the verified extract/re-create fallback
  • correct the layout map to include the fixed header and trailing directory as metadata instead of exposing only payload extents

Complexity

For canonical trailing-directory GOB v2 archives:

  • pure add: O(directory metadata + added bytes)
  • replace: O(directory metadata + replacement bytes + safely wiped superseded bytes)
  • remove: O(directory metadata + safely wiped removed bytes)

Untouched payloads are neither read nor moved. Holes left by replacement/removal are deliberately reclaimed by defragmentation, not by ordinary mutation.

Tests

Descriptor-level I/O-budget tests use a 4 MiB untouched stored member and require tiny add/replace/remove operations to stay below 128 KiB of archive reads and writes while preserving that member's exact physical offset and bytes. Replacement/removal verify stale-byte wiping, a missing-name removal must perform zero writes, an aliased-payload case proves one directory record cannot wipe data still referenced by another, and the layout test pins header/payload/directory classification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant