A small C# source-string encoder for .NET Framework projects. It writes a new .obf.cs file and leaves the input unchanged.
(It was created for a proprietary project called Simorgh, a clone of Logicube Falcon device.)
It rewrites eligible string literals in .cs source files. .dll and .exe files are copied unchanged; they are not currently obfuscated.
- Rewrites eligible C# string literals as fully qualified
System.String.Intern(new System.String(new char[] { ... }))expressions. - Uses the Roslyn C# syntax parser, so comments and character literals are not mistaken for strings, and C# escape sequences are interpreted before transformation.
- Preserves compile-time constant contexts, expression-tree structure, string interning, and source-file encoding.
- Copies
.dlland.exeinputs unchanged. Assembly metadata rewriting and dead-code injection are disabled because the implementation cannot safely preserve reflection, references, or virtual/interface contracts.
This transformation is reversible and is not encryption. Interpolated-string text and compile-time constant strings (for example const values, attributes, and optional parameter defaults) are left unchanged to keep generated source valid. Ordinary string literals inside interpolation expressions are still processed. This tool does not add anti-debugging code to output applications.
- .NET Framework 4.8 Runtime and Developer Pack.
- NuGet for restoring the Roslyn and MSTest dependencies.
- Visual Studio 2022 Build Tools or Visual Studio with MSBuild and VSTest for building and testing.
Run the tool via command line:
SimpleDotNetObfuscator.exe <input_file1> [<input_file2>] ...Example:
SimpleDotNetObfuscator.exe MyApp.dll MyApp.exe MySource.cs.csfiles are saved as.obf.cs.- Assembly inputs are copied unchanged with
.obf.dllor.obf.exesuffixes.
Run these commands from the repository root in a Visual Studio Developer PowerShell:
nuget restore SimpleDotNetObfuscator.sln -NonInteractive
msbuild SimpleDotNetObfuscator.sln /m /p:Configuration=Release
vstest.console.exe .\SimpleDotNetObfuscator.Tests\Artifacts\bin\Release\SimpleDotNetObfuscator.Tests.dllAppVeyor performs the same restore/build sequence and explicitly runs the Release test assembly.
- Base64 is not used as a security boundary; this tool only changes the representation of eligible source literals.
- Assemblies are copied byte-for-byte and are not protected against reverse engineering.
- The tool does not provide code virtualization or anti-debugging.
This project is licensed under GPL-3.0. See LICENSE.
For questions or feedback, use the GitHub issues.