Skip to content

Commit 896638c

Browse files
committed
Finish Release-1.8.0
2 parents 94770b6 + 0c69bea commit 896638c

25 files changed

+303
-94
lines changed

.github/workflows/benchmark.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Benchmark
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
permissions:
8+
contents: write
9+
deployments: write
10+
11+
jobs:
12+
benchmark:
13+
name: Run Benchmark
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-dotnet@v4
18+
with:
19+
dotnet-version: 8.0.x
20+
21+
- name: Run benchmark
22+
run: cd Benchmark && dotnet run -c Release --exporters json --filter '*'
23+
24+
- name: Store benchmark results
25+
uses: rhysd/github-action-benchmark@v1
26+
with:
27+
name: Benchmark.Net Benchmark
28+
tool: 'benchmarkdotnet'
29+
output-file-path: Benchmark/BenchmarkDotNet.Artifacts/results/Eliot.UELib.Benchmark.Benchmarks-report-full-compressed.json
30+
github-token: ${{ secrets.GITHUB_TOKEN }}
31+
auto-push: true
32+
alert-threshold: '200%'
33+
comment-on-alert: true

.github/workflows/publish.yml

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build .NET Framework and Publish to NuGet
1+
name: Build .NET and Publish
22

33
on:
44
workflow_dispatch:
@@ -8,25 +8,39 @@ on:
88

99
jobs:
1010
build:
11-
runs-on: windows-2019
11+
runs-on: windows-2022
12+
strategy:
13+
matrix:
14+
dotnet: [ '8.0.x' ]
1215
permissions:
1316
packages: write
1417
contents: read
1518
steps:
1619
- uses: actions/checkout@v4
17-
18-
- name: Setup MSBuild
19-
uses: microsoft/setup-msbuild@v2
20-
21-
- name: Setup NuGet
22-
uses: NuGet/setup-nuget@v2
23-
24-
- name: Restore dependencies
25-
run: nuget restore src/Eliot.UELib.csproj
26-
20+
21+
- name: Setup
22+
uses: actions/setup-dotnet@v4
23+
with:
24+
dotnet-version: ${{ matrix.dotnet }}
25+
26+
- name: Install
27+
run: dotnet restore src/Eliot.UELib.csproj
28+
2729
- name: Build
28-
run: msbuild src/Eliot.UELib.csproj -t:rebuild -property:Configuration=Release
29-
30+
run: dotnet build src/Eliot.UELib.csproj
31+
32+
- name: Restore
33+
run: dotnet restore src/Eliot.UELib.csproj
34+
35+
#- name: Test
36+
# run: dotnet test Test/Eliot.UELib.Test.csproj
37+
38+
- name: Pack
39+
run: dotnet pack --configuration Release src/Eliot.UELib.csproj
40+
41+
#- name: Push
42+
# run: dotnet nuget push src/Eliot.UELib.csproj -k ${{ secrets.NUGET_API_KEY }}} -s https://api.nuget.org/v3/index.json
43+
3044
- name: Publish Eliot.UELib to NuGet
3145
id: nuget
3246
uses: alirezanet/publish-nuget@v3.1.0

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
#
22

3+
## [1.8.0](https://github.com/EliotVU/Unreal-Library/releases/tag/1.8.0)
4+
5+
* 89401543 Support for Stranglehold
6+
* 6c89b66a Improved support for Batman series
7+
* 4222595f Improved support for Borderlands: GOTYE
8+
* 6c89b66a Fixed bad decompilation of intrinsic array function calls under certain circumstances.
9+
* 8ba153b3 Fixed missing ')' in a replication statement
10+
* 3eab0cba #92 Fixed issue with overriding a class type when initializing a package.
11+
312
## [1.7.0](https://github.com/EliotVU/Unreal-Library/releases/tag/1.7.0)
413

514
* 0ff0ed96 Added .NET Standard 2.1 and .NET 8.0 as framework targets.

