nevermoe / unity_metadata_loader

GNU General Public License v2.0
522 stars 127 forks source link

Assertion fails for v24 metadata. #18

Open Willyham opened 5 years ago

Willyham commented 5 years ago

Along with #16, definitely feels like something is off with this version. Some string literals are dumped correctly (~45k out of ~114k), but method information fails.

metadataUsageListsOffset = 94a9a0
InitializeMethodMetadata(start=142360, count=2)
il2cpp_dumper.bak: main.cpp:50: const char* GetStringFromIndex(StringIndex): Assertion `index <= s_GlobalMetadataHeader->stringCount' failed.
Aborted (core dumped)

I've attached the zipfile containing the metadata.

I attempted to debug and continue past the assertion for a best effort dump, but ran into a lot segfaults and weird outcomes:

metadata version is: 24
3919292
usagePairCount: 41541
stringLiteralCount: 114360
sizeof(Il2CppStringLiteral)=8
metadataUsageListsOffset = 94a9a0
InitializeMethodMetadata(start=0, count=2)
metadataUsageListsOffset = 94a9a0
...
Finished metadata init
Wrote 44990 literal strings
Reading method metadata
...
Getting definition for index 51
Found method name: blyName$$ionsFromChildren
Getting definition for index 52
Found method name: blyName$$Lookup
Getting definition for index 53
Getting definition for index 54
Getting definition for index 55
Found method name: blyName$$mscorlib.dll
Getting definition for index 56
Found method name: blyName$$
Ignoring method with index 100663357
Getting definition for index 57
Found method name: blyName$$\x0\x0\x0\x0\x0\x4\x0\x0\x0\x0\x0\x0\x0"
Getting definition for index 58

metadata.zip

russdill commented 4 years ago

I'm just getting into this, but my initial find is that rgctxEntriesOffset and rgctxEntriesCount doesn't seem to have been remove around 24, making the structure off by 8 bytes.