.Net Core 3 自包含的单个可执行文件可以反编译吗? [英] Can .Net Core 3 self-contained single executable be decompiled?
问题描述
我尝试使用 Dotpeek 和 ILSpy.Net 反编译(我自己的代码),但失败了.
<块引用>我是否需要对 .Net Core 3 的分布式二进制文件进行特殊混淆处理
您可以浏览到该文件夹并在那里找到您的托管 dll.您可以从该位置使用 ILSpy 进行反编译.
我写了一篇博文:https://eersonmez.blogspot.com/2020/02/ilspy-decompiling-net-core-self.html
I tried using Dotpeek and ILSpy.Net to decompile (my own code), they failed.
Do I need special obfuscation on distributed binaries of .Net Core 3 self-contained single executable ?
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<PublishTrimmed>true</PublishTrimmed>
<PublishReadyToRun>true</PublishReadyToRun>
<PublishSingleFile>true</PublishSingleFile>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>
</Project>
The single-file exe is really an unmanaged wrapper and ILSpy doesn't support decompiling this. But when you run the exe, it unwraps its contents to a temp folder. So you can find the managed dll there and decompile it using ILSpy.
To find the temp folder, you can use any tool that shows locations of assemblies loaded by a process. SysInternals Process Monitor (procmon) is a good one.
You can setup procmon to filter by your exe name, and when you launch your exe, procmon should show some events for assemblies being loaded from a temp folder:
You can browse to that folder and find your managed dll there. And you can decompile using ILSpy from that location.
I wrote a blog entry: https://eersonmez.blogspot.com/2020/02/ilspy-decompiling-net-core-self.html
这篇关于.Net Core 3 自包含的单个可执行文件可以反编译吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!