了解 Reflector 重建的 C# 字符串
我被要求帮助一个 C# 项目,该项目的源代码不再可用。幸运的是,可以使用该项目的非混淆调试版本,因此我通过 Reflector 运行它,重构的源代码看起来基本没问题。
我有一个奇怪的问题。一些显然应该是字符串的对象如下所示:
string str7 = new string();
str7.Value = strArray3[k];
现在,字符串没有无参数构造函数,也没有 Value 属性。我想我可以删除实例化并删除 .Value 属性,事情可能会按预期工作,但我想了解是否可能存在比 Reflector bug 更多的事情。
另一件有趣的事情是,几乎所有变量都是用听起来原始的名称来重建的,但是这个变量(以及其他一些变量)似乎被分配了随机名称。
任何见解都非常受欢迎。
I have been asked to help with a C# project where the source code is no longer available. Fortunately a non-obfuscated debug build of the project is available, so I ran it through Reflector and the reconstructed source code looks largely fine.
There is one oddity that I have a question about. Some objects that pretty clearly should be a string are coming out like this:
string str7 = new string();
str7.Value = strArray3[k];
Now, string does not have a parameterless constructor nor does it have a Value property. I think I can just remove the instantiation and remove the .Value property and things will probably work as expected, but I would like to understand if there might be something more going on than a Reflector bug.
One other interesting piece is that almost all of the variables were reconstructed with original-sounding names, but this one (and a few others) seem to have been assigned random names.
Any insight is very welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您能否针对发生这种情况的同一方法同时发布 IL 和反编译的 C#?
该程序集中不会偶然出现“类字符串 { ... }”,不是吗?
Can you post both the IL and decompiled C# for the same method where this happens?
There isn't by chance a "class string { ... }" in that assembly, is there?