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

SamboyCoding / Cpp2IL / 17216182984

25 Aug 2025 05:35PM UTC coverage: 30.38% (-4.0%) from 34.352%
17216182984

Pull #481

github

web-flow
Merge b82763a24 into d5260685f
Pull Request #481: Decompiler

1804 of 7561 branches covered (23.86%)

Branch coverage included in aggregate %.

100 of 1839 new or added lines in 29 files covered. (5.44%)

41 existing lines in 6 files now uncovered.

4093 of 11850 relevant lines covered (34.54%)

165575.01 hits per line

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

0.0
/Cpp2IL.Core/InstructionSets/Arm64InstructionSet.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using Cpp2IL.Core.Api;
6
using Cpp2IL.Core.Il2CppApiFunctions;
7
using Cpp2IL.Core.ISIL;
8
using Cpp2IL.Core.Model.Contexts;
9
using Cpp2IL.Core.Utils;
10
using LibCpp2IL;
11

12
namespace Cpp2IL.Core.InstructionSets;
13

14
public class Arm64InstructionSet : Cpp2IlInstructionSet
15
{
16
    public override Memory<byte> GetRawBytesForMethod(MethodAnalysisContext context, bool isAttributeGenerator)
17
    {
18
        //Avoid use of capstone where possible
19
        if (true || context is not ConcreteGenericMethodAnalysisContext)
20
        {
21
            //Managed method or attr gen => grab raw byte range between a and b
22
            var startOfNextFunction = (int)MiscUtils.GetAddressOfNextFunctionStart(context.UnderlyingPointer) - 1;
×
23
            var ptrAsInt = (int)context.UnderlyingPointer;
×
24
            var count = startOfNextFunction - ptrAsInt;
×
25

26
            if (startOfNextFunction > 0)
×
27
                return LibCpp2IlMain.Binary!.GetRawBinaryContent().AsMemory(ptrAsInt, count);
×
28
        }
29

30
        var instructions = Arm64Utils.GetArm64MethodBodyAtVirtualAddress(context.UnderlyingPointer);
×
31

32
        return instructions.SelectMany(i => i.Bytes).ToArray();
×
33
    }
34

35
    public override List<Instruction> GetIsilFromMethod(MethodAnalysisContext context)
36
    {
NEW
37
        return [];
×
38
    }
39

40
    public override List<object> GetParameterOperandsFromMethod(MethodAnalysisContext context)
41
    {
42
        return [];
×
43
    }
44

45
    public override BaseKeyFunctionAddresses CreateKeyFunctionAddressesInstance() => new Arm64KeyFunctionAddresses();
×
46

47
    public override string PrintAssembly(MethodAnalysisContext context)
48
    {
49
        var sb = new StringBuilder();
×
50

51
        var instructions = Arm64Utils.GetArm64MethodBodyAtVirtualAddress(context.UnderlyingPointer);
×
52

53
        var first = true;
×
54
        foreach (var instruction in instructions)
×
55
        {
56
            if (!first)
×
57
                sb.AppendLine();
×
58

59
            first = false;
×
60
            sb.Append("0x").Append(instruction.Address.ToString("X")).Append(" ").Append(instruction.Mnemonic).Append(" ").Append(instruction.Operand);
×
61
        }
62

63
        return sb.ToString();
×
64
    }
65
}
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