WIP gameprogress parser
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/bin/
|
||||
/obj/
|
||||
/.vs/
|
BIN
GAMEPROGRESS.broke.BLOB
Normal file
BIN
GAMEPROGRESS.broke.BLOB
Normal file
Binary file not shown.
10
LegoSkywalkerGameProgressParser.csproj
Normal file
10
LegoSkywalkerGameProgressParser.csproj
Normal file
@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
25
LegoSkywalkerGameProgressParser.sln
Normal file
25
LegoSkywalkerGameProgressParser.sln
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.0.32112.339
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LegoSkywalkerGameProgressParser", "LegoSkywalkerGameProgressParser.csproj", "{176F7D27-DFB9-4C4D-97E5-B4A3F5813977}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{176F7D27-DFB9-4C4D-97E5-B4A3F5813977}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{176F7D27-DFB9-4C4D-97E5-B4A3F5813977}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{176F7D27-DFB9-4C4D-97E5-B4A3F5813977}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{176F7D27-DFB9-4C4D-97E5-B4A3F5813977}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {5F843E48-2491-49DE-8D63-3603791F3954}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
64
Program.cs
Normal file
64
Program.cs
Normal file
@ -0,0 +1,64 @@
|
||||
using System.Diagnostics;
|
||||
|
||||
string readString(BinaryReader reader)
|
||||
{
|
||||
var len = reader.ReadInt32();
|
||||
var strBytes = reader.ReadBytes(len);
|
||||
return System.Text.Encoding.UTF8.GetString(strBytes).TrimEnd('\0');
|
||||
}
|
||||
|
||||
void readTypes(BinaryReader reader)
|
||||
{
|
||||
var typeLenPos = reader.BaseStream.Position;
|
||||
var typeLen = reader.ReadInt32();
|
||||
var typeListHeader = readString(reader);
|
||||
var numTypes = reader.ReadInt32();
|
||||
var numTypes2 = reader.ReadInt32();
|
||||
List<(string, string)> types = new();
|
||||
for (int i = 0; i < numTypes; i++)
|
||||
{
|
||||
var key = readString(reader);
|
||||
var val = readString(reader);
|
||||
types.Add((key, val));
|
||||
|
||||
var typeBuf1 = reader.ReadInt32();
|
||||
if (types.Count < numTypes)
|
||||
{
|
||||
var typeBuf2 = reader.ReadInt32();
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Assert(reader.BaseStream.Position == typeLenPos + typeLen);
|
||||
}
|
||||
|
||||
using var file = File.OpenRead(@"C:\Users\chris\AppData\Roaming\Warner Bros. Interactive Entertainment\LEGO Star Wars - The Skywalker Saga\SAVEDGAMES\STEAM\21492523\SLOT1\GAMEPROGRESS.BLOB");
|
||||
using BinaryReader reader = new(file);
|
||||
var header = reader.ReadInt32();
|
||||
var str1 = readString(reader);
|
||||
var val1 = reader.ReadInt32();
|
||||
var buf1 = reader.ReadInt32();
|
||||
var buf2 = reader.ReadInt32();
|
||||
readTypes(reader);
|
||||
|
||||
var classListLenPos = reader.BaseStream.Position;
|
||||
var classListLen = reader.ReadInt32();
|
||||
var classListHeader = readString(reader);
|
||||
var numClasses = reader.ReadInt32();
|
||||
for (int i = 0; i < numClasses; i++)
|
||||
{
|
||||
var classLen = reader.ReadInt32();
|
||||
var classStr = readString(reader);
|
||||
var className = readString(reader);
|
||||
var numProps = reader.ReadInt32();
|
||||
|
||||
for (int j = 0; j < numProps; j++)
|
||||
{
|
||||
var propName = readString(reader);
|
||||
// this ain't right. figure out how to parse property values
|
||||
var propBuf1 = reader.ReadInt16();
|
||||
var propVal = reader.ReadInt32();
|
||||
var propBuf2 = reader.ReadInt16();
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("done");
|
Reference in New Issue
Block a user