# undebel/nofuserex architecture

> Architecture diagram of the GitHub repository undebel/nofuserex, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/undebel/nofuserex
- Repository: https://github.com/undebel/nofuserex

## Overview

##### Project Overview
- NoFuserEx is an open‐source deobfuscator designed specifically for handling files produced by ConfuserEx. The tool applies various deobfuscation strategies (such as anti-debugger, anti-dumper, anti-tamper, and several constant decryption mechanisms) to restore the original code logic.
- The README indicates a simple usage model (drag and drop onto the executable) which suggests that it’s a single-executable application with multiple internal modules for different deobfuscation tasks.
- The project is developed in C# (as indicated by solution and project files, e.g., NoFuserEx.sln, .csproj) and utilizes the dnlib library for assembly manipulation.

##### Key Components from the File Structure
- Main Application Entry Points:
- Program.cs: Acts as the main entry point.
- Options.cs: Likely manages command-line options or configuration setups.
- App.config: Contains configuration settings for the .NET application.
- Core Assembly Management:
- AssemblyManager.cs: Likely handles loading and managing the assemblies.
- MemberCloner.cs and associated utility classes could be responsible for element-level manipulation or restructuring during deobfuscation.
- Deobfuscation Engine:
- The Deobfuscator directory is the heart of the deobfuscation logic.
- DeobfuscatorManager.cs: Coordinates the overall deobfuscation process.
- IDeobfuscator.cs: Defines a common interface for all specific deobfuscation modules.
- Within Deobfuscators, you have multiple files dedicated to certain protection types:
- AntiDebuggerDeobfuscator.cs
- AntiDumperDeobfuscator.cs
- AntiTamperDeobfuscator.cs
- ProxyDeobfuscator.cs
- ResourcesDeobfuscator.cs
- The Constants subdirectory includes several decrypter classes for different types of constant data (e.g., StringDecrypter.cs, IntArrayDecrypter.cs, etc.), emphasizing the specialized handling of constant obfuscation.
- Utilities and Logging:
- Utils.cs: Provides shared utility functions.
- Logger.cs: Likely handles logging system events or errors.

