-
Notifications
You must be signed in to change notification settings - Fork 21
Skater .NET Obfuscator is the powerful tool to protect .NET Core 3.x (3.0 and later) projects
Starting from version 3.0 the .NET Core SDK includes support for Windows Forms desktop applications and now .NET Core received more updates compared to full .NET Framework.
There is Windows Forms .NET Core UI framework for building Windows desktop applications in the .NET Core 3.0 presented. WinForms is a User Interface framework for developing Windows desktop applications. It is a .NET wrapper over Windows UI DLLs, such as User32, GDI+, and so on. It also includes visual controls and other similar functions that are unique to Windows Forms desktop applications.
To test how Skater obfuscator helps to protect .NET Core WinForms app, first we need to create new .NET Core Windows Forms desktop application.
To test how Skater Obfuscator protects WinForms .NET Core assemblies open Visual Studio 2019 (or later) and create new Windows Forms .NET Core project.
Let’s name the project as WindowsFormsNETCore3. We are pretty fed up by the names like ‘HelloWorld!’ and so on. You can get the attached project’s source code. To further test Skater obfuscator functionality, we have added some dummy classes, methods, and properties into the Form1.cs.
Just to remind you: the main .NET Core idea is to compile a Windows Forms app and then run it under any system. Not Windows only.

Skater supports .NET Core 3.0 projects where the publish output is a DLL file (Framework-dependent deployment). When the publish output is an EXE file that calls .NET Core DLL (Self-contained deployment) the final DLL has to be obfuscated as well. There are two types of .NET Core apps can be built:



Let’s take a look at what the final binaries were compiled in the output folder of the WindowsFormsNETCore3 project.
You can see two main assemblies presented inside the output folder:
WindowsFormsNETCore3.exe
WindowsFormsNETCore3.dll
This pair of files represents the .NET Core Self-Contained Deployment (SCD) concept.
The final output for that Windows Forms app includes the WindowsFormsNETCore3.exe executable, which is a renamed version of the platform-specific .NET Core host, and the WindowsFormsNETCore3.dll library file, which is the actual application. Roughly saying, the WindowsFormsNETCore3.exe executable is the app’s starter with necessary predefined .NET Core utilities compiled inside the exe. Ideally the exe file is cross-platform executable. The executable is binary file compiled in machine codes. This file is undecompilable and do not need to be obfuscated.
So let’s concentrate on WindowsFormsNETCore3.dll assembly protection.
Take a look what we got after the WindowsFormsNETCore3.dll .NET Core app decompilation:
We can see the non-protected "Hello .NET Core 3.0!" string in the decompiler's interface. Decompilation tools can decompile a .NET assembly directly back to a high-level language like C#, VB .NET, or C++. We are ready now to obfuscate the sample WindowsFormsNETCore3.dll .NET Core app by using Skater .NET Obfuscator. In Skater .NET Obfuscator open WindowsFormsNETCore3 app.
Skater immediately identifies the WindowsFormsNETCore3.dll is .NET Core assembly:
Now you can adjust WindowsFormsNETCore3.dll app obfuscation settings and run its protection process. After all, you need to check what the output of the Skater obfuscation and how WindowsFormsNETCore3.dll app is protected. When you run the obfuscated app (run the WindowsFormsNETCore3.exe) it produces the same result. Take a look what changed inside the simple program. We need to run the decompiler again against the new obfuscated dll and it will give us the following decompilation result:
The "Hello .NET Core 3.0!" string has been allocated by Skater into a public variable then it was encrypted. We can pretty easily spot the encrypted string inside that decompiled script. Should this make it pretty obvious that our code is protected? Is it not simply too easy to decrypt the safe .NET Core source code? Almost. An absolute hacker still can choose a password for the encrypted string and decompile it.
Conclusion
No matter what we do, if our code is placed at the end-user's PC/Mac/Phone, it is not safe. As long as the code is placed at the end-user, all we can do is to make it as unwieldy as possible to get to the original source code, with any luck avoiding most hacker's deciphering attempts.






