# binary-win/simple-dropper architecture

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

- Interactive diagram: https://gitdiagram.com/binary-win/simple-dropper
- Repository: https://github.com/binary-win/simple-dropper

## Overview

##### Main Components
- Dropper Executable: At the core is the compiled binary (simp-drop.exe) built from simp-drop.cpp. This is the central component of your system.
- Resource Manager: Represent the resource files (Resource.aps, Resource.rc, Resource1.aps, and Resource1.rc) that contain your shellcode and backdoor payload.
- Callback Mechanism: Since the README mentions a callbacks technique to avoid CreateThread(), include a component illustrating the function-callback workflow that triggers payload execution.
- File System Interaction: Indicate the module or routine that writes the backdoor to the Startup folder for persistence.
- Network Module: Represent the network connection initiated by the shellcode, connecting to the remote IP address (192.168.196.136) on port 9002 for the reverse shell.

##### Relationships and Data Flow
- From the Resource Manager, branch into two distinct flows:
- The other flow leads to the File System, where the backdoor is written to the Startup folder.

##### Architectural Patterns and Technologies
- Modular design: even though this is a single executable, conceptually separate the components based on function (resource management, networking, file system I/O).
- Stress the use of callbacks as a design pattern for thread management and asynchronous execution.
- Mention that it’s a stand-alone dropper built in C++ with Windows API interactions (file operations, network connections).

##### Essential Architectural Elements
- Triggering the execution of embedded shellcode and the file drop operation.
- The avoidance of traditional multithreading using CreateThread(), which is replaced by a callback pattern.
- Even if the dropper is simple, break it into as many clearly defined logical steps or modules as possible, to underline what happens at runtime.

Happy diagramming!

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Main Components
    A["Dropper Executable (simp-drop.exe)"]:::executable
    
    %% Resource Manager Subgraph
    subgraph "Resource Manager"
        R1["Resource.rc"]:::resource
        R2["Resource.aps"]:::resource
        R3["Resource1.rc"]:::resource
        R4["Resource1.aps"]:::resource
    end

    B["Callback Mechanism"]:::callback

    %% Payload Components
    C["Shellcode Payload"]:::payload
    D["Backdoor Writer"]:::payload

    %% Downstream Modules
    E["Network Module (Reverse Shell)"]:::network
    F["File System Interaction (Startup Write)"]:::filesystem

    %% Data Flow
    A -->|"loadResource"| R1
    A -->|"loadResource"| R2
    A -->|"loadResource"| R3
    A -->|"loadResource"| R4
    A -->|"initCallback"| B

    %% Branch from Resource Manager: Shellcode & Backdoor flows
    R1 -->|"triggerShellcode"| C
    R2 -->|"triggerShellcode"| C
    R3 -->|"triggerBackdoor"| D
    R4 -->|"triggerBackdoor"| D

    %% Callback influences both payloads
    B -->|"hookShellcode"| C
    B -->|"hookBackdoor"| D

    %% Payload execution flow
    C -->|"executePayload"| E
    D -->|"writeFile"| F

    %% Click Events
    click A "https://github.com/binary-win/simple-dropper/blob/main/x64/Release/simp-drop.exe"
    click R1 "https://github.com/binary-win/simple-dropper/blob/main/simp-drop/Resource.rc"
    click R2 "https://github.com/binary-win/simple-dropper/blob/main/simp-drop/Resource.aps"
    click R3 "https://github.com/binary-win/simple-dropper/blob/main/simp-drop/Resource1.rc"
    click R4 "https://github.com/binary-win/simple-dropper/blob/main/simp-drop/Resource1.aps"
    click B "https://github.com/binary-win/simple-dropper/blob/main/simp-drop/simp-drop.cpp"
    click E "https://github.com/binary-win/simple-dropper/blob/main/simp-drop/simp-drop.cpp"
    click F "https://github.com/binary-win/simple-dropper/blob/main/simp-drop/simp-drop.cpp"

    %% Styles
    classDef executable fill:#AED6F1,stroke:#1F618D,stroke-width:2px;
    classDef resource fill:#CEF6F5,stroke:#16A085,stroke-width:2px;
    classDef callback fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef payload fill:#FAD7A0,stroke:#D68910,stroke-width:2px;
    classDef network fill:#D6EAF8,stroke:#2471A3,stroke-width:2px;
    classDef filesystem fill:#F5CBA7,stroke:#D35400,stroke-width:2px;
```
