Skip to content

Commit

Permalink
Lib: Fix reading of unity 2018.4.34-2018.4.36
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Byass committed Feb 18, 2022
1 parent 2cb5c3e commit f27d450
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions LibCpp2IL/BinaryStructures/Il2CppCodeRegistration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ namespace LibCpp2IL.BinaryStructures

public class Il2CppCodeRegistration
{
[Version(Max = 24.1f)] public ulong methodPointersCount;
[Version(Max = 24.1f)] public ulong methodPointers;
[Version(Max = 24.15f)] public ulong methodPointersCount;
[Version(Max = 24.15f)] public ulong methodPointers;

public ulong reversePInvokeWrapperCount;
public ulong reversePInvokeWrappers;
Expand Down
4 changes: 3 additions & 1 deletion LibCpp2IL/Metadata/Il2CppAssemblyNameDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ public class Il2CppAssemblyNameDefinition
{
public int nameIndex;
public int cultureIndex;
[Version(Max = 24.3f)] public int hashValueIndex;
[Version(Max = 24.1f)]
[Version(Min = 24.2f, Max=24.3f)] //Not present in 24.15
public int hashValueIndex;
public int publicKeyIndex;
public uint hash_alg;
public int hash_len;
Expand Down
4 changes: 2 additions & 2 deletions LibCpp2IL/Metadata/Il2CppGlobalMetadataHeader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public class Il2CppGlobalMetadataHeader
public int interfaceOffsetsCount;
public int typeDefinitionsOffset; // Il2CppTypeDefinition
public int typeDefinitionsCount;
[Version(Max = 24.1f)] public int rgctxEntriesOffset; // Il2CppRGCTXDefinition
[Version(Max = 24.1f)] public int rgctxEntriesCount;
[Version(Max = 24.15f)] public int rgctxEntriesOffset; // Il2CppRGCTXDefinition
[Version(Max = 24.15f)] public int rgctxEntriesCount;
public int imagesOffset; // Il2CppImageDefinition
public int imagesCount;
public int assembliesOffset; // Il2CppAssemblyDefinition
Expand Down
2 changes: 2 additions & 0 deletions LibCpp2IL/Metadata/Il2CppMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public class Il2CppMetadata : ClassReadingBinaryReader
actualVersion = 24.3f; //2019.3.7 introduces v24.3
else if (unityVersion.IsGreaterEqual(2019))
actualVersion = 24.2f; //2019.1.0 introduces v24.2
else if (unityVersion.IsGreaterEqual(2018, 4, 34))
actualVersion = 24.15f; //2018.4.34 made a tiny little change which just removes HashValueIndex from AssemblyNameDefinition
else if (unityVersion.IsGreaterEqual(2018, 3))
actualVersion = 24.1f; //2018.3.0 introduces v24.1
else
Expand Down
10 changes: 5 additions & 5 deletions LibCpp2IL/Metadata/Il2CppMethodDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ public class Il2CppMethodDefinition
public int parameterStart;
[Version(Max = 24)] public int customAttributeIndex;
public int genericContainerIndex;
[Version(Max = 24.1f)] public int methodIndex;
[Version(Max = 24.1f)] public int invokerIndex;
[Version(Max = 24.1f)] public int delegateWrapperIndex;
[Version(Max = 24.1f)] public int rgctxStartIndex;
[Version(Max = 24.1f)] public int rgctxCount;
[Version(Max = 24.15f)] public int methodIndex;
[Version(Max = 24.15f)] public int invokerIndex;
[Version(Max = 24.15f)] public int delegateWrapperIndex;
[Version(Max = 24.15f)] public int rgctxStartIndex;
[Version(Max = 24.15f)] public int rgctxCount;
public uint token;
public ushort flags;
public ushort iflags;
Expand Down
4 changes: 2 additions & 2 deletions LibCpp2IL/Metadata/Il2CppTypeDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public class Il2CppTypeDefinition
public int parentIndex;
public int elementTypeIndex; // we can probably remove this one. Only used for enums

[Version(Max = 24.1f)] public int rgctxStartIndex;
[Version(Max = 24.1f)] public int rgctxCount;
[Version(Max = 24.15f)] public int rgctxStartIndex;
[Version(Max = 24.15f)] public int rgctxCount;

public int genericContainerIndex;

Expand Down

0 comments on commit f27d450

Please sign in to comment.