Skip to content

Refactor archive API#17

Merged
iMrShadow merged 8 commits into
mainfrom
refactor/ttarch-overhaul
May 28, 2026
Merged

Refactor archive API#17
iMrShadow merged 8 commits into
mainfrom
refactor/ttarch-overhaul

Conversation

@iMrShadow

@iMrShadow iMrShadow commented May 26, 2026

Copy link
Copy Markdown
Owner

This PR refactors the Telltale Archive API, improves internal structure and adds documentation.

ResourceEntry

  • Renamed from TelltaleFileEntry to ResourceEntry to match Telltale's naming
  • Added additional fields

Archive

  • Renamed from ArchiveBase to Archive
  • Replaced the entry container to be a dictionary
  • Renamed a lot of functions to match Telltale's naming
  • Added functions which accept Symbol as an argument rather than passing a raw ulong value
  • Added functions to create archives
  • Added functions to find resource entries based on a search pattern
  • Added a basic ExportAll function which exports all files to a folder
  • Note: This does not process the files - scripts and metastream files are still encrypted. This means files using the MetaCrypt function are not decrypted at all - this is going to be fixed by adding a LegacyStream class
  • Added archive file metadata

TTArchive

  • Renamed from T3Archive to TTArchive
  • Improved the .ttarch reader to match Telltale's one. There are some untested cases
  • Added the experimental ability to create a .ttarch file from file entries with optional compression and encryption
  • Added a TtarchiveChunkedDataStream helper class to handle compressed archives
  • Using TtarchiveChunkedDataStream should result in faster extraction speed

ContainerStream

  • Added a ContainerStream to match Telltale's DataStreamContainer
  • Added the ability to create a new ContainerStream

TTArchive2

  • Renamed from T3Archive2 to TTArchive2
  • Improved the .ttarch2 reader using ContainerStream
  • Added the experimental ability to create a .ttarch2 file from file entries with optional compression and encryption
  • Using ContainerStream improves the extraction speed by 1600%-1700% (16-17x faster) due to the single cached chunk and utilizing SubStream. Entries must be ordered by their offsets for maximum efficiency

Miscellaneous

  • Renamed and reorganized some utility classes
  • Added documentation to various classes
  • Added extension functions to some classes
  • Removed unused field in ArchiveInfo

TODO:

  • Add LegacyStream to handle files with weird FourCC headers, as well as the ability to create them MetaStream needs refactoring to add support. Proper support is required for MCOM, MBES and the other encrypted versions.
  • Add Oodle decompression. This will require the native binaries for Windows and Linux. Also, the project could be built only against .NET 8/9/10 if one wishes to work with Oodle-compressed archives Can be added as a separate PR.
  • Test reading some .ttarch files: CSI3 Demo (Legacy), Bone 1 (Legacy + Encrypted), Bone 1 Czech (1), CSI Hard Evidence (2), SamMax S3 (8), TWDS1 (9), CSI: Fatal Conspiracy (8), Wallace (4), Puzzle Agent 2 (9), Poker Night (8), Monkey Island (8)
  • Stabilize API

@iMrShadow iMrShadow added documentation Improvements or additions to documentation enhancement New feature or request labels May 26, 2026
@iMrShadow iMrShadow self-assigned this May 26, 2026
@iMrShadow iMrShadow requested review from Copilot and removed request for Copilot May 26, 2026 12:43
@iMrShadow iMrShadow merged commit c15fba1 into main May 28, 2026
1 check passed
@iMrShadow iMrShadow deleted the refactor/ttarch-overhaul branch May 28, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant