Add support for versions v35-v39#903
Conversation
|
I just tested your fork, got this error : Initializing metadata... I can send you the game assembly + metadata, do you have Discord ? |
|
Hey @Madiha1441nora , thanks for testing. I actually managed to recreate the bug with another sample, I pushed a fix. The critical change is that constraintIndices = Version < 38
? ReadMetadataClassArray<Il2CppConstraintIndex>(header.genericParameterConstraintsOffset, header.genericParameterConstraintsSize)
: ReadMetadataClassArray<Il2CppConstraintIndex>(header.genericParameterConstraints.offset, (int)header.genericParameterConstraints.size);This fixed my sample, let me know if it fixes yours. |
|
could you please provide prebuilt binary in your fork, thx |
|
is this work fine and can do it automatic ? |
|
saved my day, tysm |
unitypy cannot read typetree using the dummydll metadata wasn't protected |
|
how 2 run? |
|
Awesome it worked |
|
Thank you very much! Very helpful! It's working! |
|
@roytu Can you check whether Enums get disassembled correctly? Idk if its the game that changed a specific enum to be a class now, but before it switched to a later unity version now with v39 dumper the same enum is now put as a class in the dummy dll, missing the values of each enum member ... :( |
|
this change worked great for me, appreciate your work! |
|
Initializing metadata... |
Cherry-picks from roytu/Il2CppDumper:v39 (Perfare PR Perfare#903, unmerged upstream). Adds parser support for global-metadata.dat versions 32 through 39, including Unity 6000 family. Source PR is mergeable-clean against upstream master (4741d46, last upstream commit 2024-07-06). Adopted in lxraa fork because upstream Il2CppDumper has been inactive since 2024-08; PR sat unreviewed for >2 months. Verified locally as part of the reverse-engineering pipeline (Il2CppDumper consumer in stage5 unity handler).
…sion) PR Perfare#903 conflated the `interfaces` and `interfaceOffsets` metadata sections, reading the per-type flat TypeIndex[] as if it were a VTable-style InterfaceOffsetPair[]. It also dropped the `+ typeDef.interfacesStart` offset, so every type read interfaces from global index 0. Restore upstream Perfare/master behaviour: - Re-introduce Metadata.interfaceIndices as flat int[]. - v38+: ReadClassArray<TypeIndex> using Metadata.typeIndexSize, cast to int[] (PR's variable-width TypeIndex still respected). - DummyAssemblyGenerator + Il2CppDecompiler: use interfaceIndices[typeDef.interfacesStart + i]. Empirically reverted-fix: on com.Garawell.BridgeRace (v31), System.String previously emitted as `String : IDisposable, SmallXmlParser.IContentHandler, …` — should now produce the correct `String : IComparable, IEnumerable, IEnumerable<char>, IComparable<string>, IEquatable<string>, IConvertible, ICloneable`.
PR Perfare#903 commented out the entire third pass of DummyAssemblyGenerator.GenerateAssemblies (lines 384-447 in the merge) that writes CustomAttributes to type/field/method/parameter/property/ event entries on the generated DummyDll .dll files. Without it, dnSpy/ ILSpy/UABE consumers see no attributes. The block is uncommented as-is; CreateCustomAttribute and the VisitCustomAttributeData iterator API both still exist with compatible signatures, and customAttributeIndex (Max=24) being default-0 for v25+ is handled inside GetCustomAttributeIndex via token-based lookup. The companion Il2CppDecompiler dump.cs attribute path was unaffected (uses GetStringCustomAttributeData() - different code path).

This is mostly working except for
DummyAssemblyGenerator.cs, where custom attribute-related code is disabled. I also make some assumptions inStructGenerator.csregarding howIL2CPP_TYPE_VARandIL2CPP_TYPE_MVARare treated.Version 35
Metadata changes:
Il2CppTypeDefinition.elementTypeIndexIl2CppStringLiteral.lengthVersion 38
Metadata changes:
Metadata.interfaceIndicesreplaced withinterfaceOffsetPairsMetadata.constraintIndicesis auint16_t, not auint32_tInstead of having separate offset/size fields in
Metadata, we now haveIl2CppSectionMetadataobjects which hold an offset/size/count triplet. Additionally, this version introduced three variable-sized types:TypeIndexTypeDefinitionIndexGenericContainerIndexwhich can be 1, 2, or 4 bytes depending on the number of each object type we need to store.
Version 39
Introduced
ParamIndex. No other changes.