migrate versioning to StructVersion class, add handling/detection for 29.2/31.2
This commit is contained in:
@@ -12,6 +12,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using dnlib.DotNet;
|
||||
using dnlib.DotNet.Emit;
|
||||
using Il2CppInspector.Next;
|
||||
using Il2CppInspector.Reflection;
|
||||
|
||||
namespace Il2CppInspector.Outputs
|
||||
@@ -591,7 +592,7 @@ namespace Il2CppInspector.Outputs
|
||||
// Create folder for DLLs
|
||||
Directory.CreateDirectory(outputPath);
|
||||
|
||||
if (model.Package.Version >= 29)
|
||||
if (model.Package.Version >= MetadataVersions.V290)
|
||||
{
|
||||
// We can now apply all attributes directly.
|
||||
directApplyAttributes = model.TypesByDefinitionIndex
|
||||
|
||||
@@ -248,7 +248,7 @@ namespace Il2CppInspector.Outputs
|
||||
using (_writer)
|
||||
{
|
||||
writeHeader();
|
||||
writeCode($"#define __IL2CPP_METADATA_VERSION {_model.Package.Version * 10:F0}");
|
||||
writeCode($"#define __IL2CPP_METADATA_VERSION {_model.Package.Version.Major * 10 + _model.Package.Version.Minor * 10:F0}");
|
||||
}
|
||||
|
||||
// Write boilerplate code
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.IO;
|
||||
using System.Text.Json;
|
||||
using Il2CppInspector.Reflection;
|
||||
using Il2CppInspector.Model;
|
||||
using Il2CppInspector.Next;
|
||||
|
||||
namespace Il2CppInspector.Outputs
|
||||
{
|
||||
@@ -182,7 +183,7 @@ namespace Il2CppInspector.Outputs
|
||||
|
||||
// TODO: In the future, add data ranges for the entire IL2CPP metadata tree
|
||||
writeArray("arrayMetadata", () => {
|
||||
if (model.Package.Version >= 24.2) {
|
||||
if (model.Package.Version >= MetadataVersions.V242) {
|
||||
writeObject(() => writeTypedArray(binary.CodeRegistration.pcodeGenModules, binary.Modules.Count, "struct Il2CppCodeGenModule *", "g_CodeGenModules"));
|
||||
}
|
||||
}, "IL2CPP Array Metadata");
|
||||
|
||||
Reference in New Issue
Block a user