• 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/Il2CppMethodDefinitionUsefulOffsets.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 Il2CppMethodDefinitionUsefulOffsets
9
{
10
    public const int X86_SLOT_OFFSET = 0x00; //TODO
11
    public const int X86_64_SLOT_OFFSET = 0x48;
12

13
    public static readonly List<UsefulOffset> UsefulOffsets =
×
14
    [
×
15
        new UsefulOffset("slot", X86_SLOT_OFFSET, typeof(ushort), true),
×
16

×
17
        //64-bit offsets:
×
18
        new UsefulOffset("slot", X86_64_SLOT_OFFSET, typeof(ushort), false),
×
19
        new UsefulOffset("klass", 0x18, typeof(IntPtr), false),
×
20

×
21
        //TODO What *exactly* is this and when is it present? Found in Audica - TargetSpawnerLayoutUtil#UpdatePositions.
×
22
        new UsefulOffset("methodPtr", 0x30, typeof(IntPtr), false)
×
23
    ];
×
24

NEW
25
    public static bool IsSlotOffset(uint offset, Il2CppBinary binary) => GetOffsetName(offset, binary) == "slot";
×
NEW
26
    public static bool IsKlassPtr(uint offset, Il2CppBinary binary) => GetOffsetName(offset, binary) == "klass";
×
NEW
27
    public static bool IsMethodPtr(uint offset, Il2CppBinary binary) => GetOffsetName(offset, binary) == "methodPtr";
×
28

29
    public static string? GetOffsetName(uint offset, Il2CppBinary binary)
30
    {
NEW
31
        var is32Bit = binary.is32Bit;
×
32

33
        return UsefulOffsets.FirstOrDefault(o => o.is32Bit == is32Bit && o.offset == offset)?.name;
×
34
    }
35

36
    public class UsefulOffset(string name, uint offset, Type type, bool is32Bit)
×
37
    {
38
        public string name = name;
×
39
        public uint offset = offset;
×
40
        public Type type = type;
×
41
        public bool is32Bit = is32Bit;
×
42
    }
43
}
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