You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EnumType=context.Binary.GetType(Il2CppVariableWidthIndex<Il2CppType>.MakeTemporaryForFixedWidthUsage(enumTypeIndex));//DynWidth: enumTypeIndex is already compressed, they didn't make it dynamic
Copy file name to clipboardExpand all lines: Cpp2IL.Core/Model/CustomAttributes/CustomAttributeTypeParameter.cs
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@
4
4
usingCpp2IL.Core.Utils;
5
5
usingLibCpp2IL;
6
6
usingLibCpp2IL.BinaryStructures;
7
+
usingLibCpp2IL.Metadata;
7
8
8
9
namespaceCpp2IL.Core.Model.CustomAttributes;
9
10
@@ -44,7 +45,7 @@ public override void ReadFromV29Blob(BinaryReader reader, ApplicationAnalysisCon
44
45
_type=null;
45
46
else
46
47
{
47
-
_type=context.Binary.GetType(typeIndex);
48
+
_type=context.Binary.GetType(Il2CppVariableWidthIndex<Il2CppType>.MakeTemporaryForFixedWidthUsage(typeIndex));//DynWidth: typeIndex is already compressed, they didn't make it dynamic
Copy file name to clipboardExpand all lines: Cpp2IL.Core/Utils/V29AttributeUtils.cs
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,7 @@ private static T ResolveMemberFromIndex<T>(Stream stream, MethodAnalysisContext
83
83
memberIndex=-(memberIndex+1);
84
84
85
85
//Resolve type
86
-
vartypeDef=context.Metadata.typeDefs[typeIndex];
86
+
vartypeDef=context.Metadata.GetTypeDefinitionFromIndex(Il2CppVariableWidthIndex<Il2CppTypeDefinition>.MakeTemporaryForFixedWidthUsage((int)typeIndex));//DynWidth: typeIndex is already compressed, they didn't make it dynamic
87
87
vartypeContext=context.ResolveContextForType(typeDef)??thrownew("Unable to find type "+typeDef);
88
88
89
89
//Get member
@@ -118,7 +118,7 @@ public static BaseCustomAttributeParameter ConstructParameterForType(BinaryReade
varenumType=context.Binary.GetType(Il2CppVariableWidthIndex<Il2CppType>.MakeTemporaryForFixedWidthUsage(enumTypeIndex));//DynWidth: enumTypeIndex is already compressed, they didn't make it dynamic
LibLogger.VerboseNewline($"\t\t\tFound {potentialMetaRegPointers.Count} instances of the number of type defs, {LibCpp2IlMain.TheMetadata.typeDefs.Length}");
292
+
LibLogger.VerboseNewline($"\t\t\tFound {potentialMetaRegPointers.Count} instances of the number of type defs, {LibCpp2IlMain.TheMetadata.TypeDefinitionCount}");
LibLogger.VerboseNewline($"\t\t\tRejecting metadata registration 0x{va:X} because it has {metaReg.typeDefinitionsSizesCount} type def sizes, while metadata file defines {metadata.typeDefs.Length} type defs");
378
+
LibLogger.VerboseNewline($"\t\t\tRejecting metadata registration 0x{va:X} because it has {metaReg.typeDefinitionsSizesCount} type def sizes, while metadata file defines {metadata.TypeDefinitionCount} type defs");
378
379
continue;
379
380
}
380
381
381
-
if(metaReg.numTypes<metadata.typeDefs.Length)
382
+
if(metaReg.numTypes<metadata.TypeDefinitionCount)
382
383
{
383
-
LibLogger.VerboseNewline($"\t\t\tRejecting metadata registration 0x{va:X} because it has {metaReg.numTypes} types, which is less than metadata-file-defined type def count of {metadata.typeDefs.Length}");
384
+
LibLogger.VerboseNewline($"\t\t\tRejecting metadata registration 0x{va:X} because it has {metaReg.numTypes} types, which is less than metadata-file-defined type def count of {metadata.TypeDefinitionCount}");
//If we see any cases of failing to find meta reg and this line is in verbose log, maybe the assumption (num field offsets == num type defs) is wrong.
390
-
LibLogger.VerboseNewline($"\t\t\tRejecting metadata registration 0x{va:X} because it has {metaReg.fieldOffsetsCount} field offsets, while metadata file defines {metadata.typeDefs.Length} type defs");
391
+
LibLogger.VerboseNewline($"\t\t\tRejecting metadata registration 0x{va:X} because it has {metaReg.fieldOffsetsCount} field offsets, while metadata file defines {metadata.TypeDefinitionCount} type defs");
?LibCpp2IlMain.TheMetadata!.GetTypeDefinitionFromIndex(Il2CppVariableWidthIndex<Il2CppTypeDefinition>.MakeTemporaryForFixedWidthUsage((int)TypeDefinitionIndex))//DynWidth: TypeDefinitionIndex removed in v24.5, never dynamic
0 commit comments