如何从此枚举器反编译中取回原始代码?

时间:2017-03-31 09:54:18

标签: c# unity3d unity5 reverse-engineering decompiling

我正在尝试从旧的Unity项目中反编译一些代码,只有构建可用(在涉及数据丢失的事故之后)。大多数代码都反编译得相当好,但枚举器提供的代码如下:

    [CompilerGenerated]
    private sealed class <LoadFileTables>c__Iterator8 : IDisposable, IEnumerator, IEnumerator<object>
    {
        internal object $current;
        internal int $PC;
        internal DesignFileTableLoader<> f__this;
    internal IEnumerator<iter> __1;
    internal TableLoaderWorker<worker> __0;

    [DebuggerHidden]
    public void Dispose()
    {
        this.$PC = -1;
    }

    public bool MoveNext()
    {
        uint num = (uint)this.$PC;
        this.$PC = -1;
        switch (num)
        {
            case 0:
                this.< worker > __0 = new TableLoaderWorker(this.<> f__this.TableReader);
                this.< iter > __1 = this.<> f__this.LoadTable(this.< worker > __0, this.<> f__this._file.ElementTable, this.<> f__this.ElementTableStrategy);
                break;

            case 1:
                break;

            case 2:
                goto Label_00EB;

            case 3:
                goto Label_0145;

            case 4:
                goto Label_019F;

            case 5:
                goto Label_01F9;

            default:
                goto Label_0210;
        }
        if (this.< iter > __1.MoveNext())
        {
            this.$current = null;
            this.$PC = 1;
            goto Label_0212;
        }
        this.< iter > __1 = this.<> f__this.LoadTable(this.< worker > __0, this.<> f__this._file.LayerTable, this.<> f__this.LayerTableStrategy);
    Label_00EB:
        while (this.< iter > __1.MoveNext())
        {
            this.$current = null;
            this.$PC = 2;
            goto Label_0212;
        }
        this.< iter > __1 = this.<> f__this.LoadTable(this.< worker > __0, this.<> f__this._file.SceneTable, this.<> f__this.SceneTableStrategy);
    Label_0145:
        while (this.< iter > __1.MoveNext())
        {
            this.$current = null;
            this.$PC = 3;
            goto Label_0212;
        }
        this.< iter > __1 = this.<> f__this.LoadTable(this.< worker > __0, this.<> f__this._file.MaterialTable, this.<> f__this.MaterialTableStrategy);
    Label_019F:
        while (this.< iter > __1.MoveNext())
        {
            this.$current = null;
            this.$PC = 4;
            goto Label_0212;
        }
        this.< iter > __1 = this.<> f__this.LoadTable(this.< worker > __0, this.<> f__this._file.StatisticsTable, this.<> f__this.StatisticsTableStrategy);
    Label_01F9:
        while (this.< iter > __1.MoveNext())
        {
            this.$current = null;
            this.$PC = 5;
            goto Label_0212;
        }
        this.$PC = -1;
    Label_0210:
        return false;
    Label_0212:
        return true;
    }

    [DebuggerHidden]
    public void Reset()
    {
        throw new NotSupportedException();
    }

    object IEnumerator<object>.Current =>
        this.$current;

        object IEnumerator.Current =>
            this.$current;
    }

[CompilerGenerated]
private sealed class <LoadTable>c__Iterator9 : IDisposable, IEnumerator, IEnumerator<object>
    {
        internal object $current;
        internal int $PC;
        internal ITableLoadStrategy<$> strategy;
internal IDesignFileTable<$> table;
internal TableLoaderWorker<$> worker;
internal Exception<exception> __0;
internal ITableLoadStrategy strategy;
internal IDesignFileTable table;
internal TableLoaderWorker worker;

[DebuggerHidden]
public void Dispose()
{
    this.$PC = -1;
}

public bool MoveNext()
{
    uint num = (uint)this.$PC;
    this.$PC = -1;
    switch (num)
    {
        case 0:
            this.worker.StartLoadingTable(this.table, this.strategy);
            break;

        case 1:
            break;

        default:
            return false;

    }
    if (!this.worker.IsFinished)
    {
        this.$current = null;
        this.$PC = 1;
        return true;
    }
    this.< exception > __0 = this.worker.BackgroundThreadException;
    if (this.< exception > __0 != null)
    {
        throw this.< exception > __0;
    }
    this.$PC = -1;        
}

[DebuggerHidden]
public void Reset()
{
    throw new NotSupportedException();
}

object IEnumerator<object>.Current =>
    this.$current;

        object IEnumerator.Current =>
            this.$current;
    }
}

我真的不明白它是如何工作的,或者如何重写它,那些已经发现的变量和结果是什么?

0 个答案:

没有答案