# lamachin3/droppy architecture

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

- Interactive diagram: https://gitdiagram.com/lamachin3/droppy
- Repository: https://github.com/lamachin3/droppy

## Overview

##### Project type and purpose
- This is a full-stack, web-based “dropper builder” tool. The user interacts with a browser UI (frontend) served by a Flask backend. The backend interprets user selections (injection, payload loading, encryption, etc.), invokes build logic, and compiles a customized C dropper (dropper_core) for download.

##### File structure
- Top level:
- backend/ – Python Flask API, build scripts, static assets, Jinja2 templates
- dropper_core/ – C source tree, modules folder, Makefile & Visual Studio project
- setup.ps1, setup.sh – environment/bootstrap scripts
- backend/ sub-structure:
- app.py, routes.py – entrypoint, HTTP route definitions
- dropper_builder/ – builder.py orchestrates module selection → C code generation; module_info_parser.py reads module metadata; shellcode_generator.py embeds payloads
- static/ + templates/ – CSS/JS assets + HTML views
- config.py, utils.py – global configs, helper functions
- dropper_core/ sub-structure:
- modules/ – plugin-style folders (anti_analysis, encryption, injection, etc.) each providing .c/.h
- common headers, syscalls/, utils/, Makefile, VS projects

##### README for additional insights
- Confirms features (injection, payload loading, encryption, stealth).
- Describes simple setup and run instructions.
- Highlights separation: “backend/” = API & build scripts; “dropper_core/” = C source.

a. Main components
1. Client Browser (UI)
2. Flask Web Server (app.py, routes.py)
3. Builder Service (dropper_builder package)
4. Dropper Core Codebase (dropper_core/)
5. Compiler Toolchain (Make/gcc or MSVC)
6. Download/Storage (artifact endpoint)
b. Relationships & interactions
- Browser → HTTP request (module selections) → Flask routes
- Flask routes → invokes Builder Service
- Builder Service → reads module metadata, writes temp C files/configs
- Builder Service → calls Compiler Toolchain on dropper_core + generated code
- Compiler → outputs binary (.exe)
- Flask → serves compiled binary back to Browser
c. Architectural patterns
- MVC-ish: templates (views), routes (controllers), builder & utils (model/services)
- Plugin architecture in dropper_core: each module is a self-contained plugin directory
- Separation of concerns: web API vs build logic vs C code
d. Key technologies & frameworks
- Python 3, Flask, Jinja2, JavaScript/CSS (frontend)
- dropper_builder (custom Python package)
- C, Makefile / Visual Studio projects for compilation

