Skip to content
PORTSNATIVE.
HomeCatalog
Web GamesEmulatorsToolsNews
PORTSNATIVE.

A catalog for discovering ports and related projects. We link to official sources and do not host original game files.

ExploreCatalogMy list
InformationAbout usSuggest a portSupportDonationsLegal notice
© 2026 PortsNative
Back to catalog
PORTSNATIVE

pkg defrag

TOOLACTION / ADVENTUREWINDOWSLINUXBETA

pkg defrag

Tool for defragmentation and extracting pkg files from PS4 HDD dumps.

OriginGitHub PKG Tools

TechnologyDevelopment tool / build utility

Available forWindows, Linux

View official project

About the project

Tool and utility indexed on PortsNative for configuration, decompilation, or execution support on modern platforms.

Official project information

Author's original READMEOpen on GitHub ↗

pkg-defrag

This simple tool allows you to defragment and extract PKG files from PS4 HDD dumps.<br> It has been field tested and has proven helpful in successfully recovering multiple PKGs from testkits!

Extracting The User Partition

Use 7zip or a similar tool to extract 12.img from the dumped HDD image.<br> This is your user partition.

Finding PKG Offsets

Scan the extracted but still encryted user partiton with HxD or a similar tool for PKG headers.

7F 43 4E 54 00 00 00   .CNT...

Make sure you don't use any of the known decryption tools as large PKG files are <b>not</b> encrypted.<br> They end up getting overwritten with garbage data if you try to decrypt the user partition.

Chunk Size And Padding

The chunk size can be found fairly easy by looking for a bigger block thats all 00 or other obvious garbage data followed by all 00's.<br> The start of the PKG to the end of the zero block is the chunk size.<br> The padding is the size of the garbage data to be skipped (the zero/garbage block).<br> <br> Padding sizes found during testing were 0xBA0000 or 0x6400000.<br> Once you found the padding and chunk size it will most likely be the same for all pkgs in the dump.

Contributing

Feel free to open a pull request if you have some good ideas for auto size detection or want to implement header, boundry or other error checks. This was written in 5-10 minutes so its very basic currently.

View official project
CALIFICACIÓN
—
Loading votes…
Advertisement

PROJECT FILE

Project type
TOOL
Genre
Action / Adventure
Status
beta
Original platform
GitHub PKG Tools
Technology
Development tool / build utility
Version
—
Updated
Sep 4, 2025

Target platforms 2

Windows
Linux
View on GitHub
Advertisement