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

SamboyCoding / Cpp2IL / 24971814523

27 Apr 2026 01:07AM UTC coverage: 35.136% (-0.2%) from 35.366%
24971814523

Pull #542

github

web-flow
Merge 32624b1f2 into ed90670ff
Pull Request #542: Remove static mutable state from LibCpp2IL 2: Electric Boogaloo

1871 of 6663 branches covered (28.08%)

Branch coverage included in aggregate %.

303 of 568 new or added lines in 66 files covered. (53.35%)

12 existing lines in 11 files now uncovered.

4387 of 11148 relevant lines covered (39.35%)

268964.17 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