Add ReadMappedObjectPointerArray
This commit is contained in:
@@ -32,6 +32,7 @@ namespace Il2CppInspector
|
||||
ushort ReadUInt16();
|
||||
byte ReadByte();
|
||||
string ReadMappedNullTerminatedString(uint uiAddr);
|
||||
List<U> ReadMappedObjectPointerArray<U>(uint uiAddr, int count) where U : new();
|
||||
}
|
||||
|
||||
internal class FileFormatReader<T> : BinaryObjectReader, IFileFormatReader where T : FileFormatReader<T>
|
||||
@@ -96,6 +97,15 @@ namespace Il2CppInspector
|
||||
return ReadNullTerminatedString(MapVATR(uiAddr));
|
||||
}
|
||||
|
||||
// Reads a list of pointers, then reads each object pointed to
|
||||
public List<U> ReadMappedObjectPointerArray<U>(uint uiAddr, int count) where U : new() {
|
||||
var pointers = ReadMappedArray<uint>(uiAddr, count);
|
||||
var array = new List<U>();
|
||||
for (int i = 0; i < count; i++)
|
||||
array.Add(ReadMappedObject<U>(pointers[i]));
|
||||
return array;
|
||||
}
|
||||
|
||||
// Perform file format-based post-load manipulations to the IL2Cpp data
|
||||
public virtual void FinalizeInit(Il2CppBinary il2cpp) { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user