# neweracracker/loic architecture

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

- Interactive diagram: https://gitdiagram.com/neweracracker/loic
- Repository: https://github.com/neweracracker/loic

## Overview

##### Project Components and Their Purposes
- Core Application: The main executable and logic are implemented in src/Program.cs and various Windows Forms (frmMain, frmEULA, frmEZGrab, frmWtf) that provide the UI.
- Flooding Engine: Several classes (e.g., HTTPFlooder.cs, XXPFlooder.cs, cHLDos.cs, and IFlooder.cs) form the engine responsible for generating network floods using different protocols.
- IRC Control Module (Hivemind Mode): This is a dedicated component located within the src/IRC directory. It includes:
- Client components (e.g., IrcClient.cs, Channel.cs, IrcUser.cs) for managing IRC connections.
- Command modules (src/IRC/Commands) that manage IRC command parsing and execution (like the “!lazor” commands).
- Connection handling components (src/IRC/Connection) including IRC connection establishment and event handling.
- Configuration and Settings: App configuration files (app.config, app.manifest, Settings.cs) that control runtime settings and application behaviors.
- Resources and Logging: Resources (in the Resources directory and Properties) and external libraries such as log4net for application logging (as seen in the packages folder).

##### Relationships and Interactions
a. UI Layer (Windows Forms):
- Initiates actions (e.g., starting/stopping a flood attack) and displays status.
- Interacts directly with the Flooding Engine to trigger different network attack methods.
- Provides an interface for the user to set parameters and commands.
b. Flooding Engine:
- Contains multiple flooder modules (HTTPFlooder, XXPFlooder, etc.) that execute network stress tests.
- Uses core logic (e.g., Functions.cs, Protocol.cs) and settings for configuring attack parameters.
- Communicates results and logs back to the UI or logging modules.
c. IRC Module (for Hivemind/Hidden Mode):
- Built for remote control via IRC. It includes subcomponents for connecting (IrcTcpClient.cs, IrcConnection.cs), client management (IrcClient, Channel management), and command parsing (IrcCommands, Rfc2812).
- Acts as a communication bridge for receiving remote commands, and passes these commands to trigger the appropriate functions in the Flooding Engine.
d. Logging & External Libraries:
- log4net and other package dependencies are incorporated throughout the layers for monitoring and error logging.
e. Configuration Settings:
- Centralized configurations (app.config, Settings.cs) are referenced by most components to ensure consistent behavior across different modules.

##### Architectural Patterns and Design Principles
- Layered/Modular Architecture: The application is divided into clear modules (UI, Flooding, IRC, Configurations) which communicate via defined interfaces.
- Separation of Concerns: Each module (UI vs. flooder vs. IRC) has its own responsibility, helping in maintainability and scalability.
- Event-Driven Interactions: The IRC module uses event handlers (see numerous EventArgs.cs and Delegates.cs files) to manage asynchronous communication and command dispatch.
- Use of External Libraries: Integration with log4net emphasizes a well-defined logging mechanism, further decoupling concerns from business logic.

