Convert Figma logo to code with AI

obfuscar logoobfuscar

Open source obfuscation tool for .NET assemblies

2,739
430
2,739
40

Top Related Projects

1,284

ILMerge is a static linker for .NET Assemblies.

7,186

.NET deobfuscator and unpacker.

An open-source, free protector for .NET applications

4,457

Extensible tool for weaving .net assemblies

Quick Overview

Obfuscar is an open-source .NET obfuscator that operates on the Common Intermediate Language (CIL) level. It provides a way to make reverse engineering of .NET assemblies more difficult by renaming symbols and encrypting strings, helping to protect intellectual property in .NET applications.

Pros

  • Easy to use with a simple XML configuration file
  • Supports multiple .NET frameworks, including .NET Core and .NET Standard
  • Provides various obfuscation techniques, including name mangling and string encryption
  • Actively maintained with regular updates and community support

Cons

  • May break some applications if not configured correctly
  • Cannot provide complete protection against determined reverse engineers
  • Limited compared to some commercial obfuscation tools
  • Can increase the size of the output assembly

Code Examples

  1. Basic configuration example:
<?xml version='1.0'?>
<Obfuscator>
  <Var name="InPath" value=".\Input" />
  <Var name="OutPath" value=".\Output" />
  <Module file="$(InPath)\MyAssembly.dll" />
</Obfuscator>

This configuration specifies input and output paths and the assembly to obfuscate.

  1. Excluding a specific type from obfuscation:
<Obfuscator>
  <!-- ... other configuration ... -->
  <Module file="$(InPath)\MyAssembly.dll">
    <SkipType name="MyNamespace.MyPublicClass" />
  </Module>
</Obfuscator>

This example shows how to exclude a specific type from being obfuscated.

  1. Enabling string encryption:
<Obfuscator>
  <!-- ... other configuration ... -->
  <Module file="$(InPath)\MyAssembly.dll">
    <Option>EncryptStrings</Option>
  </Module>
</Obfuscator>

This configuration enables string encryption for the specified assembly.

Getting Started

  1. Install Obfuscar via NuGet:

    dotnet add package Obfuscar
    
  2. Create an XML configuration file (e.g., obfuscar.xml) with your desired settings.

  3. Run Obfuscar from the command line:

    Obfuscar.Console.exe obfuscar.xml
    
  4. Find your obfuscated assemblies in the output directory specified in the configuration file.

Competitor Comparisons

1,284

ILMerge is a static linker for .NET Assemblies.

Pros of ILMerge

  • Combines multiple .NET assemblies into a single assembly
  • Preserves strong naming and digital signatures
  • Supports merging assemblies targeting different .NET Framework versions

Cons of ILMerge

  • Does not provide code obfuscation
  • May encounter issues with complex dependencies or certain reflection scenarios
  • Limited support for newer .NET Core and .NET 5+ projects

Code Comparison

Obfuscar configuration example:

<Obfuscator>
  <Var name="InPath" value=".\Input" />
  <Var name="OutPath" value=".\Output" />
  <Module file="$(InPath)\MyAssembly.dll" />
</Obfuscator>

ILMerge usage example:

ILMerging.ILMerge merge = new ILMerging.ILMerge();
merge.SetInputAssemblies(new string[] { "MainAssembly.dll", "Dependency1.dll", "Dependency2.dll" });
merge.OutputFile = "MergedAssembly.dll";
merge.Merge();

While Obfuscar focuses on obfuscating .NET assemblies to protect intellectual property, ILMerge is primarily used for combining multiple assemblies into a single file. Obfuscar provides better protection against reverse engineering, while ILMerge simplifies deployment and reduces the number of files in a .NET application. The choice between the two depends on the specific requirements of the project, such as the need for code protection versus assembly consolidation.

7,186

.NET deobfuscator and unpacker.

Pros of de4dot

  • Specializes in deobfuscation, making it more effective for reverse engineering
  • Supports a wider range of obfuscators and protection techniques
  • Actively maintained with regular updates and community contributions

Cons of de4dot

  • Primarily focused on .NET assemblies, limiting its use for other platforms
  • May require more technical expertise to use effectively
  • Can potentially be detected by advanced anti-tampering mechanisms

