Skip to content

Commit

Permalink
Add support for obfuscated unity versions
Browse files Browse the repository at this point in the history
  • Loading branch information
aelurum committed Feb 17, 2025
1 parent 6ea1ff3 commit f7e6d23
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion AssetStudio/SerializedFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,23 @@ public SerializedFile(FileReader reader, AssetsManager assetsManager)
}
if (header.m_Version >= SerializedFileFormatVersion.Unknown_7)
{
version = new UnityVersion(reader.ReadStringToNull());
var versionPos = reader.Position;
try
{
version = new UnityVersion(reader.ReadStringToNull());
}
catch (NotSupportedException e)
{
if (assetsManager.SpecifyUnityVersion == null)
{
Logger.Warning(e.Message);
version = new UnityVersion();
return;
}
version = assetsManager.SpecifyUnityVersion;
reader.Position = versionPos;
reader.ReadBytes(version.ToString().Length + 1);
}
}
else
{
Expand Down

0 comments on commit f7e6d23

Please sign in to comment.