unity_metadata_loader icon indicating copy to clipboard operation
unity_metadata_loader copied to clipboard

Wrong metadata usage list offset?

Open TheRealJunior opened this issue 5 years ago • 0 comments

Dealing with this global-metadata.dat file: https://www.sendspace.com/file/ji1e05

Getting weird values in this code section (inside InitializeMethodMetadata):

const Il2CppMetadataUsageList* metadataUsageLists = MetadataOffset<const Il2CppMetadataUsageList*>(s_GlobalMetadata, s_GlobalMetadataHeader->metadataUsageListsOffset, index);

uint32_t start = metadataUsageLists->start;
uint32_t count = metadataUsageLists->count;


std::cout << "InitializeMethodMetadata(start=" <<  start << ", count=" << count << ')' <<  std::endl;

Program output:

InitializeMethodMetadata(start=158, count=1073751607)
il2cpp_dumper: main.cpp:249: void InitializeMethodMetadata(uint32_t): Assertion `s_GlobalMetadataHeader->metadataUsagePairsCount >= 0 && offset <= static_cast<uint32_t>(s_GlobalMetadataHeader->metadataUsagePairsCount)' failed.

Analysis of the il2cpp binary:
After applying the Il2cppGlobalMetadataHeader struct, the divisions don't make sense.
For example: typeDefintionCount / 92 when sizeof(Il2cppTypeDefintion) != 92

(The il2cpp binary is 32 bit)

Global metadata file version is 24.

TheRealJunior avatar Jun 08 '19 21:06 TheRealJunior