HydraHazard is a high-performance C library and a suite of command-line tools designed for parsing, extracting, and repacking Resident Evil 4 UHD asset formats. It provides bit-perfect parity with original game tools while offering a simple and modern interface.
Legal Notice: This software is intended for modding and research purposes only. The user is responsible for any consequences arising from the use of this software. Resident Evil 4 UHD is property of Capcom, all rights reserved.
- LZX Decompression - High-fidelity streaming LZX implementation with 100% bit-exact parity with Xbox 360
XCompress64.dll. - LFS Container Support - Seamless extraction and handling of
.lfscompressed archives. - YZ2 Compression - Full support for the Jaderlink/YZ2 algorithm used for textures and sub-archives in the UHD Edition.
- PACK Archive Management - Robust extraction and repacking of
.packand.pack.yz2containers, including support for nested archives. - UDAS/DAS Support - Extraction of room and character archives with smart format detection.
- Transparent LFS Handling - Automatic on-the-fly decompression when opening archives via the library.
The core library is written in portable C (C99) and provides high-level abstractions for asset loading:
pack_open_file/udas_open_file: Smart loaders that handle.lfsdecompression and fallback automatically.lfs_extract_full_file: Low-level standalone LFS extraction.yz2_mem_inflate/deflate: Memory-to-memory YZ2 processing.
lfsx: LFS container extractor and diagnostic tool.yz2cli: YZ2 compression/decompression utility.packcli: Recursive PACK archive manager (Extraction & Repacking).udascli: UDAS/DAS extraction utility.
The project supports multiple build systems for maximum portability.
- Run
make - Binaries will be located in the
out/directory.
- Run
cmake -S . -B build - Run
cmake --build build - Binaries will be located in the
build/tools/directory.
- Run
meson setup build - Run
meson compile -C build - Binaries will be located in the
build/tools/directory.
HydraHazard tools are designed to be intuitive and follow standard CLI conventions.
toolname [options] <input_file>The tool will autodetect if the file should be extracted or repacked based on the extension and file type.
-x,-d: Explicitly set Extract / Decompress mode.-c: Explicitly set Repack / Compress mode.-o <path>: Specify the output destination.- If
<path>is a non-existing path, it will be created as the output file or directory. - If
<path>is an existing directory, the results will be placed inside it. - If
<path>is-, output is redirected to STDOUT (supported bylfsxandyz2cli).
- If
-v: Enable verbose output.-V: Show version information.-h: Show help/usage guide.
-
Extracting a pack file (Auto-detect):
packcli 01000000.pack.yz2
-
Extracting to a specific path:
packcli -o my_assets 01000000.pack.yz2
-
Repacking a directory into a pack file:
packcli -c my_assets
-
Piping decompressed LFS data directly:
lfsx -o - room.udas.lfs | head -c 16 | xxd
This is a personal project provided as-is. See LICENSE for details. Resident Evil 4 UHD is property of Capcom, all rights reserved. This project is not affiliated with or endorsed by Capcom. Enjoy! :D