Sh4pac
A tool for unpacking and repacking Silent Hill 4 sound .pac files
Install / Use
/learn @HunterStanton/Sh4pacREADME
sh4pac
This is a C# command-line tool for unpacking and repacking Silent Hill 4 .PAC sound archives. There doesn't seem to be a tool anywhere on the internet for doing this, and the format is relatively simple, so I thought I'd create one as an open-source C# tool.
Usage
sh4pac has three modes which allow you to analyze a .pac file, extract it's contents, or build a completely new one.
- sh4pac analyze <file.pac> - Prints some information about a .pac archive
- sh4pac unpack < file.pac > < output directory > - Unpacks a .pac archive into an output folder
- sh4pac pack < output directory > < file.pac > - Creates a .pac archive from an output folder
Repacking Notes
When you have unpacked a .pac, you must keep the order and filenames of each .wav file the same. The filenames are currently used to store unknown information about each .wav that is crucial to repacking.
I believe you should also keep the sample rate/format/length of the .wavs the same as their original if you intend on modifying them. This engine hardcodes many things about how it expects things to be and is very particular about that, so modifying the parameters of the .wav files outside of the original Konami parameters can cause unintended behavior such as audio not playing, skipping, or the game outright crashing when a sound is played. There is currently no workaround for these issues, and I doubt there ever will be without significant modification to the game binary.
Other than that, you should be able to create sound mods using this tool. Have fun, and @ me on Twitter (@hun10sta) if you come up with something fun :-)
Proof-of-Concept
Here is a simple sound mod created with the use of this tool.
To-do
- Verify an unknown int32 in the header of the .pac file
- Refactoring
Credits
- Hunter Stanton (@HunterStanton) - Research, creating the tool
Related Skills
node-connect
350.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
350.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
350.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。

