Skip to content

[feature proposal] Option for removing IL bodies from R2R images #52190

Description

@raffaeler

For years, the native vs managed debate was centered around the intellectual property / obfuscation problem.
I still periodically discuss with customers about the need to make it harder the decompilation of certain parts of an application.
I am very aware that any language can be reversed and therefore this is just a matter of rising the bar.
Anyway, talking about .NET adoption, the obfuscation problem is often brought as an example.

In the current versions, .NET is now able to perform AOT on various bases, but still keeping the IL Body of the methods inside the assemblies. In certain cases the runtime still needs them (generics is just an example), but in others the IL could probably be removed without any impact.

I am wondering whether it would be possible, for limited portions of an assembly to:

  • leave all the metadata (to avoid reflection issues and be able to reference it)
  • perform AOT (by targeting a specific platform with a RID)
  • remove certain IL Bodies [it would be helpful for the user to tag (with an attribute) the desired ones, so that we could now from the compiler whether there was some reason which prevented it]

In addition to the "obfuscation", there could be also a significant gain in terms of assembly size reduction.

I already looked at the CoreRT solution, but this works only if you want to generate a "C" style LIB or fully AOT the entire solution, which is not feasible for many applications and of course libraries.

Thoughts? Comments?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions