PAKLib 1.1.0

dotnet add package PAKLib --version 1.1.0
                    
NuGet\Install-Package PAKLib -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PAKLib" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PAKLib" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="PAKLib" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PAKLib --version 1.1.0
                    
#r "nuget: PAKLib, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PAKLib@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PAKLib&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=PAKLib&version=1.1.0
                    
Install as a Cake Tool

Example

    const string inFilePath = @"SPRITES\New-Dialog.pak";
    const string outFilePath = @"SPRITES\New-Dialog-new.pak";

    PAK pak = PAK.ReadFromFile(inFilePath);

    int i = 0;
    foreach (var sprite in pak.Data.Sprites)
    {
        using (MemoryStream ms = new MemoryStream(sprite.data))
        using (Bitmap bmp = new Bitmap(Image.FromStream(ms)))
        {
            bmp.Save($"{i++}.bmp", System.Drawing.Imaging.ImageFormat.Bmp);
        }
    }

    if (pak.Data == null)
    {
        Console.WriteLine("Failed to read PAK data.");
        return;
    }

    Console.WriteLine($"Read {pak.Data.Sprites.Count} sprites from PAK file.");

    pak.Data.Write(outFilePath);
    Console.WriteLine($"PAK data written to {outFilePath} successfully.");

Nuget Package

https://www.nuget.org/packages/PAKLib

PAK File Format Specification

1. File Header 20 bytes total

Offset Field Type Size (bytes) Description
0 Magic UTF-8 17 "<Pak file header>"
17 Padding byte[3] 3 0x00, 0x00, 0x00

2. Sprite Count 4 bytes total

Offset Field Type Size (bytes) Description
20 Count Int32 4 Number of sprite entries in file

3. Sprite Table 8*n bytes total

Starts at offset 24, repeats Count times (8 bytes each):
| Offset (rel) | Field | Type | Size (bytes) | Description | | ------------ | ------- | ------ | ------------- | -------------------------------------------------- | | 24+n*4 | Offset | Int32 | 4 | Byte position of this sprite entry from file start | | 24+n*4+4 | Length | Int32 | 4 | Total bytes of this sprite entry |

4. Sprite Entry 108+(12*n) bytes total

At each table Offset, layout is:

4.1 Sprite Header 100 bytes total

Offset (rel) Field Type Size (bytes) Description
0 Magic UTF-8 20 "<Sprite File Header>"
20 Padding byte[80] 80 Reserved

4.2 Rectangle Data 4+(12*n) bytes total

Offset (rel) Field Type Size (bytes) Description
100 Count Int32 4 Number of rectangles
104 Data Records Count × 12 bytes Each record: x(Int16), y(Int16), width(Int16), height(Int16), pivotX(Int16), pivotY(Int16)

4.3 Entry Padding 4 bytes total

Offset (rel) Field Type Size (bytes) Description
... Padding byte[4] 4 Always zero bytes

4.4 Image Data variable length

Offset (rel) Field Type Size (bytes) Description
... Data byte[] ... Raw sprite image bytes

Notes:

  • All multi‑byte integers are little‑endian.
  • Length in the sprite table covers from the sprite’s Offset through the end of its image data.
  • Rectangle record size is fixed at 12 bytes per rectangle.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 320 11/13/2025
1.0.1.2 523 7/24/2025
1.0.1.1 504 7/24/2025
1.0.1 565 7/23/2025
1.0.0.4 564 7/23/2025
1.0.0.3 558 7/22/2025
1.0.0.2 561 7/22/2025
1.0.0.1 506 7/21/2025
1.0.0 564 7/21/2025