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

SamboyCoding / Cpp2IL / 15052278841

15 May 2025 06:16PM UTC coverage: 34.038% (-0.4%) from 34.453%
15052278841

push

github

SamboyCoding
Support injecting anything
* Nested types
* Events
* Properties
* Assemblies

Support additional metadata in injected assemblies

Make setter for TypeAnalysisContext::OverrideBaseType public

TypeAnalysisContext::InterfaceContexts as list rather than array

Fix sign bug

Support generic parameters on type contexts and method contexts

Make GenericParameterTypeAnalysisContext instances unique

Revert change to Il2CppGenericParameter::Index

Use attributes to determine if injected methods are static
* Also add hide by sig attribute for injected constructors

Support overrides on injected methods

In ControlFlowGraphOutputFormat, exclude injected assemblies

Ensure injected assemblies can't delete existing assemblies

Backing field on .NET Standard for injected method overrides

Implement requested change

1774 of 6622 branches covered (26.79%)

Branch coverage included in aggregate %.

147 of 196 new or added lines in 27 files covered. (75.0%)

53 existing lines in 2 files now uncovered.

4155 of 10797 relevant lines covered (38.48%)

188267.61 hits per line

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

53.85
/Cpp2IL.Core/Model/Contexts/InjectedMethodAnalysisContext.cs
1
using System.Collections.Generic;
2
using System.Reflection;
3
using LibCpp2IL.BinaryStructures;
4

5
namespace Cpp2IL.Core.Model.Contexts;
6

7
public class InjectedMethodAnalysisContext : MethodAnalysisContext
8
{
9
    public override ulong UnderlyingPointer => 0;
×
10

11
    public override string DefaultName { get; }
3✔
12

NEW
13
    public override bool IsStatic => Attributes.HasFlag(MethodAttributes.Static);
×
14

15
    public override bool IsVoid => InjectedReturnType?.Type is Il2CppTypeEnum.IL2CPP_TYPE_VOID;
×
16

17
    public override MethodAttributes Attributes { get; }
×
18
    
19
    protected override bool IsInjected => true;
×
20

21
    protected override int CustomAttributeIndex => -1;
×
22

NEW
23
    public override IEnumerable<MethodAnalysisContext> Overrides => OverridesList;
×
24
    public List<MethodAnalysisContext> OverridesList { get; } = [];
252✔
25

26
    public InjectedMethodAnalysisContext(TypeAnalysisContext parent, string name, TypeAnalysisContext returnType, MethodAttributes attributes, TypeAnalysisContext[] injectedParameterTypes, string[]? injectedParameterNames = null) : base(null, parent)
252✔
27
    {
28
        DefaultName = name;
252✔
29
        InjectedReturnType = returnType;
252✔
30
        Attributes = attributes;
252✔
31

32
        for (var i = 0; i < injectedParameterTypes.Length; i++)
672✔
33
        {
34
            var injectedParameterType = injectedParameterTypes[i];
84✔
35
            var injectedParameterName = injectedParameterNames?[i];
84!
36

37
            Parameters.Add(new InjectedParameterAnalysisContext(injectedParameterName, injectedParameterType, i, this));
84✔
38
        }
39
    }
252✔
40
}
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

© 2025 Coveralls, Inc