##### Relationships and Interactions
- The application starts at Program.cs, which initializes required components (loading settings via Options.cs and App.config).
- The AssemblyManager is called to load and manage target assemblies.
- Once an assembly is loaded, the deobfuscation process is coordinated by the DeobfuscatorManager, which iterates over the list of protection types.
- For each protection type, DeobfuscatorManager instantiates and calls specific deobfuscation modules (like AntiDebuggerDeobfuscator, CompressorDeobfuscator, etc.).
- Modules under the Constants folder interact with the main deobfuscation flow to handle decryption of obfuscated constant values.
- Integration with external libraries such as dnlib is crucial for the manipulation of .NET assemblies.
- The Logger component and various Utils facilitate debug, error-checking, and helper operations across the system.

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["User (Drag&Drop NoFuserEx.exe)"]:::entry
    Program["Main Entry (Program.cs)"]:::entry
    Options["Configuration & Options (Options.cs, App.config)"]:::config
    AssemblyManager["Assembly Loader (AssemblyManager)"]:::core
    dnlb["dnlib (External Library)"]:::external

    subgraph "Main Application"
        Program
        Options
        AssemblyManager
    end

    DeobManager["Deobfuscator Coordinator (DeobfuscatorManager)"]:::core

    subgraph "Deobfuscation Engine"
        AD["Anti-Debugger Module"]:::deob
        Adup["Anti-Dumper Module"]:::deob
        AT["Anti-Tamper Module"]:::deob
        Comp["Compressor Module"]:::deob
        Proxy["Proxy Module"]:::deob
        Res["Resources Module"]:::deob
        subgraph "Constants Deobfuscators"
            DecrypterBase["Decryption Base (DecrypterBase)"]:::const
            StringD["String Decrypter"]:::const
            IntArr["Int Array Decrypter"]:::const
            ByteArr["Byte Array Decrypter"]:::const
            CharArr["Char Array Decrypter"]:::const
            DoubleArr["Double Array Decrypter"]:::const
            FloatArr["Float Array Decrypter"]:::const
            LongArr["Long Array Decrypter"]:::const
            SByteArr["SByte Array Decrypter"]:::const
            ShortArr["Short Array Decrypter"]:::const
            UIntArr["UInt Array Decrypter"]:::const
            ULongArr["ULong Array Decrypter"]:::const
            UShortArr["UShort Array Decrypter"]:::const
            ConstCoord["Constants Coordinator (ConstantsDeobfuscator)"]:::const
        end
    end

    MemberCloner["Member Cloner"]:::core

    subgraph "Utilities"
        UtilsDeob["Deobfuscator Utils"]:::utils
        UtilsGen["General Utils"]:::utils
        Logger["Logger"]:::utils
    end

    %% Connections
    User -->|"starts"| Program
    Program -->|"loads_config"| Options
    Program -->|"initiates_load"| AssemblyManager
    AssemblyManager -->|"leverages"| dnlb
    AssemblyManager -->|"passes_assembly"| DeobManager
    DeobManager -->|"calls"| AD
    DeobManager -->|"calls"| Adup
    DeobManager -->|"calls"| AT
    DeobManager -->|"calls"| Comp
    DeobManager -->|"calls"| Proxy
    DeobManager -->|"calls"| Res
    DeobManager -->|"coordinates_with"| ConstCoord
    DeobManager -->|"uses"| MemberCloner

    AD -->|"reports_to"| Logger
    Adup -->|"reports_to"| Logger
    AT -->|"reports_to"| Logger
    Comp -->|"reports_to"| Logger
    Proxy -->|"reports_to"| Logger
    Res -->|"reports_to"| Logger
    ConstCoord -->|"reports_to"| Logger

    AD -->|"utilizes"| UtilsDeob
    Adup -->|"utilizes"| UtilsDeob
    AT -->|"utilizes"| UtilsDeob
    Comp -->|"utilizes"| UtilsDeob
    Proxy -->|"utilizes"| UtilsDeob
    Res -->|"utilizes"| UtilsDeob
    ConstCoord -->|"utilizes"| UtilsDeob

    UtilsDeob ---|"helper_with"| UtilsGen

    %% Click Events
    click Program "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Program.cs"
    click Options "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Options.cs"
    click Options "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/App.config"
    click AssemblyManager "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/AssemblyManager.cs"
    click DeobManager "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/DeobfuscatorManager.cs"
    click AD "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/Deobfuscators/AntiDebuggerDeobfuscator.cs"
    click Adup "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/Deobfuscators/AntiDumperDeobfuscator.cs"
    click AT "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/Deobfuscators/AntiTamperDeobfuscator.cs"
    click Comp "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/Deobfuscators/CompressorDeobfuscator.cs"
    click Proxy "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/Deobfuscators/ProxyDeobfuscator.cs"
    click Res "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/Deobfuscators/ResourcesDeobfuscator.cs"
    click DecrypterBase "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/Deobfuscators/Constants/DecrypterBase.cs"
    click StringD "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/Deobfuscators/Constants/StringDecrypter.cs"
    click IntArr "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/Deobfuscators/Constants/IntArrayDecrypter.cs"
    click ByteArr "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/Deobfuscators/Constants/ByteArrayDecrypter.cs"
    click CharArr "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/Deobfuscators/Constants/CharArrayDecrypter.cs"
    click DoubleArr "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/Deobfuscators/Constants/DoubleArrayDecrypter.cs"
    click FloatArr "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/Deobfuscators/Constants/FloatArrayDecrypter.cs"
    click LongArr "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/Deobfuscators/Constants/LongArrayDecrypter.cs"
    click SByteArr "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/Deobfuscators/Constants/SByteArrayDecrypter.cs"
    click ShortArr "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/Deobfuscators/Constants/ShortArrayDecrypter.cs"
    click UIntArr "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/Deobfuscators/Constants/UIntArrayDecrypter.cs"
    click ULongArr "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/Deobfuscators/Constants/ULongArrayDecrypter.cs"
    click UShortArr "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/Deobfuscators/Constants/UShortArrayDecrypter.cs"
    click ConstCoord "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/Deobfuscators/Constants/ConstantsDeobfuscator.cs"
    click MemberCloner "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/MemberCloner.cs"
    click UtilsDeob "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Deobfuscator/Utils.cs"
    click UtilsGen "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Utils.cs"
    click Logger "https://github.com/undebel/nofuserex/blob/master/NoFuserEx/NoFuserEx/Logger.cs"

    %% Styles
    classDef entry fill:#ffcc00,stroke:#333,stroke-width:2px;
    classDef config fill:#ff9999,stroke:#333,stroke-width:2px;
    classDef core fill:#99ccff,stroke:#333,stroke-width:2px;
    classDef deob fill:#ccffcc,stroke:#333,stroke-width:2px;
    classDef const fill:#ddccff,stroke:#333,stroke-width:2px;
    classDef utils fill:#ffddb3,stroke:#333,stroke-width:2px;
    classDef external fill:#f2f2f2,stroke:#333,stroke-width:2px;
```
