Skip to main content

Crate orbis_pkg

Crate orbis_pkg 

Source
Expand description

A library for parsing and extracting PlayStation 4 PKG files.

This crate provides functionality to parse PKG files, which are the package format used by PlayStation 4 for distributing games, updates, and DLC.

§Features

  • Parse PKG headers and metadata (content ID, type, DRM info)
  • Iterate over and extract PKG entries
  • Decrypt encrypted entries using the appropriate keys
  • Access the embedded PFS image for game content

§Example

use orbis_pkg::Pkg;

// Open a PKG from any byte source
let bytes = std::fs::read("game.pkg").unwrap();
let pkg = Pkg::new(bytes).unwrap();

// Access header information
println!("Content ID: {}", pkg.header().content_id());
println!("Entry count: {}", pkg.entry_count());

// Iterate over entries
for result in pkg.entries() {
    let (index, entry) = result.unwrap();
    println!("Entry {}: id=0x{:08X}", index, entry.id());
}

// Access the PFS image
if let Some(pfs) = pkg.get_pfs_image() {
    // Use orbis_pfs to read the PFS image
    println!("PFS image size: {} bytes", pfs.data.len());
}

§References

Modules§

entry
header
keys

Structs§

PfsImage
The embedded PFS image and its encryption key, returned by Pkg::get_pfs_image().
Pkg
A parsed PS4 PKG file.
PkgEntries
Iterator over PKG entries.

Enums§

EntryDataError
EntryReadError
FindEntryError
OpenError