Skip to content

sk-zk/Extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Extractor

A cross-platform .scs extractor for both HashFS and ZIP.

Features

  • Supports HashFS v1 and v2 as well as ZIP (including "locked" ZIP files)
  • Can extract multiple archives at once
  • Partial extraction
  • Raw dumps
  • Built-in path-finding mode for HashFS archives without directory listings
  • Automatic conversion of 3nK-encoded and encrypted SII files

Build

A Windows executable is available on the Releases page. On other platforms, install the .NET 8 SDK and run the following:

git clone https://github.com/sk-zk/Extractor.git
cd Extractor
dotnet publish -c Release

Usage

extractor path... [options]

General options

Short Long               Description
-a --all Extracts all .scs archives in the specified directory.
-d --dest Sets the output directory. Defaults to ./extracted.
-f --filter

Limits extraction to files whose paths match one or more of the specified filter patterns. A filter pattern can be a simple wildcard pattern, where ? matches one character and * matches zero or more characters, or a regex enclosed in r/.../.

Examples:
-f=*volvo_fh_2024*: extract files or directories containing the string "volvo_fh_2024"
-f=*volvo*,*scania*: extract files or directories containing the string "volvo" or "scania"
-f=/def/vehicle/truck/*/engine/*: extract engine definitions for trucks
-f=r/\.p(m[acdg]|d)$/: extract model files (.pmd, .pmg, ...)

When using regex, remember to insert escape characters where necessary.

--list Lists paths contained in the archive. Can be combined with --all, --deep, --filter, and --partial.
--list-all Lists all paths referenced by files in the archive, even if they are not contained in it. (Implicitly activates --deep.) Can be combined with --all, --filter, and --partial.
-p --partial

Limits extraction to the comma-separated list of files and/or directories specified.

Examples:
-p=/locale
-p=/def,/map
-p=/def/world/road.sii

When extracting a HashFS archive (without --deep), directory traversal begins at the given paths, allowing for extraction of known directories and files not discoverable from the top level. This makes --partial distinctly different from --filter. (In all other modes, extraction is limited to files whose paths begin with any of the strings given to this parameter.)

-P --paths Same as --partial, but expects a text file containing paths to extract, separated by line breaks.
-S --separate When extracting multiple archives, extract each archive to a separate directory.
-s --skip-existing Don't overwrite existing files.
--tree Prints the archive's directory tree. Can be combined with --all, --deep, and --partial.
-?, -h --help Prints the extractor's version and usage information.

HashFS options

Short Long               Description
--additional When using --deep, specifies additional start paths to search. Expects a text file containing paths to extract, separated by line breaks.
-D --deep An extraction mode which scans the contained entries for referenced paths instead of traversing the directory tree from /. Use this option to extract archives without a top level directory listing.
--list-entries Lists entries contained in the archive.
-r --raw Dumps the contained files with their hashed filenames rather than traversing the archive's directory tree.
--salt Ignores the salt specified in the archive header and uses the given one instead.
--table-at-end [v1 only] Ignores what the archive header says and reads the entry table from the end of the file.

Examples

Normal extraction:

extractor "path\to\file.scs"

Extract two .scs files at once:

extractor "path\to\file1.scs" "path\to\file2.scs"

Extract all .scs files in a directory:

extractor "path\to\directory" --all

Extract def and manifest.sii only:

extractor "path\to\file.scs" --partial=/def,/manifest.sii

Extract model files only:

extractor "path\to\file.scs" --filter=r/\.p(m[acdg]|d)$/

Extract with deep mode:

extractor "path\to\file.scs" --deep

Extract with deep mode when the mod is split into multiple archives:

extractor "file1.scs" "file2.scs" "file3.scs" --deep --separate

Alternatively:

extractor "path\to\mod\directory" --all --deep --separate