CUE4Parse 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package CUE4Parse --version 1.0.1                
NuGet\Install-Package CUE4Parse -Version 1.0.1                
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="CUE4Parse" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CUE4Parse --version 1.0.1                
#r "nuget: CUE4Parse, 1.0.1"                
#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.
// Install CUE4Parse as a Cake Addin
#addin nuget:?package=CUE4Parse&version=1.0.1

// Install CUE4Parse as a Cake Tool
#tool nuget:?package=CUE4Parse&version=1.0.1                

CUE4Parse

C# Parser for Unreal Engine packages & assets

Usage

FileProvider

DefaultFileProvider

This file provider lets you load packages locally from a given directory.

var provider = new DefaultFileProvider(gameDirectory, SearchOption.TopDirectoryOnly);
provider.Initialize();

StreamedFileProvider

This file provider lets you load packages from their stream and gives you more control over what one you want to load.

var provider = new StreamedFileProvider(gameName); // gameName is not useful for most cases
provider.Initialize(fileName, new []{fileStream}); // foreach file you wanna load
// the 'fileStream' array must contains both .utoc AND .ucas streams in case you're loading an IO Store Package
Mounting

The next step is mounting files you loaded, you can do so by using the SubmitKey method. You must provide a GUID of one of the packages and its working aes key.

Provider.SubmitKey(guid, aesKey);
Localization

Depending on the game, assets can be loaded using different languages (usually English by default). In order to load them in another language, use the following code. Keep in mind that languages hardcoded in CUE4Parse are a small amount of languages used by the most popular games, you might have to add your own language in the code to support the game you're loading.

Provider.LoadLocalization(language);
Extract

All Exports

To get a json string of all exports included in the asset

var exports = Provider.LoadObjectExports(fullPath);
var json = JsonConvert.SerializeObject(exports, Formatting.Indented);

One Export

To get a json string of one export included in the asset

var export = Provider.LoadObject(fullPathWithExportName); // FortniteGame/Content/Athena/Items/Cosmetics/Backpacks/BID_718_ProgressiveJonesy.FortCosmeticCharacterPartVariant_0
var json = JsonConvert.SerializeObject(export, Formatting.Indented);
Export

An asset usually has its data split between multiple other assets. In order to grab them all, use TrySavePackage which will out a IReadOnlyDictionary<string, byte[]> for you to loop through.

if (Provider.TrySavePackage(fullPath, out var assets))
{
    foreach (var kvp in assets)
    {
        File.WriteAllBytes(Path.Combine(directory, kvp.Key), kvp.Value);
    }
}

Requirements

Building CUE4Parse

  1. Clone repository and initialize submodules

    git clone https://github.com/FabianFG/CUE4Parse
    cd CUE4Parse
    git submodule update --init --recursive
    
  2. Build

    dotnet build
    

Contributing

Contributions are always welcome in order to maintain the project!

Authors

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on CUE4Parse:

Package Downloads
CUE4Parse-Conversion

Package Description

PalworldDataExtractor.Lib

Extract data from Palworld .pak file

UE.JsonDataBrowser

Package Description

BanjoByTheBay.CUE4Parse.FortniteTypes

An extension of CUE4Parse that adds easier access to Fortnite-specific types!

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on CUE4Parse:

Repository Stars
rm-NoobInCoding/UnrealReZen
UnrealReZen is a modding tool for packing utoc and ucas files (Unreal Engine IoStore archive files)
Version Downloads Last updated
1.1.1 1,467 2/14/2024
1.1.0 661 11/24/2023
1.0.9 1,398 6/13/2023
1.0.8 221 6/9/2023
1.0.7 402 5/12/2023
1.0.6-pre 176 5/4/2023
1.0.5 251 5/3/2023
1.0.4 890 12/6/2022
1.0.3 381 12/6/2022
1.0.2 1,043 9/10/2022
1.0.1 489 8/22/2022
1.0.0 3,189 8/22/2022