当dotpeek使用" // Stub方法(仅' ret'指令)"填充方法时,这意味着什么?

时间:2016-02-03 19:24:34

标签: c# linq compact-framework reverse-engineering dotpeek

我偶然发现了question询问linq的聚合算法,并认为这是逆向工程最能解答的问题,所以我去了Visual Studio并编写了以下代码(这个代码用于Compact框架项目,其中Combine函数只能有两个参数):

    public static string Combine(string path1, params string[] paths)
    {
        return paths.Aggregate(path1, System.IO.Path.Combine);
    }

然后我将光标设置为Aggregate方法,按下F12键(我安装了Resharper),并导致以下代码:

// Decompiled with JetBrains decompiler
// Type: System.Linq.Enumerable
// Assembly: System.Core, Version=3.9.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes
// MVID: 77D23A6E-E19D-435B-9CBB-733D74F92072
// Assembly location: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\WindowsEmbeddedCompact\v3.9\System.Core.dll

Lots of stuff...

public static TAccumulate Aggregate<TSource, TAccumulate>(this IEnumerable<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func)
{
  // Stub method ('ret' instruction only)
}

现在显然,这不是我调用Aggregate时运行的代码... Aggregate做了一些事情。问题是反编译器的结果究竟是什么?什么是逆向工程&#34;聚合&#34;方法

- 编辑 -

我刚刚意识到我在上面所说的只有在 Compact Framework 项目中完成时,当我对标准框架进行反编译时,我会得到正确的源代码。

1 个答案:

答案 0 :(得分:0)

如果要反编译CF程序集,则必须使用实际的BCL,而不是通常在Studio中用作引用的存根(不,我不知道他们为什么这样做)。我看到你正在使用3.9,所以我不确定你需要查看的路径,但对于3.5,你可以在这里找到它们:

  

C:\ Program Files(x86)\ Microsoft.NET \ SDK \ CompactFramework \ v3.5 \ Debugger \ BCL

相关问题