3

我可以为我的客户访问旧的管理系统,他想添加更多内容。我能够联系到最初编写主要 DLL 的人,然后我获得了控制权并开始围绕它们进行构建。但是现在,我也需要扩展原始版本,我别无选择,只能进行逆向工程。

我尝试了 Reflector Pro 和 JustDecompile,但获得的源代码充满了错误。ILSpy 运行良好,但仍然是我从 ILSpy 获得的示例代码:

    private static object ParseIntoValue(string stringValue, string targetType)
    {
        if (targetType != null)
        {
            if (<PrivateImplementationDetails>{C6507306-5ECF-4D05-8EE4-BD4D7781AC4E}.$$method0x600080f-1 == null)
            {
                <PrivateImplementationDetails>{C6507306-5ECF-4D05-8EE4-BD4D7781AC4E}.$$method0x600080f-1 = new Dictionary<string, int>(12)
                {
                    ...
                };
            }
            int num;
            if (<PrivateImplementationDetails>{C6507306-5ECF-4D05-8EE4-BD4D7781AC4E}.$$method0x600080f-1.TryGetValue(targetType, out num))
            {
                object result;
                switch (num)
                {

                cases are here...

                default:
                    goto IL_2A6;
                }
                return result;
            }
        }
        IL_2A6:
        return null;
    }

很明显,这里应用了某种形式的混淆。JustDecompile 和 Reflector Pro 的逆向代码完全没用。使用 ILSpy,我可以编译一些项目而无需任何修改。

我需要帮助来识别这种混淆(如果是这样的话)。最初的开发者说他没有混淆。我不确定。

谢谢。

4

1 回答 1

6

反编译代码中的PrivateImplementationDetails可以是自动实现的属性。

如果您<PrivateImplementationDetails>{C6507306-5ECF-4D05-8EE4-BD4D7781AC4E}.$$method0x600080f-1用属性替换代码似乎是有意义的。

Dictionary<string, int> MyProp { get; set;}

private static object ParseIntoValue(string stringValue, string targetType)
{
    if (targetType != null)
    {
        if (MyProp == null)
        {
           MyProp = new Dictionary<string, int>(12)
            {
                ...
            };
        }
        int num;
        if (MyProp.TryGetValue(targetType, out num))
        {
          ....
于 2012-03-07T13:25:13.293 回答