问题标签 [ilspy]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
469 浏览

vb.net - 什么是反编译的 VB 中的 __PostIncrement(通过 ILSpy)

我只是在仔细System.Collections.Generic.List(Of T).Add(item As T)阅读使用 ILSpy 的反编译代码,然后找到了对__PostIncrement. 我在VB中从未听说过这样的事情,所以我做了一些挖掘并发现:

  1. 在 VB 中,代码为Me._items(__PostIncrement(Me._size)) = item.
  2. 在 C# 中,代码this._items[this._size++] = item;使用该语言中的实际后增量运算符
  3. 在 MSIL 中,没有函数调用。它似乎像 C# 后增量一样工作(评论是我的,但我不是 MSIL 的专家,所以我可能是错的)。

代码是:

这到底是什么__PostIncrement?在VB中符号化后增量IL代码是SharpDevelop的发明吗?或者它实际上是我可以在我自己的 VB 代码中使用的某种定义?

0 投票
2 回答
441 浏览

c# - Microsoft 内部属性 - 此属性没有设置器

当我从课堂上发现这个时,我正在使用 ILSpy 仔细阅读一些系统System.Internal.HandleCollector类:

当 VisualStudio 抱怨(我复制了该类)该属性没有设置器时,微软如何编译它?有人可以分解为什么这有效但我的 VS 副本抱怨(构建标志?)?

此属性没有设置器

每个HandleCollector.HandleAdded =语句都有错误。

0 投票
1 回答
758 浏览

c# - 反编译的程序集 - 异常代码

我使用 ILSpy 反编译了一个程序集,其中一个类特别引起了我的注意:

在代码中,似乎私有委托用于触发实际事件:

问题:假设没有发生一些“编译/反编译魔术”,有人能猜出这个自定义访问器背后的想法是什么吗?我对IL不太熟悉,顺便说一句...

(旁注:应用程序是多线程的,并且显然利用了网络。)

0 投票
2 回答
238 浏览

c# - Reinserting XML Comments into a tree of C# source files from the auto generated [assembly].xml files

My Situation:
So, I decompiled a .NET assembly with ILSpy into C# last week; since, then, I've put a ton of labour into massaging the files/project, etc. so that they all work correctly again (there were lots of little bugs [mostly caused by ILSpy's code generation process] and random issues and I've been fixing them as I go). I'm now inches away from my goal, with the finish line in sight!

But, lo, and behold: I just realized all of the XML comments are missing. >.<

I did some scouring and I was able to find the .xml intelli-sense file, with all the Visual Studio generated comments inside.

What I would Like to Accomplish:
I would LIKE to copy these comments from the generated .xml intelli-sense file back into the source files (in an automated fashion of course, as there are about 5000 classes in this Assembly).

My Question:
How should I proceed? Are there any tools that can do help me automate this task?

0 投票
1 回答
42 浏览

c# - Need option to select declaration style

Can anyone please help in this problem?

============

When we decompile code from assembly (example):

we get code in the format where all the "using" statements are at top of file and the classes are placed appropriately.

This is problem for me. I need to know the full namespace path to a class/struct/enum etc. after decompilation. So, instead of having all the namespaces in "using" block, is there an option to write full class path for each object?

Example of desired output:

============

Link to my post on ILSpy forum

http://community.sharpdevelop.net/forums/t/19302.aspx

0 投票
1 回答
1449 浏览

c# - 使用 ILSpy 后删除 goto/switch 状态

我在使用 ILSpy 时遇到了一些问题。我正在使用这个工具来反编译一个 DLL,但它存在很多垃圾。使用 ILSpy 后如何删除“goto”?:'(

有什么建议么?

提前致谢。

0 投票
1 回答
1065 浏览

.net - 无法使用 ILSpy 为 Windows Phone 8 反编译 System.Windows.dll

我正在使用免费的 .NET 程序集反编译器ILSpy来分析标准和第 3 方 .NET 程序集。它适用于标准的 .NET WinForms 和 WPF 库,但我无法为位于 .NET 中的 Windows Phone 8 反编译 System.Windows.dll C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\WindowsPhone\v8.0\。它显示成员,但他们的内部(源代码)是空的。

是 ILSpy 的问题,还是我们无法使用任何其他工具(如 Red Gate 的 .NET Reflector)反编译 Windows Phone .NET 库?有没有其他方法可以获取/查看这些程序集的源代码?

0 投票
1 回答
734 浏览

reflection - Windows CE 程序集使用的 .NET 运行时版本是否必须与 CF 版本匹配?

想知道是否有一个工具可以告诉我使用哪个版本的紧凑框架来构建我们已离职/已离职的前同事留下的 exe 遗物,我发现了这个

我按照 tsandhol 的建议下载了 ILSpy,但没有看到 TargetFramework 条目。这就是它包含的内容(一些字符串被混淆以保护据称无辜的人):

