[英]Is this line of code from ILSpy decompiler valid?
I decompiled a release assembly using ILSPy and I got code like below. 我使用ILSPy反编译了一个发布程序集,我得到了如下代码。 When I open the decompiled project in VS 2013, I get an error for each of these statements.
当我在VS 2013中打开反编译项目时,每个语句都会出错。
using #j;//this line shows up as an error in VS2013
using System;
The error is: 错误是:
Preprocessor directives must appear as the first non-whitespace character on a line
预处理程序指令必须显示为一行中的第一个非空白字符
I get a similar error at following line also. 我也在下一行得到了类似的错误。
string path = #db.#ab(HttpUtility.UrlDecode(text));
Question : What is the meaning of using #
and how can I correct these errors? 问题 :使用
#
的含义是什么?如何更正这些错误?
I have also noticed that some decompiled classes have names starting with #
and so do some namespaces and method names. 我还注意到一些反编译的类的名称以
#
开头,因此一些名称空间和方法名称也是如此。 I have never used such a naming convention, so it's very confusing how 'ILSpy` came up with such code. 我从来没有使用过这样的命名约定,所以'ILSpy`如何提出这样的代码是非常令人困惑的。
No, it's not valid C#. 不,它不是有效的C#。 Chances are it's decompiled code that was obfuscated to start with, so using identifiers that are valid in IL but not in C#.
有可能它是反编译的代码,一开始就被混淆了,所以使用在IL中有效但在C#中没有的标识符。
Typically, if you're decompiling obfuscated code, you're doing something against the wishes of the original authors of the code - so I'd suggest just not doing that. 通常情况下,如果您正在反编译混淆代码,那么您正在做一些违反代码原始作者意愿的事情 - 所以我建议不要这样做。 If you think you have a legitimate reason for getting the source code for something, ask the author.
如果您认为有正当理由获取某些内容的源代码,请询问作者。
Could you convert this into valid C#? 你能把它转换成有效的C#吗? Sure - just take every
#
-prefixed identifier, and map it (consistently) onto something else, eg 当然-只是采取一切
#
-prefixed标识,并将其映射(一致)到别的东西,如
using hashj;
...
string path = hashdb.hashab(HttpUtility.UrlDecode(text));
... and eventually you'll run across a class called #db
which you'd then rename to hashdb
etc. But the point of the obfuscation is to make this a painful process. ...最终你会遇到一个名为
#db
的类,然后你将它重命名为hashdb
等。但混淆的重点是使这个过程变得很痛苦。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.