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

SamboyCoding / Cpp2IL / 25641285720

10 May 2026 10:18PM UTC coverage: 35.104% (-0.2%) from 35.33%
25641285720

Pull #542

github

web-flow
Merge 9249bcb5b into 6af99f218
Pull Request #542: Remove static mutable state from LibCpp2IL 2: Electric Boogaloo

1877 of 6693 branches covered (28.04%)

Branch coverage included in aggregate %.

303 of 569 new or added lines in 66 files covered. (53.25%)

12 existing lines in 11 files now uncovered.

4394 of 11171 relevant lines covered (39.33%)

268486.35 hits per line

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

0.0
/Cpp2IL.Core/Il2CppArrayUtils.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using LibCpp2IL;
5

6
namespace Cpp2IL.Core;
7

8
public static class Il2CppArrayUtils
9
{
NEW
10
    public static uint GetFirstItemOffset(Il2CppBinary binary) => (uint)(binary.is32Bit ? 0x10 : 0x20);
×
11
    //32-bit:
12
    //0x0: klass ptr
13
    //0x4: monitor ptr
14
    //0x8: bounds ptr (where offset 0 is length)
15
    //0xc: max length (uintptr)
16
    //0x10: first item ptr
17

18
    public static readonly List<UsefulOffset> UsefulOffsets =
×
19
    [
×
20
        new UsefulOffset("length", 0xC, typeof(int), true),
×
21

×
22
        //64-bit offsets:
×
23
        new UsefulOffset("length", 0x18, typeof(int), false)
×
24
    ];
×
25

26
    public static string? GetOffsetName(uint offset, Il2CppBinary binary)
27
    {
NEW
28
        var is32Bit = binary.is32Bit;
×
29

30
        return UsefulOffsets.FirstOrDefault(o => o.is32Bit == is32Bit && o.offset == offset)?.name;
×
31
    }
32

33
    public static bool IsIl2cppLengthAccessor(uint offset, Il2CppBinary binary)
34
    {
NEW
35
        return GetOffsetName(offset, binary) == "length";
×
36
    }
37

38
    public static bool IsAtLeastFirstItemPtr(uint offset, Il2CppBinary binary)
39
    {
NEW
40
        return offset >= GetFirstItemOffset(binary);
×
41
    }
42

43
    public class UsefulOffset(string name, uint offset, Type type, bool is32Bit)
×
44
    {
45
        public string name = name;
×
46
        public uint offset = offset;
×
47
        public Type type = type;
×
48
        public bool is32Bit = is32Bit;
×
49
    }
50
}
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