Skip to content

Commit

Permalink
Finish Release-1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
EliotVU committed Oct 18, 2024
2 parents 830e802 + 94770b6 commit 79a107c
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 49 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#

## [1.7.0](https://github.com/EliotVU/Unreal-Library/releases/tag/1.7.0)

* 0ff0ed96 Added .NET Standard 2.1 and .NET 8.0 as framework targets.
* 48b427f1 Support for Mass Effect: Legendary Edition
* 83c7ecfe Support for Men of Valor
* a226a6c7 Support for Tom Clancy's Splinter Cell: Double Agent (Offline Mode)
* 660c0c28 Support for Stargate SG-1: The Alliance
* 1dd24dc5 Improved support for Frontlines: Fuel of War

## [1.6.1](https://github.com/EliotVU/Unreal-Library/releases/tag/1.6.1)

* Added .NET Standard 2.0 as a target framework, when targeting this standard any code releated to WinForms will be excluded (This will be deprecated in its entirety with UELib 2.0)
Expand Down
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![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/)
![Platform](https://img.shields.io/badge/platform-.NET-blue.svg?style=for-the-badge)
![License](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge)

# UELib

Expand All @@ -20,19 +21,15 @@ Additionally UELib is also capable of deserializing of many more data classes su
UTextureCube, UTextureFlipBook, UTextureMovie
UPrimitive, UPolys

## How to use

To use this library you will need [.NET Framework 4.8](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net48) (The library will move to .NET 6 or higher at version 2.0)

Install using either:

* Package Manager:
## Install

```cmd
Install-Package Eliot.UELib
```

* NuGet: <https://www.nuget.org/packages/Eliot.UELib>
| Module | Version | License |
|---|---|---|
| <img src="https://img.shields.io/badge/UELib-brightgreen.svg?style=for-the-badge" /> | [![Nuget](https://img.shields.io/nuget/v/Eliot.UELib?label=Version&logo=nuget&style=for-the-badge)](https://www.nuget.org/packages/Eliot.UELib/) | ![GitHub](https://img.shields.io/github/license/EliotVU/Unreal-Library.svg?style=for-the-badge) |

* Usage: See the [documentation](https://github.com/EliotVU/Unreal-Library/wiki/Usage) for more examples.

Expand Down Expand Up @@ -112,6 +109,7 @@ This is a table of games that are confirmed to be compatible with the current st
| 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 |
| Land of the Dead: Road to Fiddler's Green | 2226 | 126/001 | |
| Unreal Tournament 2004 | 3120-3369 | 128/029 | |
| America's Army 2 | 3339 | 128/032:033 | 2.5, 2.6, 2.8 |
| America's Army (Arcade) | 3339 | 128/032 | 2.6 |
Expand All @@ -138,7 +136,7 @@ This is a table of games that are confirmed to be compatible with the current st
| Roboblitz | 2306 | 369/006 | |
| Mass Effect (Xbox 360) | 2674 | 391/092 | Xenon |
| Medal of Honor: Airborne | 2859 | 421/011 | |
| Frontlines: Fuel of War | 2917 | 433/052 | Poor output of functions |
| Frontlines: Fuel of War | 2917 | 433/052 | |
| Army of Two | 3004 | 445/079 | Overall quality has not been verified |
| Mortal Kombat Komplete Edition | 2605 | 472/046 | |
| Stargate Worlds | 3004 | 486/007 | |
Expand Down Expand Up @@ -216,6 +214,7 @@ This is a table of games that are confirmed to be compatible with the current st
| Gigantic: Rampage Edition | 19100 | 867/010 | |
| Infinity Blade 3 | | 868/000 | Console |
| Guilty Gear Xrd | 10246 | 868/003 | [Decryption required](https://github.com/gdkchan/GGXrdRevelatorDec) |
| Outlast | 12046 | 868/003 | |
| [Might & Magic Heroes VII](https://en.wikipedia.org/wiki/Might_%26_Magic_Heroes_VII) | 12161 | 868/004 | (Signature and custom features are not supported) |
| Bombshell | 11767 | 870/000 | |
| Orcs Must Die! Unchained | 20430 | 870/000 | |
Expand Down
71 changes: 50 additions & 21 deletions src/Branch/PackageObjectLegacyVersion.cs
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
namespace UELib.Branch
using System.Runtime.CompilerServices;

namespace UELib.Branch
{
public enum PackageObjectLegacyVersion
{
Undefined = 0,

/// <summary>
/// FIXME: Version 61 is the lowest package version I know that supports StateFlags.
/// FIXME: Version 61 is the lowest package version I know that supports StateFlags.
/// </summary>
AddedStateFlagsToUState = 61,

/// <summary>
/// This should mark the first approximated version with dynamic arrays that are accessible using UnrealScript.
///
/// FIXME: Version, generally not accessible in Unreal Engine 1 except for some, so we'll map the tokens for v62.
/// This should mark the first approximated version with dynamic arrays that are accessible using UnrealScript.
/// FIXME: Version, generally not accessible in Unreal Engine 1 except for some, so we'll map the tokens for v62.
/// </summary>
DynamicArrayTokensAdded = 62,

/// <summary>
/// Mixed changes.
/// Mixed changes.
/// </summary>
Release62 = 62,
ReturnExpressionAddedToReturnToken = 62,
SphereExtendsPlane = 62,
LazyArraySkipCountChangedToSkipOffset = 62,

/// <summary>
/// Mixed changes.
/// Mixed changes.
/// </summary>
Release64 = 64,

CharRemapAddedToUFont = 69,

/// <summary>
/// FIXME: Unknown version.
/// FIXME: Unknown version.
/// </summary>
CastStringSizeTokenDeprecated = 70,

Expand All @@ -44,7 +45,7 @@ public enum PackageObjectLegacyVersion
DynamicArrayInsertTokenAdded = 95,

/// <summary>
/// FIXME: Version, set 95 (Deus Ex: IW)
/// FIXME: Version, set 95 (Deus Ex: IW)
/// </summary>
PrimitiveCastTokenAdded = 95,

Expand All @@ -67,9 +68,8 @@ public enum PackageObjectLegacyVersion
CompactIndexDeprecated = 178,

/// <summary>
/// Present in all released UE3 games (starting with RoboBlitz).
///
/// FIXME: Unknown version.
/// Present in all released UE3 games (starting with RoboBlitz).
/// FIXME: Unknown version.
/// </summary>
IsLocalAddedToDelegateFunctionToken = 181,

Expand Down Expand Up @@ -109,7 +109,7 @@ public enum PackageObjectLegacyVersion
AddedFuncMapToUState = 220,

/// <summary>
/// And ComponentMap
/// And ComponentMap
/// </summary>
ArchetypeAddedToExports = 220,

Expand Down Expand Up @@ -144,7 +144,7 @@ public enum PackageObjectLegacyVersion
InterfaceClassesDeprecated = 288,

/// <summary>
/// Some properties like SizeX, SizeY, Format have been displaced to ScriptProperties.
/// Some properties like SizeX, SizeY, Format have been displaced to ScriptProperties.
/// </summary>
DisplacedUTextureProperties = 297,

Expand All @@ -166,24 +166,53 @@ public enum PackageObjectLegacyVersion
// FIXME: Version 374-491; Delegate source type changed from Name to Object
ChangedDelegateSourceFromNameToObject = 376,

[Discardable] GameGOW = 374,

/// <summary>
/// Not attested in (GoW v374, oldest attest (v421)
/// FIXME: Version
/// </summary>
SkipSizeAddedToArrayFindTokenIntrinsics = GameGOW + 1,

/// <summary>
/// Not attested in GoW (v374), oldest attest (v421)
/// FIXME: Unknown version
/// </summary>
StructReferenceAddedToStructMember = GameGOW + 1,

// 417 according to the GoW client
LightingChannelsAddedToPoly = 417,

// FIXME: Version, not attested in (RoboBlitz v369, but attested in GoW v490).
SkipSizeAddedToArrayFindTokenIntrinsics = 400,

AddedArrayEnumToUProperty = 401,

// FIXME: Version, not attested in (GoW v490)
SkipSizeAddedToArrayTokenIntrinsics = 491,
/// <summary>
/// Oldest attest MOHA (v421), but not MKKE (v472, non standard)
/// FIXME: Unknown version
/// </summary>
IsCopyAddedToStructMember = GameGOW + 1,

[Discardable] GameFFOW = 433,

/// <summary>
/// Oldest attest FFOW (v433), but not MKKE (v472, non standard)
/// FIXME: Unknown version
/// </summary>
IsModificationAddedToStructMember = GameFFOW,

[Discardable] GameGOWPC = 490,

/// <summary>
/// FIXME: Version, not attested in (GoW v490)
/// </summary>
SkipSizeAddedToArrayTokenIntrinsics = GameGOWPC + 1,

VerticalOffsetAddedToUFont = 506,
CleanupFonts = 511,

ComponentMapDeprecated = 543,

/// <summary>
/// Added with <see cref="ClassGuidDeprecated"/>
/// Added with <see cref="ClassGuidDeprecated" />
/// </summary>
ClassPlatformFlagsDeprecated = 547,

Expand Down Expand Up @@ -223,6 +252,6 @@ public enum PackageObjectLegacyVersion
AddedNativeClassNameToUClass = 813,

AddedATITCToUTexture2D = 857,
AddedETCToUTexture2D = 864,
AddedETCToUTexture2D = 864
}
}
36 changes: 22 additions & 14 deletions src/Core/Tokens/ContextTokens.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Diagnostics;
using UELib.Annotations;
using UELib.Branch;
using UELib.ObjectModel.Annotations;
using UELib.Tokens;

Expand All @@ -14,7 +14,7 @@ public class ContextToken : Token
{
public UProperty Property;
public ushort PropertyType;

public override void Deserialize(IUnrealStream stream)
{
// A.?
Expand All @@ -23,7 +23,7 @@ public override void Deserialize(IUnrealStream stream)
// SkipSize
stream.ReadUInt16();
Decompiler.AlignSize(sizeof(ushort));


// Doesn't seem to exist in APB
// Definitely not in UT3(512), APB, CrimeCraft, GoW2, MoonBase and Singularity.
Expand Down Expand Up @@ -95,7 +95,14 @@ public override string Decompile()
public class StructMemberToken : Token
{
public UField Property;
[CanBeNull] public UStruct Struct;

/// <summary>
/// Will be null if not deserialized (<see cref="Version"/> &lt; <see cref="PackageObjectLegacyVersion.StructReferenceAddedToStructMember"/>)
/// </summary>
public UStruct Struct;

public byte IsCopy;
public byte IsModification;

public override void Deserialize(IUnrealStream stream)
{
Expand All @@ -110,28 +117,29 @@ public override void Deserialize(IUnrealStream stream)
Debug.Assert(Struct != null);
}
#endif
// TODO: Corrigate version. Definitely didn't exist in Roboblitz(369), first seen in MOHA(421).
if (stream.Version > 374)
if (stream.Version >= (int)PackageObjectLegacyVersion.StructReferenceAddedToStructMember)
{
Struct = stream.ReadObject<UStruct>();
Decompiler.AlignObjectSize();
Debug.Assert(Struct != null);
}
#if MKKE
if (Package.Build == UnrealPackage.GameBuild.BuildName.MKKE)
{
goto skipToNext;
}
if (Package.Build == UnrealPackage.GameBuild.BuildName.MKKE)
{
goto skipToNext;
}
#endif
if (stream.Version >= (int)PackageObjectLegacyVersion.IsCopyAddedToStructMember)
{
// Copy?
stream.ReadByte();
IsCopy = stream.ReadByte();
Decompiler.AlignSize(sizeof(byte));
}

// TODO: Corrigate version. Definitely didn't exist in MKKE(472), first seen in FFOW(433).
if (stream.Version >= 433)
if (stream.Version >= (int)PackageObjectLegacyVersion.IsModificationAddedToStructMember)
{
// Modification?
stream.ReadByte();
IsModification = stream.ReadByte();
Decompiler.AlignSize(sizeof(byte));
}

Expand Down
4 changes: 2 additions & 2 deletions src/Eliot.UELib.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<DefineConstants>DECOMPILE;BINARYMETADATA;UE1;UE2;UE3;UE4;VENGEANCE;SWAT4;UNREAL2;INFINITYBLADE;BORDERLANDS2;GOW2;APB;SPECIALFORCE2;XIII;SINGULARITY;THIEF_DS;DEUSEX_IW;BORDERLANDS;MIRRORSEDGE;BIOSHOCK;HAWKEN;UT;DISHONORED;REMEMBERME;ALPHAPROTOCOL;VANGUARD;TERA;MKKE;TRANSFORMERS;XCOM2;DD2;DCUO;AA2;SPELLBORN;BATMAN;MOH;ROCKETLEAGUE;DNF;LSGAME;UNDYING;HP;DEVASTATION;BATTLEBORN;SPLINTERCELL;AHIT;GIGANTIC;ENDWAR;SG1;MASS_EFFECT;MOV</DefineConstants>
<TargetFrameworks>net48;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net48;netstandard2.0;netstandard2.1;net8.0</TargetFrameworks>
<OutputType>Library</OutputType>
<RootNamespace>UELib</RootNamespace>
<Install>true</Install>
Expand Down Expand Up @@ -70,7 +70,7 @@
<PropertyGroup>
<AssemblyName>Eliot.UELib</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>
<Version>$(VersionPrefix)1.6.2</Version>
<Version>$(VersionPrefix)1.7.0</Version>
<Authors>EliotVU</Authors>
<Title>$(AssemblyName)</Title>
<PackageDescription>UnrealScript decompiler library for Unreal package files (.upk, .u, .uasset; etc), with support for Unreal Engine 1, 2, and 3.</PackageDescription>
Expand Down
1 change: 1 addition & 0 deletions src/Eliot.UELib.csproj.DotSettings
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">Latest</s:String>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=core_005Cclasses/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=core_005Ctables/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=core_005Ctokens/@EntryIndexedValue">True</s:Boolean>
Expand Down
11 changes: 9 additions & 2 deletions src/UnrealPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,14 @@ public enum BuildName
///
/// 421/011
/// </summary>
[Build(421, 11)] MOHA,
[Build(421, 11)] MoHA,

/// <summary>
/// Frontlines: Fuel of War
///
/// 433/052
/// </summary>
[Build(433, 52)] FFoW,

/// <summary>
/// 472/046
Expand Down Expand Up @@ -467,7 +474,7 @@ public enum BuildName
/// 581/058
/// </summary>
[Build(581, 58, BuildFlags.ConsoleCooked)] [BuildEngineBranch(typeof(EngineBranchMOH))]
MOH,
MoH,

/// <summary>
/// Borderlands
Expand Down

0 comments on commit 79a107c

Please sign in to comment.