@@ -66,24 +66,15 @@ public class Il2CppMetadata : ClassReadingBinaryReader
66
66
}
67
67
68
68
var version = BitConverter . ToInt32 ( bytes , 4 ) ;
69
- if ( version is < 23 or > 29 )
69
+ if ( version is < 23 or > 31 )
70
70
{
71
- throw new FormatException ( "Unsupported metadata version found! We support 23-29 , got " + version ) ;
71
+ throw new FormatException ( "Unsupported metadata version found! We support 23-31 , got " + version ) ;
72
72
}
73
73
74
74
LibLogger . VerboseNewline ( $ "\t IL2CPP Metadata Declares its version as { version } ") ;
75
75
76
76
float actualVersion ;
77
- if ( version == 27 )
78
- {
79
- if ( unityVersion . GreaterThanOrEquals ( 2021 , 1 ) )
80
- actualVersion = 27.2f ; //2021.1 and up is v27.2, which just changes Il2CppType to have one new bit
81
- else if ( unityVersion . GreaterThanOrEquals ( 2020 , 2 , 4 ) )
82
- actualVersion = 27.1f ; //2020.2.4 and above is v27.1
83
- else
84
- actualVersion = version ; //2020.2 and above is v27
85
- }
86
- else if ( version == 24 )
77
+ if ( version == 24 )
87
78
{
88
79
if ( unityVersion . GreaterThanOrEquals ( 2020 , 1 , 11 ) )
89
80
actualVersion = 24.4f ; //2020.1.11-17 were released prior to 2019.4.21, so are still on 24.4
@@ -104,6 +95,15 @@ public class Il2CppMetadata : ClassReadingBinaryReader
104
95
else
105
96
actualVersion = version ; //2017.1.0 was the first v24 version
106
97
}
98
+ else if ( version == 27 )
99
+ {
100
+ if ( unityVersion . GreaterThanOrEquals ( 2021 , 1 ) )
101
+ actualVersion = 27.2f ; //2021.1 and up is v27.2, which just changes Il2CppType to have one new bit
102
+ else if ( unityVersion . GreaterThanOrEquals ( 2020 , 2 , 4 ) )
103
+ actualVersion = 27.1f ; //2020.2.4 and above is v27.1
104
+ else
105
+ actualVersion = version ; //2020.2 and above is v27
106
+ }
107
107
else if ( version == 29 )
108
108
{
109
109
if ( unityVersion . GreaterThanOrEquals ( 2023 , 2 , 0 , UnityVersionType . Alpha , 22 ) )
@@ -112,6 +112,11 @@ public class Il2CppMetadata : ClassReadingBinaryReader
112
112
actualVersion = 29.1f ; //2022.1.0b7 introduces v29.1 which adds two new pointers to codereg
113
113
else
114
114
actualVersion = 29 ; //2021.3.0 introduces v29
115
+ } else if ( version == 31 )
116
+ {
117
+ //2022.3.33 introduces v31. Unity why would you bump this on a minor version.
118
+ //Adds one new field (return type token) to method def
119
+ actualVersion = 31 ;
115
120
}
116
121
else actualVersion = version ;
117
122
0 commit comments