Home

Awesome

Nuget Nuget

UELib

The Unreal library (UELib) provides you an API to read (parse/deserialize) the contents of Unreal Engine game package files such as .UDK, .UPK. Its main purpose is to decompile the UnrealScript byte-code to its original source-code.

It accomplishes this by reading the necessary Unreal data classes such as:

UObject, UField, UConst, UEnum, UProperty, UStruct, UFunction, UState, UClass,
UTextBuffer, UMetaData, UPackage

Classes such as UStruct, UState, UClass, and UFunction contain the UnrealScript byte-code which we can deserialize in order to re-construct the byte-codes to its original UnrealScript source.

Additionally UELib is also capable of deserializing of many more data classes such as:

UFont, USound, UPalette, UTexture,
UTexture2D, UTexture2DDynamic, UTexture2DComposite, UTexture3D,
UTextureCube, UTextureFlipBook, UTextureMovie
UPrimitive, UPolys

How to use

To use this library you will need .NET Framework 4.8 (The library will move to .NET 6 or higher at version 2.0)

Install using either:

    Install-Package Eliot.UELib
    using UELib;

    // Instantiates a FileStream and deserializes the package's header, will also auto-detected a suitable build to associate the package with.
    var package = UnrealLoader.LoadPackage(@"C:\Path\Package.upk", System.IO.FileAccess.Read);
    Console.WriteLine($"Version: {package.Summary.Version}");

    // Necessary if working with packages that have been cooked for a console platform, and IF the build was not properly auto-detected.
    // package.CookerPlatform = BuildPlatform.Console;

    // Initializes the registered classes, constructs and deserializes(loads) the package objects.
    package.InitializePackage();

    // Now we can iterate over all the initialized objects, but beware! This includes fake-import objects.
    foreach (var obj in package.Objects)
    {
        // If positive then we have an export, or import if negative, if null, we are working with a 'None' object, but this shouldn't occur here.
        if ((int)obj > 0)
        {
            Console.WriteLine($"Export:");
        }
        else if ((int)obj < 0)
        {
            Console.WriteLine($"Import:");
        }

        Console.WriteLine($"ObjectIndex: {(int)obj}");
        Console.WriteLine($"Name: {obj.Name}");
        Console.WriteLine($"Class: {obj.Class?.Name}");
        Console.WriteLine($"Outer: {obj.Outer}");
        Console.WriteLine($"Path: {obj.GetReferencePath()}");
    }

If you're looking to modify the library for the sole purpose of modding UE Explorer, I recommend you to clone or fork this repository and install UE Explorer within your UELib/src/bin/Debug/ folder, or change the project's configuration to build inside of the UE Explorer's folder.

Compatible Games

This is a table of games that are confirmed to be compatible with the current state of UELib, the table is sorted by Package-Version.

