• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SamboyCoding / Cpp2IL / 28719485642

04 Jul 2026 08:59PM UTC coverage: 35.251% (-3.5%) from 38.757%
28719485642

push

github

SamboyCoding
Core: Drop explicit net7 and net6 TFMs

Note these are still usable via the netstandard TFM so this doesn't break any use cases, but several packages were warning about not being tested on these TFMs.

2595 of 8474 branches covered (30.62%)

Branch coverage included in aggregate %.

4947 of 12921 relevant lines covered (38.29%)

162592.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.0
/LibCpp2IL/BinaryStructures/Il2CppCodeRegistration.cs
1
namespace LibCpp2IL.BinaryStructures;
2

3
public class Il2CppCodeRegistration : ReadableClass
4
{
5
    /*
6
     * IMPORTANT:
7
     * Again, like in Il2CppMetadataRegistration, all of the counts are defined as int32_t, but due to alignment, we treat them as native-width uints.
8
     * See the comment in Il2CppMetadataRegistration for more info.
9
     */
10
    public static int GetStructSize(bool isBinary32Bit, float metadataVersion)
11
    {
12
        //Unfortunately, this struct is not a fixed size, so we have to do some manual calculations.
13
        var size = 0;
38✔
14
        var ptrSize = isBinary32Bit ? 4 : 8;
38!
15

16
        if (metadataVersion <= 24.15f)
38!
17
            //methodPointers
18
            size += 2 * ptrSize;
×
19

20
        //reversePInvokeWrappers and genericMethodPointers
21
        size += 4 * ptrSize;
38✔
22

23
        if (metadataVersion is (>= 24.5f and < 27f) or >= 27.1f)
38!
24
            //genericAdjustorThunks
25
            size += ptrSize;
38✔
26

27
        //invokerPointers
28
        size += 2 * ptrSize;
38✔
29

30
        if (metadataVersion <= 24.5f)
38✔
31
            //customAttributes
32
            size += 2 * ptrSize;
25✔
33

34
        //unresolvedVirtualCallPointers
35
        size += 2 * ptrSize;
38✔
36

37
        if (metadataVersion is (>= 29.1f and < 31f) or >= 31.1f)
38!
38
            //unresolvedInstanceCallPointers and unresolvedStaticCallPointers
39
            size += 2 * ptrSize;
13✔
40

41
        if (metadataVersion >= 23f)
38!
42
            //interopData
43
            size += 2 * ptrSize;
38✔
44

45
        if (metadataVersion >= 24.3f)
38!
46
            //windowsRuntimeFactoryTable
47
            size += 2 * ptrSize;
38✔
48

49
        if (metadataVersion >= 24.2f)
38!
50
            //addrCodeGenModulePtrs
51
            size += 2 * ptrSize;
38✔
52

53
        return size;
38✔
54
    }
55

56
    [Version(Max = 24.15f)] public ulong methodPointersCount;
57
    [Version(Max = 24.15f)] public ulong methodPointers;
58

59
    public ulong reversePInvokeWrapperCount;
60
    public ulong reversePInvokeWrappers;
61

62
    public ulong genericMethodPointersCount;
63
    public ulong genericMethodPointers;
64

65
    //Present in v27.1 and v24.5, but not v27.0
66
    [Version(Min = 27.1f)] [Version(Min = 24.5f, Max = 24.5f)]
67
    public ulong genericAdjustorThunks;
68

69
    public ulong invokerPointersCount;
70
    public ulong invokerPointers;
71

72
    [Version(Max = 24.5f)] //Removed in v27
73
    public ulong customAttributeCount;
74

75
    [Version(Max = 24.5f)] //Removed in v27
76
    public ulong customAttributeGeneratorListAddress;
77

78
    public ulong unresolvedVirtualCallCount; //Renamed to unresolvedIndirectCallCount in v29.1
79
    public ulong unresolvedVirtualCallPointers;
80

81
    [Version(Min = 29.1f, Max=31f), Version(Min=31.1f)] public ulong unresolvedInstanceCallPointers;
82
    [Version(Min = 29.1f, Max=31f), Version(Min=31.1f)] public ulong unresolvedStaticCallPointers;
83

84
    [Version(Min = 23)] public ulong interopDataCount;
85
    [Version(Min = 23)] public ulong interopData;
86

87
    [Version(Min = 24.3f)] public ulong windowsRuntimeFactoryCount;
88
    [Version(Min = 24.3f)] public ulong windowsRuntimeFactoryTable;
89

90
    [Version(Min = 24.2f)] public ulong codeGenModulesCount;
91
    [Version(Min = 24.2f)] public ulong addrCodeGenModulePtrs;
92

93
    public override void Read(ClassReadingBinaryReader reader)
94
    {
95
        if (IsAtMost(24.15f))
38!
96
        {
97
            methodPointersCount = reader.ReadNUint();
×
98
            methodPointers = reader.ReadNUint();
×
99
        }
100

101
        reversePInvokeWrapperCount = reader.ReadNUint();
38✔
102
        reversePInvokeWrappers = reader.ReadNUint();
38✔
103

104
        genericMethodPointersCount = reader.ReadNUint();
38✔
105
        genericMethodPointers = reader.ReadNUint();
38✔
106

107
        if (IsAtLeast(24.5f) && IsNot(27f))
38!
108
            genericAdjustorThunks = reader.ReadNUint();
38✔
109

110
        invokerPointersCount = reader.ReadNUint();
38✔
111
        invokerPointers = reader.ReadNUint();
38✔
112

113
        if (IsAtMost(24.5f))
38✔
114
        {
115
            customAttributeCount = reader.ReadNUint();
25✔
116
            customAttributeGeneratorListAddress = reader.ReadNUint();
25✔
117
        }
118

119
        unresolvedVirtualCallCount = reader.ReadNUint();
38✔
120
        unresolvedVirtualCallPointers = reader.ReadNUint();
38✔
121

122
        if (IsAtLeast(29.1f) && IsNot(31f))
38!
123
        {
124
            unresolvedInstanceCallPointers = reader.ReadNUint();
13✔
125
            unresolvedStaticCallPointers = reader.ReadNUint();
13✔
126
        }
127

128
        if (IsAtLeast(23f))
38!
129
        {
130
            interopDataCount = reader.ReadNUint();
38✔
131
            interopData = reader.ReadNUint();
38✔
132
        }
133

134
        if (IsAtLeast(24.2f))
38!
135
        {
136
            if (IsAtLeast(24.3f))
38!
137
            {
138
                windowsRuntimeFactoryCount = reader.ReadNUint();
38✔
139
                windowsRuntimeFactoryTable = reader.ReadNUint();
38✔
140
            }
141

142
            codeGenModulesCount = reader.ReadNUint();
38✔
143
            addrCodeGenModulePtrs = reader.ReadNUint();
38✔
144
        }
145
    }
38✔
146
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc