Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Decompiling .net assembly with dotPeek gives invalid syntax

I have a problem with decompiling .net assembly. When I open the assembly in dotPeek there is class called frmMain with few hundred variables declared like this:

[SpecialName]
private static int \u0024STATIC\u0024SortByLengthAsc\u002402811241124\u0024xlen;

When i try to export it to project all those lines give errors (STATIC is not defined) even if I change all the \u0024 to $. Am I doing something wrong?

like image 256
Jan Polak Avatar asked Oct 17 '22 23:10

Jan Polak


1 Answers

No, the assembly has been obfuscated to prevent people (like you) to take a peek in the code and possibly 'steal' it. Those variable names are allowed in IL, but not in actual C# code, so that is why it fails.

The only remedy I know is a reverse-obfuscation tool that knows how the obfuscator obfuscates and tries to turn that around. Or you can do it by hand, which will take a lot of time usually, which proves obfuscation pays off.

like image 188
Patrick Hofman Avatar answered Oct 20 '22 23:10

Patrick Hofman