CLI/Eliot.UELib.CLI.csproj

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>net8.0</TargetFrameworks>
4+
<LangVersion>12.0</LangVersion>
45
<OutputType>Exe</OutputType>
56
<RootNamespace>UELib.CLI</RootNamespace>
67
<PublishUrl>publish\</PublishUrl>
@@ -23,17 +24,4 @@
2324
<ItemGroup>
2425
<ProjectReference Include="..\src\Eliot.UELib.csproj" />
2526
</ItemGroup>
26-
<ItemGroup>
27-
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
28-
<Visible>False</Visible>
29-
<ProductName>Microsoft .NET Framework 4.8 %28x86 and x64%29</ProductName>
30-
<Install>true</Install>
31-
</BootstrapperPackage>
32-
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
33-
<Visible>False</Visible>
34-
<ProductName>.NET Framework 3.5 SP1</ProductName>
35-
<Install>false</Install>
36-
</BootstrapperPackage>
37-
</ItemGroup>
38-
<PropertyGroup />
3927
</Project>

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ This is a table of games that are confirmed to be compatible with the current st
134134
| | | | |
135135
| Tom Clancy's EndWar | Unknown | 329/000 | |
136136
| Roboblitz | 2306 | 369/006 | |
137+
| Stranglehold | 2605 | 375/025 | |
137138
| Mass Effect (Xbox 360) | 2674 | 391/092 | Xenon |
138139
| Medal of Honor: Airborne | 2859 | 421/011 | |
139140
| Frontlines: Fuel of War | 2917 | 433/052 | |
@@ -221,10 +222,10 @@ This is a table of games that are confirmed to be compatible with the current st
221222
| Gal\*Gun: Double Peace | 10897 | 871/000 | |
222223
| Battleborn | 8623/1055 | 874/078 | |
223224
| A Hat in Time | 12097 | 877-893/005 | |
225+
| Blue Estate The Game | 10246 | 893/000 | |
224226
| Shadow Complex Remastered | 10897 | 893/001 | |
225227
| Soldier Front 2 | 6712 | 904/009 | |
226228
| Rise of the Triad | 10508 | Unknown | |
227-
| Outlast | 12046 | Unknown | |
228229
| Sherlock Holmes: Crimes and Punishments | 10897 | Unknown | |
229230
| Alien Rage | 7255 | Unknown | |
230231

Test/Eliot.UELib.Test.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>net8.0</TargetFramework>
4+
<LangVersion>12.0</LangVersion>
45
<IsPackable>false</IsPackable>
56
<Configurations>Debug;Release</Configurations>
67
</PropertyGroup>

