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

SamboyCoding / Cpp2IL / 24214080939

09 Apr 2026 09:24PM UTC coverage: 35.264% (-0.1%) from 35.373%
24214080939

Pull #542

github

web-flow
Merge 0799babd3 into 25552e0ff
Pull Request #542: Remove static mutable state from LibCpp2IL 2: Electric Boogaloo

1914 of 6805 branches covered (28.13%)

Branch coverage included in aggregate %.

255 of 483 new or added lines in 62 files covered. (52.8%)

46 existing lines in 8 files now uncovered.

4480 of 11327 relevant lines covered (39.55%)

263053.76 hits per line

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

82.61
/LibCpp2IL/BinaryStructures/Il2CppCodeGenModule.cs
1
using System;
2

3
namespace LibCpp2IL.BinaryStructures;
4

5
public class Il2CppCodeGenModule : ReadableClass
6
{
7
    public ulong moduleName; //pointer
8
    public long methodPointerCount; //ulong
9
    public ulong methodPointers; //pointer
10

11
    //Present in v27.1 and v24.5, but not v27.0
12
    [Version(Min = 27.1f)] [Version(Min = 24.5f, Max = 24.5f)]
13
    public long adjustorThunkCount;
14

15
    [Version(Min = 27.1f)] [Version(Min = 24.5f, Max = 24.5f)]
16
    public ulong adjustorThunks; //Pointer
17

18
    public ulong invokerIndices; //ulong
19
    public ulong reversePInvokeWrapperCount; //ulong
20
    public ulong reversePInvokeWrapperIndices;
21

22
    public long rgctxRangesCount;
23
    public ulong pRgctxRanges;
24

25
    public long rgctxsCount;
26
    public ulong rgctxs;
27
    public ulong debuggerMetadata;
28

29
    [Version(Min = 27, Max = 27.9f)] public ulong customAttributeCacheGenerator; //Removed in v29
30
    [Version(Min = 27)] public ulong moduleInitializer;
31
    [Version(Min = 27)] public ulong staticConstructorTypeIndices;
32
    [Version(Min = 27)] public ulong metadataRegistration; //Per-assembly mode only
33
    [Version(Min = 27)] public ulong codeRegistration; //Per-assembly mode only.
34

35
    private string? _cachedName;
36

37
    public string Name
38
    {
39
        get
40
        {
41
            if (_cachedName == null)
3,330✔
42
            {
43
                var binary = OwningBinary;
1,665✔
44
                if (binary == null)
1,665!
45
                    throw new InvalidOperationException("No binary context available to resolve Il2CppCodeGenModule.Name");
×
46

47
                _cachedName = binary.ReadStringToNull(binary.MapVirtualAddressToRaw(moduleName));
1,665✔
48
            }
49

50
            return _cachedName!;
3,330✔
51
        }
52
    }
53

54
    public Il2CppTokenRangePair[] RGCTXRanges
55
    {
56
        get
57
        {
NEW
58
            var binary = OwningBinary;
×
59
            if (binary == null)
×
60
                throw new InvalidOperationException("No binary context available to resolve Il2CppCodeGenModule.RGCTXRanges");
×
61

62
            return binary.GetRgctxRangePairsForModule(this);
×
63
        }
64
    }
65

66
    public override void Read(ClassReadingBinaryReader reader)
67
    {
68
        moduleName = reader.ReadNUint();
1,665✔
69
        methodPointerCount = reader.ReadNInt();
1,665✔
70
        methodPointers = reader.ReadNUint();
1,665✔
71

72
        if (IsAtLeast(24.5f) && IsNot(27))
1,665✔
73
        {
74
            adjustorThunkCount = reader.ReadNInt();
1,463✔
75
            adjustorThunks = reader.ReadNUint();
1,463✔
76
        }
77

78
        invokerIndices = reader.ReadNUint();
1,665✔
79
        reversePInvokeWrapperCount = reader.ReadNUint();
1,665✔
80
        reversePInvokeWrapperIndices = reader.ReadNUint();
1,665✔
81
        rgctxRangesCount = reader.ReadNInt();
1,665✔
82
        pRgctxRanges = reader.ReadNUint();
1,665✔
83
        rgctxsCount = reader.ReadNInt();
1,665✔
84
        rgctxs = reader.ReadNUint();
1,665✔
85
        debuggerMetadata = reader.ReadNUint();
1,665✔
86

87
        if (IsAtLeast(27f))
1,665✔
88
        {
89
            if (IsLessThan(29f))
413✔
90
                customAttributeCacheGenerator = reader.ReadNUint();
126✔
91

92
            moduleInitializer = reader.ReadNUint();
413✔
93
            staticConstructorTypeIndices = reader.ReadNUint();
413✔
94
            metadataRegistration = reader.ReadNUint();
413✔
95
            codeRegistration = reader.ReadNUint();
413✔
96
        }
97
    }
1,665✔
98
}
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