1

As we know there are multiple ways to decompile Unity3d DLL files to reverse engineering the C# source code via ( dotpeek, ILSpy and Reflector )

Example: [Target File] Unity3D_Game_RootPath/Managed/Assembly-CSharp.dll

  1. Assembly-CSharp.dll => (one of the above tools) => Export/Save to .sln
  2. C# project file extention .sln => open in visualStudio
  3. Switch to "Solution Explorer" to check and add all necessary References (libraries to be included, like System, UnityEngine.dll, UnityEngineUI.dll, etc....)
  4. Passing Step 3 will remove most of the reference Errors (red hightlights in IDE)

However, usually the decompiled source code still contains a lot of error patterns below:

Example: iTween.<>f__switch$mapA == null

error type I : the name 'xxx' does not exit (CS1513)

error type II : Unexpected character '$'

would like to know what is the cause of the above general errors through the decompile process mentioned above and what would be a general way to remove them.

The Final Goal of the above process is try removing recompile errors and successfully recompile the source code generated from C# decompile Tools ( dotpeek, ILSpy and Reflector ) into runable dll to replace the old one.

infiniteloop
  • 885
  • 2
  • 12
  • 29
  • Its very rare for a DLL to be able to be decompiled and recompiled without additional hand-coding. What you are seeing above is an example of compiler generated code, and since it really is code, its difficult to get back to exactly the original source. This becomes a lot more difficult with async/await and tasks. So the short answer is, you have to hand-code around those errors. – Ron Beyer Oct 26 '15 at 14:17
  • Thanks Ron, I find a very useful post which is highly related to this question in revese-engineering stackexchange,so I just share it here http://reverseengineering.stackexchange.com/questions/9178/modify-code-with-ilspy/, It might be helpful to others as well. – infiniteloop Oct 26 '15 at 15:01

0 Answers0