icsharpcode / ILSpy

.NET Decompiler with support for PDB generation, ReadyToRun, Metadata (&more) - cross-platform!
21.45k stars 3.35k forks source link

yield return x bug #395

Closed Warstone closed 7 years ago

Warstone commented 11 years ago

Trying to disassemble bsgo.com unity3d C# lib...

There is bogus disassembled code (ActorLevel):

private IEnumerator WaitForPrefab(AssetRequest request)
    {
        AvatarLevel.<WaitForPrefab>c__Iterator7 <WaitForPrefab>c__Iterator = new AvatarLevel.<WaitForPrefab>c__Iterator7();
        <WaitForPrefab>c__Iterator.request = request;
        <WaitForPrefab>c__Iterator.<$>request = request;
        <WaitForPrefab>c__Iterator.<>f__this = this;
        return <WaitForPrefab>c__Iterator;
    }

It's called from

base.StartCoroutine(this.WaitForPrefab(request));

Description of StartCoroutine is here: http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.StartCoroutine.html

You can get library from unity3d file with Unity3D Obfuscator http://unity3d.netobf.com/unity3dobfuscator (free version is fine)

dgrunwald commented 7 years ago

This was likely fixed in the new decompiler engine (which just landed on the master branch).