Code Comparison

de4dot (deobfuscation):

var deobfuscator = new DeobfuscatorInfo();
var options = new DeobfuscatorOptions();
var module = ModuleDefMD.Load(inputFile);
deobfuscator.DeobfuscateBegin(module, options);

Obfuscar (obfuscation):

var obfuscator = Obfuscator.CreateFromXml(configFile);
var assembly = AssemblyDefinition.ReadAssembly(inputFile);
obfuscator.Obfuscate(assembly);
assembly.Write(outputFile);

Summary

de4dot is a powerful tool for deobfuscating .NET assemblies, offering support for various obfuscation techniques. It's particularly useful for reverse engineering and analysis. On the other hand, Obfuscar focuses on obfuscating .NET assemblies to protect intellectual property. While de4dot excels in deobfuscation, it may require more technical knowledge and is limited to .NET platforms. Obfuscar provides a simpler approach to code protection but may not be as comprehensive in its obfuscation techniques.

An open-source, free protector for .NET applications

Pros of ConfuserEx

  • More active development and recent updates
  • Supports a wider range of obfuscation techniques, including control flow obfuscation
  • Better integration with modern .NET frameworks

Cons of ConfuserEx

  • More complex configuration and setup process
  • May introduce runtime overhead due to advanced obfuscation techniques
  • Potentially higher risk of breaking functionality in complex applications

Code Comparison

ConfuserEx configuration (project file):

<project outputDir="." baseDir="." xmlns="http://confuser.codeplex.com">
  <module path="MyAssembly.dll">
    <rule pattern="true" inherit="false">
      <protection id="anti tamper" />
      <protection id="constants" />
    </rule>
  </module>
</project>

Obfuscar configuration:

<?xml version='1.0'?>
<Obfuscator>
  <Var name="InPath" value="." />
  <Var name="OutPath" value=".\Obfuscated" />
  <Module file="$(InPath)\MyAssembly.dll" />
</Obfuscator>

Both tools offer .NET assembly obfuscation, but ConfuserEx provides more advanced features and customization options, while Obfuscar focuses on simplicity and ease of use. ConfuserEx is better suited for complex projects requiring extensive protection, while Obfuscar may be preferable for simpler applications or those prioritizing minimal configuration.

4,457

Extensible tool for weaving .net assemblies

Pros of Fody

  • More versatile, offering a wide range of plugins for various IL weaving tasks
  • Actively maintained with frequent updates and a larger community
  • Supports both .NET Framework and .NET Core projects

Cons of Fody

  • Steeper learning curve due to its plugin-based architecture
  • May introduce more complexity to the build process
  • Potential for conflicts between plugins or with other build tools

Code Comparison

Fody (using the Virtuosity plugin):

[assembly: Fody.Virtuosity]

public class Example
{
    public void Method() { }
}

Obfuscar (configuration file):

<Obfuscator>
  <Var name="InPath" value=".\bin\Release" />
  <Var name="OutPath" value=".\obfuscated" />
  <Module file="$(InPath)\MyAssembly.dll" />
</Obfuscator>

Summary

Fody is a more comprehensive IL weaving solution with a plugin ecosystem, while Obfuscar focuses specifically on code obfuscation. Fody offers greater flexibility but may be more complex to set up and use. Obfuscar is simpler and more focused on its specific task. The choice between them depends on the project's needs and the developer's familiarity with IL weaving concepts.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Obfuscar, Minimalistic Obfuscation Tool for .NET Assemblies

  • Build status
  • NuGet Version (Global Tool)
  • NuGet Version

The project logo came from Legendora Icon by Teekatas Suwannakrua.

Maintained by LeXtudio Inc..

Description

Obfuscar is an open source .NET obfuscator released under MIT license. It provides basic obfuscation features that help secure secrets in a .NET assembly.

Obfuscar

Get Started

Documentation section contains most information you need, and also a detailed history of this project all through the years.

Issues

If you have a patch to contribute, a feature to request, or a bug to report, please post to the Issue Tracker.

Support Services

Please contact LeXtudio Inc. for support services.

Contribution

Pull requests are welcome, but make sure you sign the Contributor License Agreement.

Donation

If you want to donate to my efforts on this project, please use this link.