Test/UnrealPackageTests.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,31 @@ namespace Eliot.UELib.Test
1010
[TestClass]
1111
public class UnrealPackageTests
1212
{
13+
public class MyUModel : UModel;
14+
15+
[TestMethod]
16+
public void TestClassTypeOverride()
17+
{
18+
using var stream = UnrealPackageUtilities.CreateTempPackageStream();
19+
using var linker = new UnrealPackage(stream);
20+
21+
Assert.IsTrue(linker.GetClassType("Model") == typeof(UnknownObject));
22+
linker.AddClassType("Model", typeof(MyUModel));
23+
Assert.IsTrue(linker.GetClassType("Model") == typeof(MyUModel));
24+
linker.InitializePackage(UnrealPackage.InitFlags.RegisterClasses);
25+
Assert.IsTrue(linker.GetClassType("Model") == typeof(UModel));
26+
27+
using var stream2 = UnrealPackageUtilities.CreateTempPackageStream();
28+
using var linker2 = new UnrealPackage(stream2);
29+
30+
// Swapped order...
31+
Assert.IsTrue(linker2.GetClassType("Model") == typeof(UnknownObject));
32+
linker2.InitializePackage(UnrealPackage.InitFlags.RegisterClasses);
33+
Assert.IsTrue(linker2.GetClassType("Model") == typeof(UModel));
34+
linker2.AddClassType("Model", typeof(MyUModel));
35+
Assert.IsTrue(linker2.GetClassType("Model") == typeof(MyUModel));
36+
}
37+
1338
internal static void AssertTestClass(UnrealPackage linker)
1439
{
1540
var testClass = linker.FindObject<UClass>("Test");

Test/UnrealPackageUtilities.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System;
2+
using System.IO;
3+
using UELib;
4+
5+
namespace Eliot.UELib.Test
6+
{
7+
internal static class UnrealPackageUtilities
8+
{
9+
// HACK: Ugly workaround the issues with UPackageStream
10+
public static UPackageStream CreateTempPackageStream()
11+
{
12+
string tempFilePath = Path.Join(Path.GetTempFileName());
13+
File.WriteAllBytes(tempFilePath, BitConverter.GetBytes(UnrealPackage.Signature));
14+
15+
var stream = new UPackageStream(tempFilePath, FileMode.Open, FileAccess.ReadWrite);
16+
return stream;
17+
}
18+
}
19+
}

Test/UnrealStreamTests.cs

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@ namespace Eliot.UELib.Test
1212
[TestClass]
1313
public class UnrealStreamTests
1414
{
15-
// HACK: Ugly workaround the issues with UPackageStream
16-
private static UPackageStream CreateTempStream()
17-
{
18-
string tempFilePath = Path.Join(Path.GetTempFileName());
19-
File.WriteAllBytes(tempFilePath, BitConverter.GetBytes(UnrealPackage.Signature));
20-
21-
var stream = new UPackageStream(tempFilePath, FileMode.Open, FileAccess.ReadWrite);
22-
return stream;
23-
}
24-
2515
[DataTestMethod]
2616
[DataRow(PackageObjectLegacyVersion.Undefined, 1, +0b0000000000000000000000100001)]
2717
[DataRow(PackageObjectLegacyVersion.Undefined, 1, -0b0000000000000000000000100001)]
@@ -32,7 +22,7 @@ private static UPackageStream CreateTempStream()
3222
[DataRow(PackageObjectLegacyVersion.CompactIndexDeprecated, 4, int.MaxValue)]
3323
public void SerializeCompactIndex(PackageObjectLegacyVersion version, int count, int compactIndex)
3424
{
35-
using var stream = CreateTempStream();
25+
using var stream = UnrealPackageUtilities.CreateTempPackageStream();
3626
using var linker = new UnrealPackage(stream);
3727
linker.Build = new UnrealPackage.GameBuild(linker);
3828
linker.Summary = new UnrealPackage.PackageFileSummary
@@ -65,7 +55,7 @@ public void SerializeCompactIndex(PackageObjectLegacyVersion version, int count,
6555
[DataRow(PackageObjectLegacyVersion.Undefined, "语言处理")]
6656
public void SerializeString(PackageObjectLegacyVersion version, string text)
6757
{
68-
using var stream = CreateTempStream();
58+
using var stream = UnrealPackageUtilities.CreateTempPackageStream();
6959
using var linker = new UnrealPackage(stream);
7060
linker.Build = new UnrealPackage.GameBuild(linker);
7161
linker.Summary = new UnrealPackage.PackageFileSummary
@@ -86,7 +76,7 @@ public void SerializeString(PackageObjectLegacyVersion version, string text)
8676
[TestMethod]
8777
public void SerializeStruct()
8878
{
89-
using var stream = CreateTempStream();
79+
using var stream = UnrealPackageUtilities.CreateTempPackageStream();
9080
using var linker = new UnrealPackage(stream);
9181
linker.Build = new UnrealPackage.GameBuild(linker);
9282
linker.Summary = new UnrealPackage.PackageFileSummary();
@@ -113,7 +103,7 @@ public void SerializeStruct()
113103
[TestMethod]
114104
public void SerializeStructMarshal()
115105
{
116-
using var stream = CreateTempStream();
106+
using var stream = UnrealPackageUtilities.CreateTempPackageStream();
117107
using var linker = new UnrealPackage(stream);
118108
linker.Build = new UnrealPackage.GameBuild(linker);
119109
linker.Summary = new UnrealPackage.PackageFileSummary();
@@ -156,7 +146,7 @@ public void SerializeStructMarshal()
156146
[DataRow(PackageObjectLegacyVersion.LazyArrayReplacedWithBulkData)]
157147
public void SerializeBulkData(PackageObjectLegacyVersion version)
158148
{
159-
using var stream = CreateTempStream();
149+
using var stream = UnrealPackageUtilities.CreateTempPackageStream();
160150
using var linker = new UnrealPackage(stream);
161151
linker.Build = new UnrealPackage.GameBuild(linker);
162152
linker.Summary = new UnrealPackage.PackageFileSummary
@@ -192,7 +182,7 @@ public void SerializeBulkData(PackageObjectLegacyVersion version)
192182
[DataRow(PackageObjectLegacyVersion.VerticalOffsetAddedToUFont)]
193183
public void SerializeDataTypes(PackageObjectLegacyVersion version)
194184
{
195-
using var stream = CreateTempStream();
185+
using var stream = UnrealPackageUtilities.CreateTempPackageStream();
196186
using var linker = new UnrealPackage(stream);
197187
linker.Build = new UnrealPackage.GameBuild(linker);
198188
linker.Summary = new UnrealPackage.PackageFileSummary

src/Branch/DefaultEngineBranch.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,10 @@ protected override TokenMap BuildTokenMap(UnrealPackage linker)
378378

379379
tokenMap[0x5B] = typeof(ByteConstToken);
380380
break;
381+
382+
case UnrealPackage.GameBuild.BuildName.Borderlands_GOTYE:
383+
tokenMap[0x5B] = typeof(BLVariableToken);
384+
break;
381385
#endif
382386
#if BIOSHOCK
383387
case UnrealPackage.GameBuild.BuildName.BioShock:

src/Branch/PackageObjectLegacyVersion.cs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -162,23 +162,27 @@ public enum PackageObjectLegacyVersion
162162
CompressionAdded = 334,
163163

164164
NumberAddedToName = 343,
165+
166+
[Discardable] GameGOW = 374, // Engine Version: 2451
167+
[Discardable] GameStranglehold = 375, // Engine Version: 2605
165168

166-
// FIXME: Version 374-491; Delegate source type changed from Name to Object
167-
ChangedDelegateSourceFromNameToObject = 376,
168-
169-
[Discardable] GameGOW = 374,
169+
/// <summary>
170+
/// Possibly attested first with Stranglehold (v375)
171+
/// FIXME: Version 375-491; Delegate source type changed from Name to Object
172+
/// </summary>
173+
ChangedDelegateSourceFromNameToObject = GameStranglehold,
170174

171175
/// <summary>
172-
/// Not attested in (GoW v374, oldest attest (v421)
176+
/// Not attested in GoW v374), oldest attests (v375,v421)
173177
/// FIXME: Version
174178
/// </summary>
175179
SkipSizeAddedToArrayFindTokenIntrinsics = GameGOW + 1,
176180

177181
/// <summary>
178-
/// Not attested in GoW (v374), oldest attest (v421)
182+
/// Not attested in GoW (v374), oldest attests (v375,v421)
179183
/// FIXME: Unknown version
180184
/// </summary>
181-
StructReferenceAddedToStructMember = GameGOW + 1,
185+
StructReferenceAddedToStructMember = GameStranglehold,
182186

183187
// 417 according to the GoW client
184188
LightingChannelsAddedToPoly = 417,
@@ -189,9 +193,9 @@ public enum PackageObjectLegacyVersion
189193
/// Oldest attest MOHA (v421), but not MKKE (v472, non standard)
190194
/// FIXME: Unknown version
191195
/// </summary>
192-
IsCopyAddedToStructMember = GameGOW + 1,
196+
IsCopyAddedToStructMember = GameStranglehold + 1,
193197

194-
[Discardable] GameFFOW = 433,
198+
[Discardable] GameFFOW = 433, // Engine Version: 2917
195199

196200
/// <summary>
197201
/// Oldest attest FFOW (v433), but not MKKE (v472, non standard)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using UELib.Core;
2+
using UELib.ObjectModel.Annotations;
3+
using UELib.Tokens;
4+
5+
namespace UELib.Branch.UE3.BL2.Tokens
6+
{
7+
[ExprToken(ExprToken.InstanceVariable)]
8+
public class BLVariableToken : UStruct.UByteCodeDecompiler.FieldToken
9+
{
10+
11+
}
12+
}

src/Branch/UE3/RSS/EngineBranch.RSS.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,17 @@ public EngineBranchRSS(BuildGeneration generation) : base(BuildGeneration.RSS)
1212
protected override TokenMap BuildTokenMap(UnrealPackage linker)
1313
{
1414
var tokenMap = base.BuildTokenMap(linker);
15+
16+
// Identical to ContextToken and ClassContextToken. Spotted in BM 1, 2, and 4
17+
tokenMap[0x50] = typeof(RSSContextToken);
18+
1519
if (linker.Build == UnrealPackage.GameBuild.BuildName.Batman4)
1620
{
17-
tokenMap[0x2B] = typeof(NameConstNoNumberToken); // FIXME: NameConst but without the Int32 number at the end
21+
// FIXME: NameConst but without the Int32 number at the end
22+
tokenMap[0x2B] = typeof(NameConstNoNumberToken);
1823
}
24+
1925
return tokenMap;
2026
}
2127
}
22-
}
28+
}

src/Branch/UE3/RSS/Tokens/Bm4ContextToken.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)