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

SamboyCoding / Cpp2IL / 23825638668

01 Apr 2026 12:20AM UTC coverage: 35.293% (-0.08%) from 35.373%
23825638668

Pull #539

github

web-flow
Merge 963638c77 into 25552e0ff
Pull Request #539: Refactor Il2CppBinary and related components

1965 of 6943 branches covered (28.3%)

Branch coverage included in aggregate %.

21 of 92 new or added lines in 20 files covered. (22.83%)

478 existing lines in 20 files now uncovered.

4483 of 11327 relevant lines covered (39.58%)

223963.8 hits per line

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

78.43
/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
    internal Il2CppBinary? OwningBinary { get; set; }
3,330✔
38

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

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

52
            return _cachedName!;
3,330✔
53
        }
54
    }
55

56
    public Il2CppTokenRangePair[] RGCTXRanges
57
    {
58
        get
59
        {
60
            var binary = OwningBinary ?? LibCpp2IlMain.Binary;
×
UNCOV
61
            if (binary == null)
×
62
                throw new InvalidOperationException("No binary context available to resolve Il2CppCodeGenModule.RGCTXRanges");
×
63

UNCOV
64
            return binary.GetRgctxRangePairsForModule(this);
×
65
        }
66
    }
67

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

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

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

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

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