Skip to content

Nielk1/ZorkFileSystemTools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zork File System Tools

Zork File System Tools (ZfsTool) is a utility for working with ZFS archive files used in several classic games. It supports listing, extracting, and creating ZFS archives, with support for multiple compression modes and archive formats.

Features

  • List contents of ZFS archives
  • Extract files from ZFS archives
  • Create new ZFS archives from directories or manifest files
  • Supports multiple ZFS modes and compression options
  • Optional per-file compression
  • Optional encryption

Usage

ZfsTool list <archive.zfs>

ZfsTool extract <archive.zfs> [output-directory]

ZfsTool create <archive.zfs> <source-folder> [options]
  --manifest <manifest.txt>   Use a manifest file for per-file compression
  --no-recursive              Do not scan source folder recursively
  --default-compression <None|LZO1X|LZO1Y|Best>
  --encryption-key <uint32>   Raw encryption key as base 10 integer
  --mode <ZFSF|ZFS3|BZEF>     Version number is implied by selected mode, default mode is ZFSF
  --max-table-entries <uint>  Set max entries per TOC table (default: 100)

ZfsTool manifest-help         Show manifest file format help

ZfsTool mode-help             Show mode help

Supported Modes

Game Mode Version
Zork: Nemesis (1996) 🟦 ZFSF 1
Interstate '76 (1997) 🟦 ZFSF 1
Zork: The Grand Inquisitor (1997) 🟦 ZFSF 1
Battlezone (1998) 🟦 ZFSF 1
Civilization: Call to Power (1999) 1️⃣ ZFS3 1
Heavy Gear 2 (1999) 1️⃣ ZFS3 1
Star Trek: Armada (2000) 🟦 ZFSF 1
Interstate '82 (2000) 1️⃣ ZFS3 1
Call to Power II (2001) 1️⃣ ZFS3 1
Battlezone Enhanced 2️⃣ BZEF 3

Sample Manifest

# manifest file

# force LZO1X compression on foo.txt
foo.txt LZO1X

# force no compression on bar.bin
bar.bin None

# force best compression
# tests for smallest size under LZO1X, LZO1Y, and None
# note the file will be saved as pic1.png
images/pic1.png Best

TODO

File creation doesn't use streams but instead loads the source files into byte arrays to load them all at once. Replace with a stream system that reads the file at archive build time so as to not waste memory.

Audit archive creation path, it's fully untested at this point.

License

This project is dual-licensed:

  • The code in this repository is provided under the terms of the MIT License.
  • However, because it uses the LZO compression library, which is licensed under GPLv2, the combined work is subject to the GPLv2 license.
  • If you replace or rewrite the LZO library with a non-GPL implementation, you may use this code under the MIT License.
  • You may also choose to omit the LZO library entirely if using ZFS that do not require it.

See LICENSE-MIT.txt and LICENSE-GPL.txt for details.


Note: This tool is intended for archival and modding purposes for classic games. Please respect the licenses and copyrights of the original game data.

About

Tool for understanding and extracting Zork File System (ZFS) files used in several classic games.

Topics

Resources

License

GPL-2.0, MIT licenses found

Licenses found

GPL-2.0
LICENSE-GPL.txt
MIT
LICENSE-MIT.txt

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages