diff --git a/Il2CppInspector.Common/IL2CPP/Il2CppBinary.cs b/Il2CppInspector.Common/IL2CPP/Il2CppBinary.cs index 7f3cfad..8b1a46c 100644 --- a/Il2CppInspector.Common/IL2CPP/Il2CppBinary.cs +++ b/Il2CppInspector.Common/IL2CPP/Il2CppBinary.cs @@ -80,9 +80,13 @@ namespace Il2CppInspector // One assembly may contain multiple modules public Dictionary Modules { get; private set; } + // Status update callback private EventHandler OnStatusUpdate { get; set; } private void StatusUpdate(string status) => OnStatusUpdate?.Invoke(this, status); + // Set if something in the binary has been modified / decrypted + public bool IsModified { get; private set; } = false; + protected Il2CppBinary(IFileFormatReader stream, EventHandler statusCallback = null) { Image = stream; OnStatusUpdate = statusCallback; diff --git a/Il2CppInspector.Common/IL2CPP/Metadata.cs b/Il2CppInspector.Common/IL2CPP/Metadata.cs index a4950e1..bd33d52 100644 --- a/Il2CppInspector.Common/IL2CPP/Metadata.cs +++ b/Il2CppInspector.Common/IL2CPP/Metadata.cs @@ -45,6 +45,9 @@ namespace Il2CppInspector public Dictionary Strings { get; } = new Dictionary(); + // Set if something in the metadata has been modified / decrypted + public bool IsModified { get; } = false; + public Metadata(Stream stream, EventHandler statusCallback = null) : base(stream) { // Read magic bytes @@ -189,6 +192,7 @@ namespace Il2CppInspector var decryptedString = Encoding.GetString(encryptedString.Select(b => (byte) (b ^ xorKey)).ToArray()); Strings.Add(offset.current, decryptedString); } + IsModified = true; } // Get all managed code string literals diff --git a/Il2CppInspector.Common/IL2CPP/ReconstructMetadata.cs b/Il2CppInspector.Common/IL2CPP/ReconstructMetadata.cs index ed89179..3723571 100644 --- a/Il2CppInspector.Common/IL2CPP/ReconstructMetadata.cs +++ b/Il2CppInspector.Common/IL2CPP/ReconstructMetadata.cs @@ -319,6 +319,9 @@ namespace Il2CppInspector CodeRegistration.unresolvedVirtualCallCount = 0; CodeRegistration.interopDataCount = 0; + // TODO: Write changes to stream + IsModified = true; + // Things we need from Il2CppMetadataRegistration // genericInsts -> list of Il2CppGenericInst* (argc is count of Il2CppType* at data pointer argv; datapoint = GenericParameterIndex) @@ -767,6 +770,8 @@ namespace Il2CppInspector MetadataRegistration.typeDefinitionsSizesCount = 0; MetadataRegistration.genericClassesCount = MetadataRegistration.genericInstsCount + 1; + // TODO: Write changes to stream + StatusUpdate("Analyzing IL2CPP image"); } }