IL2CPP: Add APIs to save processed metadata and binary to disk

This commit is contained in:
Katy Coe
2020-12-09 19:43:29 +01:00
parent 3b8e518b7c
commit f6eed36284
6 changed files with 28 additions and 2 deletions

View File

@@ -203,6 +203,13 @@ namespace Il2CppInspector
StringLiterals[i] = ReadFixedLengthString(Header.stringLiteralDataOffset + stringLiteralList[i].dataIndex, stringLiteralList[i].length);
}
// Save metadata to file, overwriting if necessary
public void SaveToFile(string pathname) {
Position = 0;
using (var outFile = new FileStream(pathname, FileMode.Create, FileAccess.Write))
BaseStream.CopyTo(outFile);
}
internal int Sizeof(Type type) => Sizeof(type, Version);
public static int Sizeof(Type type, double metadataVersion, int longSizeBytes = 8) {