diff --git a/LibCpp2IL/Metadata/Il2CppAssemblyNameDefinition.cs b/LibCpp2IL/Metadata/Il2CppAssemblyNameDefinition.cs index 017d8665..05ef5e26 100644 --- a/LibCpp2IL/Metadata/Il2CppAssemblyNameDefinition.cs +++ b/LibCpp2IL/Metadata/Il2CppAssemblyNameDefinition.cs @@ -28,7 +28,7 @@ public byte[]? PublicKey { get { - var result = LibCpp2IlMain.TheMetadata!.GetBytesFromIndex(publicKeyIndex); + var result = LibCpp2IlMain.TheMetadata!.GetByteArrayFromIndex(publicKeyIndex); return result.Length == 0 ? null : result; } } diff --git a/LibCpp2IL/Metadata/Il2CppMetadata.cs b/LibCpp2IL/Metadata/Il2CppMetadata.cs index a78af636..8c60d359 100644 --- a/LibCpp2IL/Metadata/Il2CppMetadata.cs +++ b/LibCpp2IL/Metadata/Il2CppMetadata.cs @@ -413,6 +413,18 @@ public int GetDefaultValueFromIndex(int index) private ConcurrentDictionary _cachedStrings = new ConcurrentDictionary(); + /// + /// Read a byte array from the string data section of the metadata. + /// + /// The offset relative to the start of the string section. + /// The + public byte[] GetByteArrayFromIndex(int index) + { + var offset = metadataHeader.stringOffset + index; + var count = ReadUnityCompressedUIntAtRawAddr(offset, out var bytesRead); + return ReadByteArrayAtRawAddress(offset + bytesRead, (int)count); + } + public string GetStringFromIndex(int index) { GetLockOrThrow(); @@ -426,18 +438,6 @@ public string GetStringFromIndex(int index) } } - /// - /// Read a byte array from the string data section of the metadata. - /// - /// The offset relative to the start of the string section. - /// The - public byte[] GetBytesFromIndex(int index) - { - var offset = metadataHeader.stringOffset + index; - var count = ReadUnityCompressedUIntAtRawAddr(offset, out var bytesRead); - return ReadByteArrayAtRawAddress(offset + bytesRead, (int)count); - } - internal string ReadStringFromIndexNoReadLock(int index) { if (!_cachedStrings.ContainsKey(index))