diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 5a41629d..00000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,70 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ master ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - schedule: - - cron: '45 13 * * 3' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'csharp' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://git.io/codeql-language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 20ac38b2..47a11edc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,28 +1,35 @@ -name: Build .NET and Publish to NuGet +name: Build .NET Framework and Publish to NuGet on: + workflow_dispatch: push: - branches: [ master ] + tags: + - 'release-*' + - 'hotfix-*' jobs: build: - - runs-on: ubuntu-latest - + runs-on: windows-2019 + steps: - - uses: actions/checkout@v3 - - name: Setup .NET - uses: actions/setup-dotnet@v2 - with: - dotnet-version: 5.0.x + - uses: actions/checkout@v4 + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v1.3 + + - name: Setup NuGet + uses: NuGet/setup-nuget@v1 + - name: Restore dependencies - run: dotnet restore src/Eliot.UELib.csproj + run: nuget restore src/Eliot.UELib.csproj + - name: Build - run: dotnet build src/Eliot.UELib.csproj --no-restore - - name: Test - run: dotnet test src/Eliot.UELib.csproj --no-build --verbosity normal + run: msbuild src/Eliot.UELib.csproj -t:rebuild -property:Configuration=Publish + - name: Publish Eliot.UELib - uses: brandedoutcast/publish-nuget@v2.5.5 + uses: alirezanet/publish-nuget@v3.1.0 with: PROJECT_FILE_PATH: src/Eliot.UELib.csproj - NUGET_KEY: ${{secrets.NUGET_API_KEY}} + VERSION_FILE_PATH: src/Properties/AssemblyInfo.cs + VERSION_REGEX: AssemblyFileVersion\(\"(.*)\"\) + NUGET_KEY: ${{ secrets.NUGET_API_KEY }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e37a851d..06c469a8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,9 +2,9 @@ name: Test Solution on: push: - branches: [ master ] + #branches: [ master ] pull_request: - branches: [ master ] + #branches: [ master ] jobs: build: @@ -14,9 +14,9 @@ jobs: working-directory: ./src steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup .NET - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v3 with: # Legacy versions not supported? :( # 5.0 will likely not work yet due legacy dependencies... diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..1893b893 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,18 @@ +# [1.3.1](https://github.com/EliotVU/Unreal-Library/releases/tag/1.3.1) + +* Improved support for Batman series +* Improved support for Transformers series +* Fixed the decompilation of UnrealScript casting byte-codes that were swapped i.e. `InterfaceToBool` with `InterfaceToObject`. +* Fixed a missing package version check in UStateFrame (this affected some object classes that are usually found in map package files). +* Added the capability to override the interpreted version for packages of builds that are auto-detected. + +# [1.3.0](https://github.com/EliotVU/Unreal-Library/releases/tag/1.3.0.0) + +* Support for Vengeance which includes BioShock 1 & 2, Swat4, and Tribes: Vengeance +* Support for Batman series (to the release branch, incomplete) +* Support for Thief: Deadly Shadows and Deus Ex: Invisible War +* Support for [America's Army 2 (and Arcade)](https://github.com/EliotVU/Unreal-Library/commit/4ae2ae2d25d8101495f0a7ae8d080156fd4bd10f) +* Support for Unreal II: eXpanded MultiPlayer +* Support for [The Chronicles of Spellborn](https://github.com/EliotVU/Unreal-Library/commit/0747049acfcf258efdcee746bf236243c87edc37) +* Improved general support for UE1 (Unreal 1), UE2 (Rainbow Six etc) & UE2.5, and UE3 (UDK etc) +* Fixes to DefaultProperties diff --git a/README.md b/README.md index 953e22ee..b1167fc4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# UELib +[![Nuget](https://img.shields.io/nuget/dt/Eliot.UELib?style=for-the-badge)](https://www.nuget.org/packages/Eliot.UELib/) +[![Nuget](https://img.shields.io/nuget/v/Eliot.UELib?style=for-the-badge)](https://www.nuget.org/packages/Eliot.UELib/) -[![Nuget](https://img.shields.io/nuget/dt/Eliot.UELib.dll?style=for-the-badge)](https://www.nuget.org/packages/Eliot.UELib.dll/) -[![Nuget](https://img.shields.io/nuget/v/Eliot.UELib.dll?style=for-the-badge)](https://www.nuget.org/packages/Eliot.UELib.dll/) +# 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. @@ -22,71 +22,104 @@ Install using either: * Package Manager: ``` cmd -Install-Package Eliot.UELib.dll + Install-Package Eliot.UELib +``` +* NuGet: + +* Usage: See the [documentation](https://github.com/EliotVU/Unreal-Library/wiki/Usage) for more examples. + +```csharp + var package = UnrealLoader.LoadPackage(@"C:\Path\Package.upk", System.IO.FileAccess.Read); + Console.WriteLine($"Version: {package.Summary.Version}"); + + // Initializes the registered classes, constructs and deserializes(loads) the package objects. + package.InitializePackage(); + + // Now we can iterate all loaded objects, but beware! This includes fake-import objects. + foreach (var obj in package.Objects) + { + Console.WriteLine($"Name: {obj.Name}"); + Console.WriteLine($"Class: {obj.Class?.Name}"); + Console.WriteLine($"Outer: {obj.Outer}"); + } ``` -* NuGet: - -See [usage](https://github.com/EliotVU/Unreal-Library/wiki/Usage) for further instructions on how to use the library in your project. - -If you're looking to modify the library for the sole purpose of modding [UE Explorer](https://eliotvu.com/portfolio/view/21/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. - -Want to try out the [latest library release](https://github.com/EliotVU/Unreal-Library/releases)? Then you can simply save ```Eliot.UELib.dll``` to the folder where you have installed UE Explorer at. Note that the current release of UE Explorer is using version [1.2.7.1](https://github.com/EliotVU/Unreal-Library/releases/tag/release-1.2.7.1). - -## How to contribute - -* Open an issue -* Or make a pull-request by creating a [fork](https://help.github.com/articles/fork-a-repo/) of this repository, create a new branch and commit your changes to that particular branch, so that I can easily merge your changes. +If you're looking to modify the library for the sole purpose of modding [UE Explorer](https://github.com/UE-Explorer/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. -| Name | Engine | Package/Licensee | Support State | -| ------- | --------- | ------------------- | ----------------- +| Name | Engine:Branch | Package/Licensee | Support State | +| --------------------- | ---------------- | ------------------- | ----------------- | Unreal | 100-226 | 61/000 | | -| [Star Trek: The Next Generation: Klingon Honor Guard](Star%20Trek:%20The%20Next%20Generation:%20Klingon%20Honor%20Guard) | Unknown | 61/000 | | +| [Star Trek: The Next Generation: Klingon Honor Guard](Star%20Trek:%20The%20Next%20Generation:%20Klingon%20Honor%20Guard) | 219 | 61/000 | | +| X-COM: Alliance | 200-220 | 61/000 | Bad output at the start of functions (BeginFunctionToken) | +| Dr. Brain: Action Reaction | 224 | 63-68/000 | | +| Nerf Arena Blast | 225 | 63-68/000 | | +| The Wheel of Time | 225:WoT | 63-68/000 | | | Unreal Mission Pack: Return to Na Pali | 226b | 68/000 | | -| Unreal Tournament | 338-436 | 68/000 | | -| Deus Ex | Unknown | Unknown | | -| Thief: Deadly Shadows | Thief | 95/133 | LinkedData not supported | -| Deus Ex: Invisible War | Thief | 95/069 | LinkedData not supported | +| Unreal Tournament | 338-436 | 68-69/000 | | +| Deus Ex | 400-436 | 68/000 | | +| Jazz Jackrabbit 3D | 400 | 68/000 | | +| Duke Nukem Forever (2001) | 613 | 68/002 | UStruct offsets are off leading to bad output code | +| Rune | 400 | 69/000 | | +| Unrealty | 405 | 69/000 | | +| X-COM: Enforcer | 420 | 69/000 | | +| Tactical Ops: Assault on Terror | 436 | 69/000 | | +| Star Trek: Deep Space Nine: The Fallen | 338 | 73/000 | | +| Harry Potter and the Sorcerer's Stone | 436 | 76/000 | | +| Harry Potter and the Chamber of Secrets | 433 | 79/000 | | +| Disney's Brother Bear | 433 | 80/000 | [Link](https://github.com/metallicafan212/HarryPotterUnrealWiki/wiki/Main-Resources#other-kw-games) | +| Mobile Forces | 436 | 81-83/000, 69 | | +| Clive Barker's Undying | 420 | 72-85/000 | Licensee modifications are supported in the "develop" branch. Versions 72 to 83 are not auto detected. | +| Thief: Deadly Shadows | 777:Flesh | 95/133 | LinkedData not supported | +| Deus Ex: Invisible War | 777:Flesh | 95/069 | LinkedData not supported | | | | | | | | | | | | XIII | 829 | 100/058 | | +| Postal 2: Paradise Lost | 1417 | 118/002 | | | Tom Clancy's Splinter Cell | 829 | 100/017 | | -| Tom Clancy's Rainbow Six 3: Raven Shield | 927 | 118/012:014 | | +| Tom Clancy's Rainbow Six 3: Raven Shield | 600-927 | 118/012-014 | | | Unreal Tournament 2003 | 1077-2225 | 119/025 | | | Devastation | 600-? | 118-120/004-008 | | | Unreal II: The Awakening | 829-2001 | 126/2609 | | | Unreal II: eXpanded MultiPlayer | 2226 | 126/000 | Custom features are not decompiled | | Unreal Tournament 2004 | 3120-3369 | 128/029 | | -| America's Army 2 | 3369 | 128/032:033 | 2.5, 2.6, 2.8 | -| America's Army (Arcade) | 3369 | 128/032 | 2.6 | +| America's Army 2 | 3339 | 128/032:033 | 2.5, 2.6, 2.8 | +| America's Army (Arcade) | 3339 | 128/032 | 2.6 | | Red Orchestra: Ostfront 41-45 | 3323-3369 | 128/029 | | | Killing Floor | 3369 | 128/029 | | -| Battle Territory Battery | Unknown | Unknown | | +| Battle Territory: Battery | 3369 | 128/029? | | | Vanguard: Saga of Heroes | Unknown | 129/035 | | -| Swat 4 | Vengeance | 129/027 | | -| Tribes: Vengeance | Vengeance | 130/027 | | -| Bioshock | Vengeance | 130-141/056 | | -| Bioshock 2 | Vengeance | 143/059 | | -| Unreal Championship 2: Liandri Conflict | 3323 | 151/002 | (Third-party) | -| The Chronicles of Spellborn | Unknown | 159/029 | | +| Harry Potter and the Prisoner of Azkaban | 2226 | 129/000 | [Link](https://github.com/metallicafan212/HarryPotterUnrealWiki/wiki/Main-Resources#hp3) | +| Shrek 2 | 2226 | 129 | | +| Shark Tale | 2226 | 129/003 | | +| Lemony Snicket's A Series of Unfortunate Events | 2226 | 129/003 | | +| Swat 4 | 2226:Vengeance | 129/027 | | +| Tribes: Vengeance | 2226:Vengeance | 130/027 | | +| Bioshock | 2226:Vengeance | 130-141/056 | | +| Bioshock 2 | 2226:Vengeance | 143/059 | | +| Unreal Championship 2: Liandri Conflict | 3323 | 151/002 | [Third-party](https://forums.beyondunreal.com/threads/unreal-championship-2-script-decompiler-release.206036/) | +| The Chronicles of Spellborn | 3323 | 159/029 | | | Duke Nukem Forever (2011) | Unknown | 156/036 | [Extraction is required](https://github.com/DaZombieKiller/MegaPackageExtractor) | | | | | | | | | | | | Roboblitz | 2306 | 369/006 | | | Medal of Honor: Airborne | 2859 | 421/011 | | +| Frontlines: Fuel of War | 2917 | 433/052 | Poor output of functions; better support in the "develop" branch | +| Army of Two | 3004 | 445/079 | Overall quality has not been verified | | Mortal Kombat Komplete Edition | 2605 | 472/046 | | | Stargate Worlds | 3004 | 486/007 | | | Gears of War | 3329 | 490/009 | | | Unreal Tournament 3 | 3809 | 512/000 | | | Mirrors Edge | 3716 | 536/043 | | | Alpha Protocol | 3857 | 539/091 | | -| APB: All Points Bulletin | 3908 | 547/028:032 | | +| APB: All Points Bulletin | 3908 | 547/028-032 | | +| X-Men Origins: Wolverine | 4206 | 568/101 | Overall quality has not been verified | | Gears of War 2 | 4638 | 575/000 | | | CrimeCraft | 4701 | 576/005 | | +| Batman: Arkham Asylum | 4701 | 576/21 | | | Medal of Honor (2010) | 100075??? | 581/058 | Bad byte-codes | | Singularity | 4869 | 584/126 | | | MoonBase Alpha | 4947 | 587/000 | | @@ -94,7 +127,7 @@ This is a table of games that are confirmed to be compatible with the current st | The Exiled Realm of Arborea or TERA | 4206 | 610/014 | | | Monday Night Combat | 5697 | 638/000 | | | DC Universe Online | 5859 | 638/6405 | | -| Unreal Development Kit | 6094-12791 | 664-868 | | +| Unreal Development Kit | 5860-12791 | 664-868 | | | Blacklight: Tango Down | 6165 | 673/002 | | | Dungeons & Dragons: Daggerdale | 6165 | 674/000 | | | Dungeon Defenders | 6262 | 678/002 | Earlier releases only | @@ -103,41 +136,54 @@ This is a table of games that are confirmed to be compatible with the current st | Bioshock Infinite | 6829 | 727/075 | | | Bulletstorm | 7052 | 742/029 | | | Red Orchestra 2: Heroes of Stalingrad | 7258 | 765/Unknown | | -| Aliens: Colonial Marines | Unknown | 787/047 | | +| Rising Storm 2: Vietnam | 7258 | 765/771 | | +| Aliens: Colonial Marines | 4170 | 787/047 | | | [Dishonored](http://www.dishonored.com/) | 9099 | 801/030 | | | Tribes: Ascend | 7748 | 805/Unknown | | +| Tony Hawk's Pro Skater HD | | | Rock of Ages | 7748 | 805/000 | | +| Batman: Arkham City | 7748 | 805/101 | | +| Batman: Arkham Origins | 7748 | 807/138 | Not verified | | Sanctum | 7876 | 810/000 | | | AntiChamber | 7977 | 812/000 | | | Waves | 8171 | 813/000 | | | Super Monday Night Combat | 8364 | 820/000 | | | Gears of War 3 | 8653 | 828/000 | | | Quantum Conundrum | 8623 | 832/32870 | | -| Borderlands | Unknown | Unknown | | +| Borderlands | 4871 | Unknown | | | Borderlands 2 | 8623/023 | 832/056 | | | Remember Me | 8623 | 832/021 | | | The Haunted: Hells Reach | 8788 | 841/000 | | +| Asura's Wrath | 8788 | 841/000 | -zlib; platform needs to be set to console. | | Blacklight Retribution | 8788-10499 | 841-864/002 | | | Infinity Blade 2 | 9059 | 842/001 | | | Q.U.B.E | 8916 | 845/000 | | +| DmC: Devil May Cry | 8916 | 845/004 | | | XCOM: Enemy Unknown | 8916 | 845/059 | | | Gears of War: Judgement | 10566 | 846/000 | | | InMomentum | 8980 | 848/000 | | | [Unmechanical](http://unmechanical.net/) | 9249 | 852/000 | | | Deadlight | 9375 | 854/000 | | +| Land of the Dead | 9375 | 854/000 | | | Ravaged | 9641 | 859/000 | | | [The Five Cores](http://neeblagames.com/category/games/thefivecores/) | 9656 | 859/000 | | | Painkiller HD | 9953 | 860/000 | | -| Hawken | 10681 | 860/004 | | +| Chivalry: Medieval Warfare | 10246 | 860/000 | | +| Hawken | 10681 | 860/004 | /002 is not auto-detected | | Rocket League | 10897 | 867/009 (868/032 has not been tested) | [Decryption required](https://github.com/AltimorTASDK/RLUPKTool) | +| Styx: Master of Shadows | 10499 | 860/004 | | +| Batman: Arkham Knight | | 863/32995 | Not verified | | Guilty Gear Xrd | 10246 | 868/003 | [Decryption required](https://github.com/gdkchan/GGXrdRevelatorDec) | -| Gal*Gun: Double Peace | 10897 | 871/000 | | +| Bombshell | 11767 | 870/000 | | +| Orcs Must Die! Unchained | 20430 | 870/000 | | +| Gal\*Gun: Double Peace | 10897 | 871/000 | | | [Might & Magic Heroes VII](https://en.wikipedia.org/wiki/Might_%26_Magic_Heroes_VII) | 12161 | 868/004 | (Signature and custom features are not supported) +| Shadow Complex Remastered | 10897 | 893/001 | | | Soldier Front 2 | 6712 | 904/009 | | -| Rise of the Triad | Unknown | Unknown | | -| Outlast | Unknown | Unknown | | -| Sherlock Holmes: Crimes and Punishments | Unknown | Unknown | | -| Alien Rage | Unknown | Unknown | | +| Rise of the Triad | 10508 | Unknown | | +| Outlast | 12046 | Unknown | | +| Sherlock Holmes: Crimes and Punishments | 10897 | Unknown | | +| Alien Rage | 7255 | Unknown | | **Beware, opening an unsupported package could crash your system! Make sure you have saved everything before opening any file!** @@ -147,3 +193,16 @@ saved everything before opening any file!** Want to add support for a game? See [adding support for new Unreal classes](https://github.com/EliotVU/Unreal-Library/wiki/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 + +* Open an issue +* Or make a pull-request by creating a [fork](https://help.github.com/articles/fork-a-repo/) of this repository, create a new branch and commit your changes to that particular branch, so that I can easily merge your changes. + +## Special thanks to + + * Epic Games for [UDN: Packages](http://www.hypercoop.tk/infobase/archive/unrealtech/Packages.htm) (general package format) + * [Antonio Cordero Balcazar](https://github.com/acorderob) for [UTPT](https://www.acordero.org/projects/unreal-tournament-package-tool) (game support) and documentation (format) + * [Dmitry Jemerov](https://github.com/yole) for [unhood](https://github.com/yole/unhood) (early UE3 format) + * [Konstantin Nosov](https://github.com/gildor2) for providing help and [UE Viewer](http://www.gildor.org/en/projects/umodel) (game support) + * [Contributors](https://github.com/EliotVU/Unreal-Library/graphs/contributors) diff --git a/src/Branch/UE3/RSS/Tokens/Bm4ContextToken.cs b/src/Branch/UE3/RSS/Tokens/Bm4ContextToken.cs new file mode 100644 index 00000000..86d19950 --- /dev/null +++ b/src/Branch/UE3/RSS/Tokens/Bm4ContextToken.cs @@ -0,0 +1,9 @@ +using UELib.Core; + +namespace UELib.Branch.UE3.RSS.Tokens +{ + public class Bm4ContextToken : UStruct.UByteCodeDecompiler.ContextToken + { + + } +} \ No newline at end of file diff --git a/src/ByteCodeDecompiler.cs b/src/ByteCodeDecompiler.cs index 88e33286..0d9c0bd8 100644 --- a/src/ByteCodeDecompiler.cs +++ b/src/ByteCodeDecompiler.cs @@ -13,6 +13,7 @@ namespace UELib.Core { using System.Linq; using System.Text; + using UELib.Branch.UE3.RSS.Tokens; public partial class UStruct { @@ -223,7 +224,7 @@ private Token DeserializeNext() #if DECOMPILE - #region Decompile +#region Decompile public class NestManager { @@ -878,9 +879,9 @@ private string DecompileNests(bool outputAllRemainingNests = false) return output; } - #endregion +#endregion - #region Disassemble +#region Disassemble [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] public string Disassemble() @@ -888,7 +889,7 @@ public string Disassemble() return string.Empty; } - #endregion +#endregion #endif } diff --git a/src/Core/Classes/UClass.cs b/src/Core/Classes/UClass.cs index 6e4114e3..723aa3fb 100644 --- a/src/Core/Classes/UClass.cs +++ b/src/Core/Classes/UClass.cs @@ -302,6 +302,15 @@ protected override void Deserialize() if (_Buffer.Version > 670) { AutoCollapseCategories = DeserializeGroup("AutoCollapseCategories"); +#if BATMAN + // Only attested in bm4 with no version check. + if (_Buffer.Package.Build == BuildGeneration.RSS && + _Buffer.Package.Build == UnrealPackage.GameBuild.BuildName.Batman4) + { + IList bm4_v198; + bm4_v198 = DeserializeGroup(nameof(bm4_v198)); + } +#endif } if (_Buffer.Version >= (uint)PackageObjectLegacyVersion.ForceScriptOrderAddedToUClass diff --git a/src/Core/Classes/UObject.cs b/src/Core/Classes/UObject.cs index df9e0843..57a0f013 100644 --- a/src/Core/Classes/UObject.cs +++ b/src/Core/Classes/UObject.cs @@ -314,7 +314,13 @@ protected virtual void Deserialize() { _Buffer.ReadClass(out StateFrame); } - +#if MKKE || BATMAN + if (Package.Build == UnrealPackage.GameBuild.BuildName.MKKE || + Package.Build == UnrealPackage.GameBuild.BuildName.Batman4) + { + goto skipNetIndex; + } +#endif // No version check found in the GoW PC client if (_Buffer.Version >= (uint)PackageObjectLegacyVersion.TemplateDataAddedToUComponent) { @@ -334,6 +340,7 @@ protected virtual void Deserialize() } } } + skipNetIndex: DeserializeNetIndex(); #if THIEF_DS || DEUSEX_IW diff --git a/src/Core/Tokens/FieldTokens.cs b/src/Core/Tokens/FieldTokens.cs index a1409aac..8995c716 100644 --- a/src/Core/Tokens/FieldTokens.cs +++ b/src/Core/Tokens/FieldTokens.cs @@ -68,7 +68,7 @@ public override string Decompile() return $"default.{base.Decompile()}"; } } - + public class UndefinedVariableToken : Token { public override string Decompile() diff --git a/src/Eliot.UELib.csproj b/src/Eliot.UELib.csproj index e9cc3d1f..5046e07f 100644 --- a/src/Eliot.UELib.csproj +++ b/src/Eliot.UELib.csproj @@ -11,6 +11,7 @@ UELib Eliot.UELib v4.8 + 7.3 512 publish\ true @@ -122,6 +123,7 @@ + @@ -336,7 +338,17 @@ --> - - + Eliot.UELib.nuspec + $(NuspecProperties);configuration=$(Configuration) + $(NuspecProperties);version=$(Version) + $(NuspecProperties);id=$(PackageId) + $(NuspecProperties);author=$(Authors) + $(NuspecProperties);PackageProjectUrl=$(PackageProjectUrl) + $(NuspecProperties);Description=$(Description) + $(NuspecProperties);PackageReleaseNotes=$(PackageReleaseNotes) + $(NuspecProperties);Copyright=$(Copyright) + $(NuspecProperties);PackageTags=$(PackageTags) + $(NuspecProperties);RepositoryType=$(RepositoryType) + $(NuspecProperties);RepositoryUrl=$(RepositoryUrl) \ No newline at end of file diff --git a/src/Eliot.UELib.nuspec b/src/Eliot.UELib.nuspec index 63a7bea1..745b0118 100644 --- a/src/Eliot.UELib.nuspec +++ b/src/Eliot.UELib.nuspec @@ -1,23 +1,23 @@ - - Eliot.UELib.dll - $version$ - Eliot - Eliot - MIT - - https://github.com/EliotVU/Unreal-Library - false - UELib - A library for parsing data from games built with the Unreal Engine such as .u, and .upk files. - docs\README.md - Copyright (c) Eliot van Uytfanghe - UnrealEngine UnrealScript Decompiler UPK Explorer Viewer Exporter - - - - - - + + $id$ + $version$ + Eliot + Eliot + MIT + https://github.com/EliotVU/Unreal-Library + false + $title$ + $description$ + docs\README.md + docs\CHANGELOG.md + $copyright$ + UnrealEngine UnrealScript Decompiler UPK Explorer Viewer Exporter Bytecode + + + + + + \ No newline at end of file diff --git a/src/Properties/AssemblyInfo.cs b/src/Properties/AssemblyInfo.cs index de5fc5c0..0761bf59 100644 --- a/src/Properties/AssemblyInfo.cs +++ b/src/Properties/AssemblyInfo.cs @@ -5,8 +5,8 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("UELib")] -[assembly: AssemblyDescription("A library for parsing Unreal Engine packages.")] -[assembly: AssemblyConfiguration("")] +[assembly: AssemblyDescription("UnrealScript decompiler library for Unreal package files (.upk, .u, .uasset; etc), with support for Unreal Engine 1, 2, and 3.")] +[assembly: AssemblyConfiguration("Publish")] [assembly: AssemblyCompany("EliotVU")] [assembly: AssemblyProduct("UELib")] [assembly: AssemblyCopyright("© 2009-2022 Eliot van Uytfanghe. All rights reserved.")] @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.3.0.0")] -[assembly: AssemblyFileVersion("1.3.0.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.3.1")] +[assembly: AssemblyFileVersion("1.3.1")] \ No newline at end of file diff --git a/src/UnrealBuild.cs b/src/UnrealBuild.cs index 7c0cce14..cd016367 100644 --- a/src/UnrealBuild.cs +++ b/src/UnrealBuild.cs @@ -21,7 +21,7 @@ public enum BuildGeneration /// Modified version for Harry Potter's Unreal Engine 1 /// HP, - + /// /// Unreal Engine 2 /// @@ -43,12 +43,12 @@ public enum BuildGeneration /// The Unreal Engine 2.5 engine used in the America's Army series. /// AGP, - + /// /// Heavily modified Unreal Engine 2.5 for Vengeance: Tribes; also used by Swat4 and BioShock. /// Vengeance, - + /// /// Heavily modified Unreal Engine 2.5 for Splinter Cell /// @@ -67,7 +67,7 @@ public enum BuildGeneration /// Not in use yet. /// UE3, - + /// /// Rocksteady Studios /// diff --git a/src/UnrealPackage.cs b/src/UnrealPackage.cs index 66d704fa..34142f28 100644 --- a/src/UnrealPackage.cs +++ b/src/UnrealPackage.cs @@ -230,8 +230,8 @@ public enum BuildName /// /// 118:120/004:008 /// - [BuildEngineBranch(typeof(EngineBranchDVS))] - [Build(118, 120, 4u, 8u)] Devastation, + [BuildEngineBranch(typeof(EngineBranchDVS))] [Build(118, 120, 4u, 8u)] + Devastation, /// /// Tom Clancy's Rainbow Six 3: Raven Shield @@ -598,22 +598,20 @@ public enum BuildName public BuildName Name { get; } - [Obsolete] - public uint Version { get; } - - [Obsolete] - public uint LicenseeVersion { get; } - + [Obsolete] public uint Version { get; } + + [Obsolete] public uint LicenseeVersion { get; } + public uint? OverrideVersion { get; } public ushort? OverrideLicenseeVersion { get; } public BuildGeneration Generation { get; } [CanBeNull] public readonly Type EngineBranchType; - [Obsolete("To be deprecated")] - public readonly BuildFlags Flags; + [Obsolete("To be deprecated")] public readonly BuildFlags Flags; - public GameBuild(uint overrideVersion, ushort overrideLicenseeVersion, BuildGeneration generation, Type engineBranchType, + public GameBuild(uint overrideVersion, ushort overrideLicenseeVersion, BuildGeneration generation, + Type engineBranchType, BuildFlags flags) { OverrideVersion = overrideVersion; @@ -860,7 +858,8 @@ private void SetupBuild(UnrealPackage package) } if (package.Build.OverrideVersion.HasValue) Version = package.Build.OverrideVersion.Value; - if (package.Build.OverrideLicenseeVersion.HasValue) LicenseeVersion = package.Build.OverrideLicenseeVersion.Value; + if (package.Build.OverrideLicenseeVersion.HasValue) + LicenseeVersion = package.Build.OverrideLicenseeVersion.Value; if (OverrideVersion != 0) Version = OverrideVersion; if (OverrideLicenseeVersion != 0) LicenseeVersion = OverrideLicenseeVersion; @@ -962,7 +961,7 @@ public void Deserialize(IUnrealStream stream) SetupBuild(stream.Package); Debug.Assert(stream.Package.Build != null); Console.WriteLine("Build:" + stream.Package.Build); - + SetupBranch(stream.Package); Debug.Assert(stream.Package.Branch != null); Console.WriteLine("Branch:" + stream.Package.Branch); @@ -1069,7 +1068,7 @@ public void Deserialize(IUnrealStream stream) // An FString converted to an FArray? Concatenating appUserName, appComputerName, appBaseDir, and appTimestamp. stream.ReadArray(out UArray iStack_fc); - } + } #endif #if BORDERLANDS if (stream.Package.Build == GameBuild.BuildName.Borderlands) stream.Skip(4); @@ -1708,9 +1707,9 @@ public void InitializePackage(InitFlags initFlags = InitFlags.All) { if ((initFlags & InitFlags.RegisterClasses) != 0) RegisterExportedClassTypes(); - if ((initFlags & InitFlags.Construct) != 0) + if ((initFlags & InitFlags.Construct) == 0) { - ConstructObjects(); + return; } if ((initFlags & InitFlags.Deserialize) == 0) @@ -2244,4 +2243,4 @@ public void Dispose() #endregion } -} +} \ No newline at end of file