Skip to content

Commit

Permalink
Backport "Lib: Support v31"
Browse files Browse the repository at this point in the history
  • Loading branch information
SamboyCoding committed Jun 24, 2024
1 parent 20ccab2 commit 4daa40a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions LibCpp2IL/Metadata/Il2CppMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ public class Il2CppMetadata : ClassReadingBinaryReader
}

var version = BitConverter.ToInt32(bytes, 4);
if (version is < 24 or > 29)
if (version is < 24 or > 31)
{
throw new FormatException("Unsupported metadata version found! We support 24-29, got " + version);
throw new FormatException("Unsupported metadata version found! We support 24-31, got " + version);
}

LibLogger.VerboseNewline($"\tIL2CPP Metadata Declares its version as {version}");
Expand Down Expand Up @@ -104,6 +104,11 @@ public class Il2CppMetadata : ClassReadingBinaryReader
actualVersion = 29.1f; //2022.1.0b7 introduces v29.1 which adds two new pointers to codereg
else
actualVersion = 29; //2021.3.0 introduces v29
} else if (version == 31)
{
//2022.3.33 introduces v31. Unity why would you bump this on a minor version.
//Adds one new field (return type token) to method def
actualVersion = 31;
}
else actualVersion = version;

Expand Down
1 change: 1 addition & 0 deletions LibCpp2IL/Metadata/Il2CppMethodDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class Il2CppMethodDefinition
public int nameIndex;
public int declaringTypeIdx;
public int returnTypeIdx;
[Version(Min = 31)] public uint returnParameterToken;
public int parameterStart;
[Version(Max = 24)] public int customAttributeIndex;
public int genericContainerIndex;
Expand Down

0 comments on commit 4daa40a

Please sign in to comment.