PHPackages                             mistralys/x4-data-extractor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mistralys/x4-data-extractor

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mistralys/x4-data-extractor
===========================

Generate batch files to extract X4 data with XRCatTool.

2.0.0(3mo ago)0211MITPHPPHP &gt;=8.4

Since Jun 6Pushed 3mo agoCompare

[ Source](https://github.com/Mistralys/x4-data-extractor)[ Packagist](https://packagist.org/packages/mistralys/x4-data-extractor)[ RSS](/packages/mistralys-x4-data-extractor/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (4)Used By (1)

X4 Game Files Extractor
=======================

[](#x4-game-files-extractor)

X4 helper: Batch file generator to extract X4 game files with the XRCatTool.

Analyzes a local X4 installation to detect all `.cat` files for the base game and installed DLCs, and generates batch files to extract them to the configured output folder.

Requirements
------------

[](#requirements)

- PHP 8.2 or higher.
- [Composer](https://getcomposer.org/).
- [X Catalog Tool](https://www.egosoft.com/download/x4/bonus_en.php?download=598) (requires a forum account).

Extracting Game Files
---------------------

[](#extracting-game-files)

1. Clone this repository.
2. Copy `dev-config.php.dist` to `dev-config.php`.
3. Edit `dev-config.php` to set the required paths.
4. Run `composer install` to install the dependencies.
5. Run `composer build-batches` to generate the batch files.
6. Open the `batches` folder in the repository root.
7. Run any of the generated batch files to extract the game files.

> Use the `unpack-all.bat` file to extract all files at once.

### Delete Output folder first

[](#delete-output-folder-first)

To ensure a clean extraction, delete the output folder first. You can use this command in PowerShell:

```
Remove-Item -Recurse -Force output
```

> NOTE: This will run for a while without any progress indication.

Accessing Extracted Files
-------------------------

[](#accessing-extracted-files)

### Structure

[](#structure)

To be able to recognize whether files belong to the base game or a DLC, a folder is created for the base game and each DLC separately. This is important for modding, as changing files belonging to a DLC requires using a matching folder structure in those mods.

### Programmatic Access

[](#programmatic-access)

When used as a library (installed via Composer), the `X4GameInfo`class can be used to easily access information on the game and the available extensions.

```
use \Mistralys\X4\ExtractedData\X4GameInfo;

$gameInfo = X4GameInfo::create();

// The game version, e.g. `8.0.0.0`
$version = $gameInfo->getGameVersion();

$dataFolders = $gameInfo->getFolderCollection();

// Show a list of all data folders
foreach($dataFolders->getAll() as $folder)
{
    echo $folder->getLabel().PHP_EOL;
}
```

### Locally Extracted Folders

[](#locally-extracted-folders)

When working with a local copy of extracted folders (with this tool), set the path to the folder to access the full data folder paths to get at the files contained within.

```
use \Mistralys\X4\ExtractedData\X4GameInfo;

$folders = X4GameInfo::create()
    ->setExtractedDataFolder('/path/to/output/folder')
    ->getFolderCollection();

foreach($folders->getAll() as $folder) {
    $path = $folder->getPath();
}
```

### Manual Access

[](#manual-access)

An `info.json` file is generated in each folder, which provides some basic information on the source of the files. This is the JSON generated for the Boron DLC, for example:

```
{
  "id": "ego_dlc_boron",
  "label": "Kingdom End",
  "isExtension": true
}
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance78

Regular maintenance activity

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~117 days

Total

3

Last Release

114d ago

Major Versions

1.0.1 → 2.0.02026-01-25

PHP version history (2 changes)1.0.0PHP &gt;=8.2

2.0.0PHP &gt;=8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8895528?v=4)[Mistralys](/maintainers/Mistralys)[@Mistralys](https://github.com/Mistralys)

---

Top Contributors

[![Mistralys](https://avatars.githubusercontent.com/u/8895528?v=4)](https://github.com/Mistralys "Mistralys (34 commits)")

---

Tags

extract-dataunpackerx4foundations

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mistralys-x4-data-extractor/health.svg)

```
[![Health](https://phpackages.com/badges/mistralys-x4-data-extractor/health.svg)](https://phpackages.com/packages/mistralys-x4-data-extractor)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
