使用ildasm获取源代码_有什么比ILDasm好? ILSpy和dnSpy是反编译.NET代码的工具
使用ildasm獲取源代碼
.NET code (C#, VB, F#, etc) compiles (for the most part) into Intermediate Language (IL) and then makes it way to native code usually by Just-in-time (JIT) compilation on the target machine. When you get a DLL/Assembly, it's pre-chewed but not full juiced, to mix my metaphors.
.NET代碼(大部分是C#,VB,F#等)會(huì)編譯為中間語言(IL),然后通常通過在目標(biāo)計(jì)算機(jī)上進(jìn)行即時(shí)(JIT)編譯將其轉(zhuǎn)換為本地代碼。 當(dāng)您獲得DLL /程序集時(shí),將其進(jìn)行預(yù)咀嚼但未完全溶解,以混合我的隱喻。
Often you'll come along a DLL that you want to learn more about. Sometimes you'll want to just see the structure of classes, methods, etc, and other times you want to see the IL - or a close representation of the original C#/VB/F#, etc. You're not looking at the source, you're seeing a backwards projection of the IL as whatever language you want. You're basically taking this pre-chewed food and taking it out of your mouth and getting a decent idea of what it was originally.
通常,您會(huì)遇到想要了解更多信息的DLL。 有時(shí),您只想看一下類,方法等的結(jié)構(gòu),而有時(shí)又想看一下IL-或原始C#/ VB / F#的近似表示,等等。您不是在看源代碼。 ,無論您想要哪種語言,您都會(huì)看到IL的向后投影。 您基本上是在將這種預(yù)先咀嚼的食物從嘴里拿出來,對它的原味有個(gè)不錯(cuò)的了解。
I've used ILDasm for years, but it's old and lame and people tease you for using it because they are cruel. ;)
我已經(jīng)使用ILDasm多年了,但是它又老又la腳,人們嘲笑您使用它,因?yàn)樗鼈兒軞埧帷?;)
Seriously, though, I use ILDasm - the IL Disassembler - simply because it's already installed. Those tweets got me thinking though that I need to update my options, so I'm trying out ILSpy and dnSpy.
嚴(yán)重的是,我使用ILDasm-IL Disassembler-僅僅是因?yàn)樗呀?jīng)安裝了。 這些推文讓我開始思考,盡管我需要更新我的選項(xiàng),所以我正在嘗試ILSpy和dnSpy 。
ILSpy (ILSpy)
ILSpy has been around for a while and has multiple front-ends, including ones for Linux/Mac/Windows based on Avalonia in the form of AvaloniaSpy. You can also integrate ILSpy into Visual Studio 2017 or 2019 with this extension. There is also a console decompiler and, interestingly, cross-platform PowerShell cmdlets.
ILSpy已經(jīng)有一段時(shí)間,有多個(gè)前端,包括基于Avalonia尼亞用于Linux / Mac的/ Windows的那些AvaloniaSpy的形式。 您還可以使用此擴(kuò)展將ILSpy集成到Visual Studio 2017或2019中。 還有一個(gè)控制臺反編譯器,以及有趣的是跨平臺的PowerShell cmdlet 。
I've always liked the "Open List" feature of ILSpy where you can open a preconfigured list of assemblies you want to browse, like ASP.NET MVC, .NET 4, etc. A fun open source contribution for you might be to update the included lists with newer defaults. There's so many folks doing great work in open source out there, why not jump in and help them out?
我一直很喜歡ILSpy的“打開列表”功能,您可以在其中打開要瀏覽的程序集的預(yù)配置列表,例如ASP.NET MVC,.NET 4等。對您來說,一個(gè)有趣的開源貢獻(xiàn)可能是更新包含的列表具有較新的默認(rèn)設(shè)置。 有這么多人在開源方面做得很好,為什么不跳進(jìn)來幫助他們呢?
dnSpy (dnSpy)
dnSpy has a lovely UI AND a great Console app using the same engine. It's amazingly polished and VERY complete. I was surprised that it also has a full hex editor as well as property pages for common EXE file headers. From their GitHub, dnSpy features
dnSpy具有漂亮的用戶界面和使用相同引擎的出色控制臺應(yīng)用程序。 它非常拋光,非常完整。 我很驚訝它還具有完整的十六進(jìn)制編輯器以及常見EXE文件標(biāo)頭的屬性頁。 從GitHub的dnSpy功能
- Debug .NET Framework, .NET Core and Unity game assemblies, no source code required 調(diào)試.NET Framework,.NET Core和Unity游戲程序集,無需源代碼
- Edit assemblies in C# or Visual Basic or IL, and edit all metadata 編輯C#或Visual Basic或IL中的程序集,并編輯所有元數(shù)據(jù)
- Light and dark themes 淺色和深色主題
- Extensible, write your own extension 可擴(kuò)展,編寫自己的擴(kuò)展
- High DPI support (per-monitor DPI aware)高DPI支持(每個(gè)監(jiān)視器都知道DPI)
dnSpy takes it to the next level with an integrated Debugger, meaning you can attach to a running process and debug it without source code - but it feels like source code because it's decompiling for you. Note where it says C#, I can choose C#, VB, or IL as a "view" on my decompiled code.
dnSpy通過集成的調(diào)試器將其提升到一個(gè)新的水平,這意味著您可以附加到正在運(yùn)行的進(jìn)程中,而無需源代碼即可對其進(jìn)行調(diào)試-但這就像源代碼,因?yàn)樗跒槟淳幾g。 請注意,在顯示C#的地方,我可以選擇C#,VB或IL作為反編譯代碼上的“視圖”。
Here is dnSpy actually debugging ILSpy and stopped at a decompiled breakpoint.
這是dnSpy實(shí)際上正在調(diào)試ILSpy并在反編譯的斷點(diǎn)處停止的情況。
There's a lot of great low-level stuff in this space. Another cool tool is Reflexil, a .NET Assembly Editor as well as de4dot by the same mysterious author as dnSpy. JetBrains has the excellent dotPeek and Telerik has JustDecompile. Commercial Tools include Reflector.
在這個(gè)空間中,有很多很棒的底層?xùn)|西。 另一個(gè)很酷的工具是.NET程序集編輯器Reflexil,以及與dnSpy一樣神秘的作者的de4dot。 JetBrains具有出色的dotPeek,而Telerik具有JustDecompile 。 商業(yè)工具包括Reflector 。
What's your favorite?
你最喜歡什么?
Sponsor: Manage GitHub Pull Requests right from the IDE with the latest JetBrains Rider. An integrated performance profiler on Windows comes to the rescue as well.
贊助商:使用最新的JetBrains Rider從IDE直接管理GitHub Pull Requests。 Windows上的集成性能分析器也可以解決。
翻譯自: https://www.hanselman.com/blog/whats-better-than-ildasm-ilspy-and-dnspy-are-tools-to-decompile-net-code
使用ildasm獲取源代碼
總結(jié)
以上是生活随笔為你收集整理的使用ildasm获取源代码_有什么比ILDasm好? ILSpy和dnSpy是反编译.NET代码的工具的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 2019年3月未来教育计算机二级题库,2
- 下一篇: asp.net ajax控件工具集 Au