##### Detail
- Be as detailed as beneficial; capture even the submodules of the IRC connectivity (client, connection, commands, event handling).
- Although the LOIC tool is monolithic, visually separating components by their responsibilities improves clarity for maintenance and enhancement purposes.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interface (UI) Layer
    subgraph "User Interface (UI) Layer"
        UI_Pr["Program (Core)"]:::ui
        frmMain["frmMain (Windows Form)"]:::ui
        frmEULA["frmEULA (Windows Form)"]:::ui
        frmEZGrab["frmEZGrab (Windows Form)"]:::ui
        frmWtf["frmWtf (Windows Form)"]:::ui
    end

    %% Flooding Engine
    subgraph "Flooding Engine"
        HTTPFlooder["HTTPFlooder"]:::engine
        XXPFlooder["XXPFlooder"]:::engine
        cHLDos["cHLDos"]:::engine
        IFlooder["IFlooder"]:::engine
        Functions["Functions"]:::engine
        Protocol["Protocol"]:::engine
    end

    %% IRC Control Module (Hivemind Mode)
    subgraph "IRC Control Module (Hivemind Mode)"
        IRC_Base["IRC Base"]:::irc
        IrcClient["IrcClient"]:::irc
        Channel["Channel"]:::irc
        IrcUser["IrcUser"]:::irc
        IrcCommands["IrcCommands"]:::irc
        Rfc2812["Rfc2812"]:::irc
        IrcConnection["IrcConnection"]:::irc
        IrcTcpClient["IrcTcpClient"]:::irc
    end

    %% Configuration & Logging
    subgraph "Configuration & Logging"
        AppConfig["app.config"]:::config
        AppManifest["app.manifest"]:::config
        Settings["Settings"]:::config
        Resources["Resources"]:::resource
        log4net["log4net"]:::log
    end

    %% Interactions between components
    frmMain -->|"start/stop_flood"| HTTPFlooder
    IrcCommands -->|"controlFlood"| HTTPFlooder
    IrcClient -->|"establish_conn"| IrcConnection
    frmMain -->|"loadConfig"| AppConfig
    HTTPFlooder -->|"log_events"| log4net
    Functions -->|"readSettings"| Settings

    %% Styles for distinct groups
    classDef ui fill:#f9e79f,stroke:#d35400,stroke-width:2px;
    classDef engine fill:#aed6f1,stroke:#2980b9,stroke-width:2px;
    classDef irc fill:#a9dfbf,stroke:#27ae60,stroke-width:2px;
    classDef config fill:#f5cba7,stroke:#e67e22,stroke-width:2px;
    classDef resource fill:#f7dc6f,stroke:#f1c40f,stroke-width:2px;
    classDef log fill:#d7bde2,stroke:#8e44ad,stroke-width:2px;

    %% Click Events for UI Layer
    click UI_Pr "https://github.com/neweracracker/loic/blob/master/src/Program.cs"
    click frmMain "https://github.com/neweracracker/loic/blob/master/src/frmMain.cs"
    click frmEULA "https://github.com/neweracracker/loic/blob/master/src/frmEULA.cs"
    click frmEZGrab "https://github.com/neweracracker/loic/blob/master/src/frmEZGrab.cs"
    click frmWtf "https://github.com/neweracracker/loic/blob/master/src/frmWtf.cs"

    %% Click Events for Flooding Engine
    click HTTPFlooder "https://github.com/neweracracker/loic/blob/master/src/HTTPFlooder.cs"
    click XXPFlooder "https://github.com/neweracracker/loic/blob/master/src/XXPFlooder.cs"
    click cHLDos "https://github.com/neweracracker/loic/blob/master/src/cHLDos.cs"
    click IFlooder "https://github.com/neweracracker/loic/blob/master/src/IFlooder.cs"
    click Functions "https://github.com/neweracracker/loic/blob/master/src/Functions.cs"
    click Protocol "https://github.com/neweracracker/loic/blob/master/src/Protocol.cs"

    %% Click Events for IRC Control Module
    click IRC_Base "https://github.com/neweracracker/loic/tree/master/src/IRC"
    click IrcClient "https://github.com/neweracracker/loic/blob/master/src/IRC/Client/IrcClient.cs"
    click Channel "https://github.com/neweracracker/loic/blob/master/src/IRC/Client/Channel.cs"
    click IrcUser "https://github.com/neweracracker/loic/blob/master/src/IRC/Client/IrcUser.cs"
    click IrcCommands "https://github.com/neweracracker/loic/blob/master/src/IRC/Commands/IrcCommands.cs"
    click Rfc2812 "https://github.com/neweracracker/loic/blob/master/src/IRC/Commands/Rfc2812.cs"
    click IrcConnection "https://github.com/neweracracker/loic/blob/master/src/IRC/Connection/IrcConnection.cs"
    click IrcTcpClient "https://github.com/neweracracker/loic/blob/master/src/IRC/Connection/IrcTcpClient.cs"

    %% Click Events for Configuration & Logging
    click AppConfig "https://github.com/neweracracker/loic/blob/master/src/app.config"
    click AppManifest "https://github.com/neweracracker/loic/blob/master/src/app.manifest"
    click Settings "https://github.com/neweracracker/loic/blob/master/src/Settings.cs"
    click Resources "https://github.com/neweracracker/loic/tree/master/src/Resources"
    click log4net "https://github.com/neweracracker/loic/blob/master/src/packages/log4net.2.0.5"
```