NameEngine:BranchPackage/LicenseeSupport State
Unreal100-22661/000
Star Trek: The Next Generation: Klingon Honor Guard21961/000
X-COM: Alliance200-22061/000Bad output at the start of functions (BeginFunctionToken)
Dr. Brain: Action Reaction22463-68/000
Nerf Arena Blast22563-68/000
The Wheel of Time225:WoT63-68/000
Unreal Mission Pack: Return to Na Pali226b68/000
Unreal Tournament338-43668-69/000
Deus Ex400-43668/000
Jazz Jackrabbit 3D40068/000
Duke Nukem Forever (2001)61368/002UStruct offsets are off leading to bad output code
Rune40069/000
Unrealty40569/000
X-COM: Enforcer42069/000
Tactical Ops: Assault on Terror43669/000
Star Trek: Deep Space Nine: The Fallen33873/000
Harry Potter and the Sorcerer's Stone43676/000
Harry Potter and the Chamber of Secrets43379/000
Disney's Brother Bear43380/000Link
Mobile Forces43681-83/000, 69
Clive Barker's Undying42072-85/000Versions 72 to 83 are not auto detected.
Thief: Deadly Shadows777:Flesh95/133LinkedData not supported
Deus Ex: Invisible War777:Flesh95/069LinkedData not supported
XIII829100/058
Postal 2: Paradise Lost1417118/002
Tom Clancy's Splinter Cell829100/017
Tom Clancy's Rainbow Six 3: Raven Shield600-927118/012-014
Unreal Tournament 20031077-2225119/025
Devastation600-?118-120/004-008
Unreal II: The Awakening829-2001126/2609
Unreal II: eXpanded MultiPlayer2226126/000Custom features are not decompiled
Unreal Tournament 20043120-3369128/029
America's Army 23339128/032:0332.5, 2.6, 2.8
America's Army (Arcade)3339128/0322.6
Red Orchestra: Ostfront 41-453323-3369128/029
Killing Floor3369128/029
Battle Territory: Battery3369128/029?
Vanguard: Saga of HeroesUnknown129/035
Harry Potter and the Prisoner of Azkaban2226129/000Link
Shrek 22226129
Shark Tale2226129/003
Lemony Snicket's A Series of Unfortunate Events2226129/003
Swat 42226:Vengeance129/027
Tribes: Vengeance2226:Vengeance130/027
Bioshock2226:Vengeance130-141/056
Bioshock 22226:Vengeance143/059
Unreal Championship 2: Liandri Conflict3323151/002Third-party
The Chronicles of Spellborn3323159/029
Duke Nukem Forever (2011)Unknown156/036Extraction is required
Tom Clancy's EndWarUnknown329/000
Roboblitz2306369/006
Medal of Honor: Airborne2859421/011
Frontlines: Fuel of War2917433/052Poor output of functions
Army of Two3004445/079Overall quality has not been verified
Mortal Kombat Komplete Edition2605472/046
Stargate Worlds3004486/007
Gears of War3329490/009
Unreal Tournament 33809512/000
Mirrors Edge3716536/043
Alpha Protocol3857539/091
APB: All Points Bulletin3908547/028-032
X-Men Origins: Wolverine4206568/101Overall quality has not been verified
Gears of War 24638575/000
CrimeCraft4701576/005
Batman: Arkham Asylum4701576/21
Medal of Honor (2010)100075???581/058Bad byte-codes
Singularity4869584/126
MoonBase Alpha4947587/000
SawUnknown584/003
The Exiled Realm of Arborea or TERA4206610/014
Monday Night Combat5697638/000
DC Universe Online5859638/6405
Unreal Development Kit5860-12791664-868
Blacklight: Tango Down6165673/002
Dungeons & Dragons: Daggerdale6165674/000
Dungeon Defenders6262678/002
Alice Madness Returns6760690/000
The Ball6699706/000
Bioshock Infinite6829727/075
Bulletstorm7052742/029
Red Orchestra 2: Heroes of Stalingrad7258765/Unknown
Rising Storm 2: Vietnam7258765/771
Aliens: Colonial Marines4170787/047
Infinity Blade 17595788/001Console
Dishonored9099801/030
Tribes: Ascend7748805/Unknown
Tony Hawk's Pro Skater HD
Rock of Ages7748805/000
Batman: Arkham City7748805/101
Batman: Arkham Origins7748807/138Not verified
Sanctum7876810/000
AntiChamber7977812/000
Waves8171813/000
Super Monday Night Combat8364820/000
Gears of War 38653828/000
Quantum Conundrum8623832/32870
Borderlands4871Unknown
Borderlands 28623/0023832/056
Borderlands: Game of the Year Enhanced5001/0001832/058
Remember Me8623832/021
The Haunted: Hells Reach8788841/000
Asura's Wrath8788841/000-zlib; platform needs to be set to console.
Blacklight Retribution8788-10499841-864/002
Infinity Blade 29059842-864/001Console
Q.U.B.E8916845/000
DmC: Devil May Cry8916845/004
XCOM: Enemy Unknown8916845/059
Gears of War: Judgement10566846/000
InMomentum8980848/000
Unmechanical9249852/000
Deadlight9375854/000
Land of the Dead9375854/000
Ravaged9641859/000
The Five Cores9656859/000
Painkiller HD9953860/000
Chivalry: Medieval Warfare10246860/000
Hawken10681860/004
Rocket League10897867/009 (868/032 has not been tested)Decryption required
Styx: Master of Shadows10499860/004
Batman: Arkham Knight863/32995Not verified
Gigantic: Rampage Edition19100867/010
Infinity Blade 3868/000Console
Guilty Gear Xrd10246868/003Decryption required
Might & Magic Heroes VII12161868/004(Signature and custom features are not supported)
Bombshell11767870/000
Orcs Must Die! Unchained20430870/000
Gal*Gun: Double Peace10897871/000
Battleborn8623/1055874/078
A Hat in Time12097877-893/005
Shadow Complex Remastered10897893/001
Soldier Front 26712904/009
Rise of the Triad10508Unknown
Outlast12046Unknown
Sherlock Holmes: Crimes and Punishments10897Unknown
Alien Rage7255Unknown

Beware, opening an unsupported package could crash your system! Make sure you have saved everything before opening any file!

Note UE3 production-ready packages are often compressed and must first be decompressed, Unreal Package Decompressor by Gildor is a tool that can decompress most packages for you; for some games you need a specialized decompressor, see for example RLUPKTool.

Want to add support for a game? See adding support for new Unreal classes

Do you know a game that is compatible but is not listed here? Click on the top right to edit this file!

How to contribute

Special thanks to