Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

JetBrains C# Decompilation Errors

I'm doing a game modification project for a friend, and I am having issues with the decompiler. I have all of the source and such, and I've referenced all of the different dlls in the game correctly, but I get these errors:
Unexpected character '\u003C'
About 315 of them.
And when I double click, I see this comment:
// ISSUE: object of a compiler-generated type is created
And the code looks deformed:
Code
[DebuggerHidden]
  private IEnumerator LoadLevel(string level)
  {
    // ISSUE: object of a compiler-generated type is created
    return (IEnumerator) new GalaxyGUIHandlers.\u003CLoadLevel\u003Ec__Iterator6()
    {
      level = level,
      \u003C\u0024\u003Elevel = level
    };
  }
And if I try to remove those \u and 2 hexidecimal bytes representing unicode, say LoadLevel__Iterator6() doesn't exist in that class. Not to mention level = level makes no sense.
If I solve to unicode into it's ASCII character(the first byte is 00, so it is compatible) I get this:
Code
[DebuggerHidden]
  private IEnumerator LoadLevel(string level)
  {
    // ISSUE: object of a compiler-generated type is created
    return (IEnumerator) new GalaxyGUIHandlers.<LoadLevel>c__Iterator6()
    {
      level = level,
      <$>level = level
    };
  }

Which gives me further errors. Can any C# gurus suggest what is wrong, should I find a better decompiler, or am I just doing something stupid?
You're trying to decompile an obfuscated assembly and you don't even realize it.. The reason is very self explanatory.
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer]
Well, I don't exactly know much C#, how would I got about fixing it? Surely if the code can be run, then it can be reversed.
De4dot might be able to help you:
https://bitbucket.org/0xd4d/de4dot/
Anything with special characters in like that have compiler generated code in. That's the underlying CIL code being incorrectly decompiled. Either your decompiler is crap or it's obfuscated in which case you'll have to use another 3rd party tool to deobfuscate it or something.
ヽ༼ຈل͜ຈ༽ノ
You're a java programmer, there are java obfuscators as well, but anyway. Check what obfuscator was used, if it's confuser (doesn't look like it at all, should have really messed it up unless it's on minimal settings or something) then de4dot will probably clean it up. if not, feel free to send me the assembly and i'll take a crack at it.
Well, someone else successfully decompiled the game before me, so I don't have much use for it. I use to play with .NET, and I did some more reading. So yeah, like Potassium said, it has IL crap in it. de4dot didn't do much to help, and I was able to fix all of the variable names(not methods). I think renaming simply does the trick(in most cases), but in the end wasn't worth my time.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by ZnvKDec 20, 2019 03:13 AM 1 177 Dec 20, 2019 03:13 AM
Last Post: MavenGradle
[Python] by CryptMar 14, 2018 03:37 PM 9 172 Mar 14, 2018 03:37 PM
Last Post: Crypt
[Python] by inv3ctusSep 17, 2017 02:37 AM 5 298 Sep 17, 2017 02:37 AM
Last Post: nOrr