##### Detailed elements
- The dropper_builder package internals (module parser, shellcode generator)
- The dropper_core/modules collection as an expandable module set
- The Makefile / VS project as part of the compiler block
- External link to HWSyscalls under stealth techniques as an optional external dependency

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Frontend Layer
    subgraph "Frontend (Client UI)"
        BROWSER["Web Browser"]:::frontend
        subgraph "Static Assets"
            CSS["custom.css"]:::frontend
            JS["event-handlers.js"]:::frontend
        end
        subgraph "Templates"
            INDEX["index.html"]:::frontend
            DROP_CONF["dropper_config.html"]:::frontend
        end
    end

    %% Backend/API Layer
    subgraph "Backend (Flask API)"
        FLASK_APP["app.py"]:::backend
        ROUTES["routes.py"]:::backend
        CONFIG["config.py"]:::backend
        UTILS["utils.py"]:::backend
        REQ["requirements.txt"]:::backend
    end

    %% Build Pipeline Layer
    subgraph "Builder Service (dropper_builder)"
        BUILDER["builder.py"]:::build
        PARSER["module_info_parser.py"]:::build
        SHELLGEN["shellcode_generator.py"]:::build
        INIT["__init__.py"]:::build
    end

    %% Dropper Core Layer
    subgraph "Dropper Core (C Codebase)"
        CORE_C["dropper.c"]:::cmodule
        COMMON_H["common.h"]:::cmodule
        STRUCT_H["structs.h"]:::cmodule
        TYPEDEF_H["typedef.h"]:::cmodule
        subgraph "Modules"
            AA["anti_analysis"]:::cmodule
            ENC["encryption"]:::cmodule
            INJ["injection"]:::cmodule
            PL["payload_loading"]:::cmodule
            ST["stealth_techniques"]:::cmodule
            UNH["unhooking"]:::cmodule
            ENT["entropy"]:::cmodule
            OBF["obfuscation"]:::cmodule
        end
    end

    %% Compiler Toolchain Layer
    subgraph "Compiler Toolchain"
        MAKE["Makefile"]:::build
        SLN["dropper_core.sln"]:::build
        VCX["dropper_core.vcxproj"]:::build
        VCX_F["dropper_core.vcxproj.filters"]:::build
        VCX_U["dropper_core.vcxproj.user"]:::build
    end

    %% Artifact Storage
    ARTIFACT["Binary Artifact"]:::storage

    %% Connections
    BROWSER -->|"HTTP POST /build"| ROUTES
    ROUTES -->|"invokes builder"| BUILDER
    BUILDER --> PARSER
    BUILDER --> SHELLGEN
    BUILDER -->|"generates C code in"| CORE_C
    CORE_C --> AA
    CORE_C --> ENC
    CORE_C --> INJ
    CORE_C --> PL
    CORE_C --> ST
    CORE_C --> UNH
    CORE_C --> ENT
    CORE_C --> OBF
    BUILDER --> MAKE
    MAKE --> SLN
    MAKE --> VCX
    MAKE --> VCX_F
    MAKE --> VCX_U
    MAKE --> ARTIFACT
    ARTIFACT -->|"file download"| BROWSER

    %% Click Events
    click CSS "https://github.com/lamachin3/droppy/blob/main/backend/static/css/custom.css"
    click JS "https://github.com/lamachin3/droppy/blob/main/backend/static/js/event-handlers.js"
    click INDEX "https://github.com/lamachin3/droppy/blob/main/backend/templates/index.html"
    click DROP_CONF "https://github.com/lamachin3/droppy/blob/main/backend/templates/dropper_config.html"
    click FLASK_APP "https://github.com/lamachin3/droppy/blob/main/backend/app.py"
    click ROUTES "https://github.com/lamachin3/droppy/blob/main/backend/routes.py"
    click CONFIG "https://github.com/lamachin3/droppy/blob/main/backend/config.py"
    click UTILS "https://github.com/lamachin3/droppy/blob/main/backend/utils.py"
    click REQ "https://github.com/lamachin3/droppy/blob/main/backend/requirements.txt"
    click BUILDER "https://github.com/lamachin3/droppy/blob/main/backend/dropper_builder/builder.py"
    click PARSER "https://github.com/lamachin3/droppy/blob/main/backend/dropper_builder/module_info_parser.py"
    click SHELLGEN "https://github.com/lamachin3/droppy/blob/main/backend/dropper_builder/shellcode_generator.py"
    click INIT "https://github.com/lamachin3/droppy/blob/main/backend/dropper_builder/__init__.py"
    click CORE_C "https://github.com/lamachin3/droppy/blob/main/dropper_core/dropper.c"
    click COMMON_H "https://github.com/lamachin3/droppy/blob/main/dropper_core/common.h"
    click STRUCT_H "https://github.com/lamachin3/droppy/blob/main/dropper_core/structs.h"
    click TYPEDEF_H "https://github.com/lamachin3/droppy/blob/main/dropper_core/typedef.h"
    click AA "https://github.com/lamachin3/droppy/tree/main/dropper_core/modules/anti_analysis"
    click ENC "https://github.com/lamachin3/droppy/tree/main/dropper_core/modules/encryption"
    click INJ "https://github.com/lamachin3/droppy/tree/main/dropper_core/modules/injection"
    click PL "https://github.com/lamachin3/droppy/tree/main/dropper_core/modules/payload_loading"
    click ST "https://github.com/lamachin3/droppy/tree/main/dropper_core/modules/stealth_techniques"
    click UNH "https://github.com/lamachin3/droppy/tree/main/dropper_core/modules/unhooking"
    click ENT "https://github.com/lamachin3/droppy/tree/main/dropper_core/modules/entropy"
    click OBF "https://github.com/lamachin3/droppy/tree/main/dropper_core/modules/obfuscation"
    click MAKE "https://github.com/lamachin3/droppy/tree/main/dropper_core/Makefile"
    click SLN "https://github.com/lamachin3/droppy/blob/main/dropper_core/dropper_core.sln"
    click VCX "https://github.com/lamachin3/droppy/blob/main/dropper_core/dropper_core.vcxproj"
    click VCX_F "https://github.com/lamachin3/droppy/blob/main/dropper_core/dropper_core.vcxproj.filters"
    click VCX_U "https://github.com/lamachin3/droppy/blob/main/dropper_core/dropper_core.vcxproj.user"

    %% Styles
    classDef frontend fill:#CCE5FF,stroke:#333,stroke-width:1px
    classDef backend fill:#CCFFCC,stroke:#333,stroke-width:1px
    classDef build fill:#FFECB3,stroke:#333,stroke-width:1px
    classDef cmodule fill:#E0E0E0,stroke:#333,stroke-width:1px
    classDef storage fill:#FFD0D0,stroke:#900,stroke-width:1px,shape:cylinder
```
