fix metadata usage validity checks

This commit is contained in:
LukeFZ
2024-08-18 22:40:29 +02:00
parent a7081ccfa9
commit 5d827fe881
2 changed files with 3 additions and 1 deletions

View File

@@ -27,6 +27,8 @@ namespace Il2CppInspector
public int SourceIndex { get; }
public ulong VirtualAddress { get; private set; }
public readonly bool IsValid => Type != 0;
public MetadataUsage(MetadataUsageType type, int sourceIndex, ulong virtualAddress = 0) {
Type = type;
SourceIndex = sourceIndex;

View File

@@ -259,7 +259,7 @@ namespace Il2CppInspector.Reflection
MetadataUsage[] vt = Assembly.Model.Package.GetVTable(Definition);
MethodBase[] res = new MethodBase[vt.Length];
for (int i = 0; i < vt.Length; i++) {
if (vt[i] != null)
if (vt[i].IsValid)
res[i] = Assembly.Model.GetMetadataUsageMethod(vt[i]);
}
return res;