dnSpyEx / dnSpy

Unofficial revival of the well known .NET debugger and assembly editor, dnSpy
GNU General Public License v3.0
7.02k stars 462 forks source link

How to decompile AOT .net assemblies #280

Closed Bluscream closed 11 months ago

Bluscream commented 11 months ago

Description

They always just show up as "PE" but don't give any usable code?

If these can't be decompiled with dnSpy anymore, is this more or less the end of dnSpy because every app will use it in the future?

Ref: Ahead-of-time compilation

Suchiman commented 11 months ago

because every app will use it in the future?

i highly doubt that but yeah there's no way to get IL / C# back out of NativeAOT compiled apps, see also https://migeel.sk/blog/2023/09/15/reverse-engineering-natively-compiled-dotnet-apps/ from the primary developer of NativeAOT

Bluscream commented 11 months ago

Damn, this is a bummer. IL2Cpp is already a pain in unity apps, but now Unity is probably getting built-in AOT support and later on it's going to be the default. RIP tools like MelonLoader/BepInEx 🪦

Thanks anyway for the heads up.

Sewer56 commented 11 months ago

IL2Cpp is already a pain in unity apps,

IL2Cpp is literally paradise for people modding games; if that is the intent.

You get all of the symbol information, including structure info completely for free; whereas with native games you have to reverse engineer these things from scratch.

I would not be really complaining about getting knowledge that will save you 1000+ hours of reversing for free. At least while you still have it.

GazziFX commented 11 months ago

NativeAOT also has metadata, unless its stripped with reflection free mode

ElektroKill commented 11 months ago

Decompiling NativeAOT or IL2CPP will never be available in dnSpy. Those files do not have regular .NET metadata and they also do not have any IL code. All the code is in an unmanaged assembly language (depending on the target platform).