is it possible to get the C# class original name to improve the code readablity from obfuscated exe [closed]

StackOverflow https://stackoverflow.com/questions/18020809

  •  21-06-2022
  •  | 
  •  

Question

I have a windows exe program, I know it was written using C#, when I decrypt the dll(exe) using ILSpy 7.6, the class code look like this:

namespace eGTt4d2HADJI3qZvyr
{

 internal class epOl6XynGueNUNwY5Y
  {
    internal static ModuleHandle e1gr6SXh7;
    internal static RuntimeTypeHandle e53w34m968awCm9P85taUZe(int token)
    {
        return epOl6XynGueNUNwY5Y.e1gr6SXh7.GetRuntimeTypeHandleFromMetadataToken(token);
    }
    internal static RuntimeFieldHandle q3oMVe54wE47w4v68C7s2I(int token)
    {
        return epOl6XynGueNUNwY5Y.e1gr6SXh7.GetRuntimeFieldHandleFromMetadataToken(token);
    }
    public epOl6XynGueNUNwY5Y()
    {
        <PrivateImplementationDetails>{75896B12-4F98-4FD3-B464-42D866146FAE}.SLV0fFIsptsZtjvFft17();
        base..ctor();
    }
    static epOl6XynGueNUNwY5Y()
    {
        // Note: this type is marked as 'beforefieldinit'.
        <PrivateImplementationDetails>{75896B12-4F98-4FD3-B464-42D866146FAE}.SLV0fFIsptsZtjvFft17();
        epOl6XynGueNUNwY5Y.e1gr6SXh7 = typeof(epOl6XynGueNUNwY5Y).Assembly.GetModules()[0].ModuleHandle;
    }
  }
}

I was wonder that is it possilbe to refactor the real name of the code. Because the name of code almost unreadable, no one could understand the meaning from the meanless code name.How can I get the original name? Is it possible to get the real name or improve the readable of the code?

Was it helpful?

Solution

This is obfuscated code. The only way you will be able to get the original class names is if you have the code before obfuscation. Unless the writer of the code left some holes in it, the only option is to go through the code and spend a lot of time refactoring the code to get rid of the obscurity and try and make some sense out of it, but it would probably be quicker to write your own application that does the same thing.

As an additional note, since the code is obfuscated, the code has the real class names. Even if you were to call a method that returned the class name, this is exactly what you should expect to get.

OTHER TIPS

You have most probably decompiled an obfuscated exe. The main reason of obfuscation is to protect the code. So, you won't be able to get the original class names unless you know how the code is obfuscated (pattern/algorithm) etc. You can read more about it here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top