那么这里的相关信息是“运行时:.NET 1.1”吗?

我是否可以由此推断 TargetFramework 是 CF 版本 1.0.*?

更新

我确实在为最新最好的应用程序(不是 CF/CE 应用程序)构建的应用程序上获得了 TargetFramework:

更新 2

尝试另一个建议(Corflags),它给了我这个:

在此处输入图像描述

...但这只是把我带到了这里,搜索“CF 1.0.3316.00”似乎把它弄糊涂了。

更新 3

奇怪的是,dotPeek 声称此应用程序的 .Net 框架是 v4.5...?!?

更新 4

我得到了三个不同的故事:有问题的 .exe 使用哪些 DLL。

dotPeek 显示的唯一参考资料是:

ILSpy 显示的参考文献:

设备上的 DLL,位于 \Program Files\HHS:

所有三个列表中唯一的一个是System.Data.SqlServerCe

否则,共同点是:

更新 5

使用 ctacke 的建议使用 .NET Reflector,我看到了有问题的 .exe:

所以我所拥有的是一个具有 CF 1.0.3316.00 的设备,这个 .exe 在其上运行(因为它针对版本 1,我猜,虽然版本 #s 不完全匹配),以及另一个具有两个 CF 版本的设备2 和 3.5,但此 .exe 既不在其上运行,也不基于针对版本 2 的相同代码。

更新 6

在使用 .NET Reflector 导出一些 by-it 反汇编的源代码。它遇到了一些无法自动解析引用程序集的情况:

在此处输入图像描述

对于前几个实例,我能够找到文件并添加它们。但是,对于“system.windows.forms.datagrid”,不行——它们不在我的系统上。

那么在这种情况下我应该“跳过”,还是会阻止我构建反汇编的源(我假设需要“system.windows.form.datagrid”,否则它会被“取消引用”)项目)?

我继续跳过,因为我无权访问这两个文件:

跳过这些文件后,我打开了创建的源反射器。项目清理干净;当我尝试构建时,它向我显示了一个保存 sln 文件的对话框(Reflector 只生成了一个 csproj 文件)。

构建失败,出现 35 个错误,例如:此处的“意外字符 $ ”:

我认为这是因为那些丢失/跳过的 DLL。

这两个丢失的文件在 3090 上也不存在!为什么它们需要构建/反汇编,但在运行 .exe 的设备上甚至不存在?

0 投票
5 回答
34878 浏览

sql-server - Visual Studio 2013 中的调用目标已引发异常

今天打开Visual Studio 2013 Professional Edition的时候报错exception has been thrown by a target of invocation.

我也试图打开ILSpy调试一个dll,但它崩溃了。我认为它可能来自同一个杀手。对于我做的系统是我SQL Server 2012昨天安装的专业版。

我检查了环境路径。这是:

C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Intel\iCLS Client\;C: \Program Files\Intel\iCLS Client\;c:\Program Files (x86)\AMD APP\bin\x86_64;c:\Program Files (x86)\AMD APP\bin\x86;%SystemRoot%\system32;%SystemRoot %;%SystemRoot%\System32\Wbem;c:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C: \Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel( R) 管理引擎组件\IPT;C:\Program Files\Dell\Dell Data Protection\Access\Advanced\Wave\Gemalto\Access Client\v5\;C:\Program Files (x86)\NTRU Cryptosystems\NTRU TCG 软件堆栈\bin\;C:\Program Files\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files (x86)\Windows Live\Shared;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c :\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\ Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\; C:\Program Files\Microsoft\Web Platform Installer\;c:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;%systemroot%\System32\WindowsPowerShell\v1.0\ ;C:\source\Orion\trunk\packages\NuGet.CommandLine.2.2.0\tools;%TFSPowerToolDir%;%BPADir%;%HummPATH14%;%systemroot%\System32\WindowsPowerShell\v1.0\;C:\程序文件 (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools \Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86 )\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\

我的操作系统是 Windows 7 64 位。

activitylog.xml 有:

0 投票
2 回答
1025 浏览

c# - 使用 ILSpy/Reflector 无法看到 System.Management.ManagementDateTimeConverter.ToDateTime(string) 的反编译代码?

我正在尝试查看 System.Management 的实际实现细节。ManagementDateTimeConverter.ToDateTime(字符串)使用ILspy?它没有显示任何东西。然后我认为这可能是 ILSpy 中的一个错误,并尝试使用 Reflector 查看反编译的代码 - 但它也没有显示详细信息(请参阅下面的代码片段)。

基本上我想看看如何解析 cim 日期时间 - 有关详细信息,您可以参考:(这个时间值是什么格式?将 CIM_DateTime 解析为 .Net DateTime

问题

  1. 为什么我看不到这个特定函数/程序集的反编译代码?

  2. 有关 managementdatetimeconverter 如何解析 CIM DateTime 类型的字符串的任何详细信息?