# catblackcrack/rabbit_modmailtm architecture

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

- Interactive diagram: https://gitdiagram.com/catblackcrack/rabbit_modmailtm
- Repository: https://github.com/catblackcrack/rabbit_modmailtm

## Overview

##### Project Type and Purpose
- This is a desktop automation tool (Windows, .NET WinForms) that automatically registers Facebook accounts on an LDPlayer Android emulator.
- Core use-case: batch-create Facebook profiles via emulator control (ADB), captcha solving, device fingerprinting, and remote web requests.

##### File Structure Analysis
- Top-level:
- ToolRegFB.sln / ToolRegFB.csproj: .NET solution and project.
- README.md: succinct description.
- Properties/, Resources/: .NET resource and assembly info.
- ToolRegFB/: C# source files (WinForms UI, logic classes).
- bin/Debug/net48/: compiled output, supporting files (APK, ADB, extension, data, logs, outputs).
- Source packages:
- UI forms (frmMain, frmViewLD, ns*/frm*.cs) for different features.
- Logic classes: AutoControl.cs (emulator & UI automation), CaptchaService.cs, Device.cs, RequestFacebook.cs, Common.cs.
- Namespaces ns0…ns10: modular features (Napxu, Shopee, phone verification, contact sync, etc.).
- Resources & Data:
- bin/Debug/net48/app/*.apk: emulator apps (Facebook, ADBKeyboard, device-ID changer).
- data/…: name lists for account generation.
- setting*.ini: configuration.
- output/ and log/: results and logs for each run.

##### Main Components
a. User Interface (WinForms)
b. Core Automation Module
- AutoControl
- Device (device fingerprinting)
- ADB wrapper (adb.exe)
c. Registration Engine
- RequestFacebook (HTTP interactions)
- CaptchaService (third-party captcha solving API)
d. Emulator Layer
- LDPlayer instance controlled via ADB
- APKs installed (facebook.apk, facebooklite.apk)
e. Data & Configuration
- Local data store (data/… text files)
- Settings (INI files)
- Output folder (account results)
f. External Services
- Captcha solving API
- Facebook servers (registration endpoints)

##### Component Interactions
- WinForms UI invokes the Registration Engine based on user input.
- Registration Engine calls AutoControl to push APKs and simulate touches via ADB.
- Device module changes emulator device ID between registrations.
- CaptchaService fetches and solves captchas via external API.
- RequestFacebook posts registration data to Facebook and handles HTTP responses.
- Results and logs are saved to file system (output/, log/).

##### Architectural Patterns and Technologies
- Modular namespaces (ns0…ns10) for feature isolation.
- Layered pattern: UI → Automation → Registration logic → External services.
- .NET Framework WinForms, ADB command-line integration, REST calls, file-based config.

##### Numbered Workflow for Full Process
1. User launches the WinForms application (frmMain).
2. Application loads settings (.ini) and data lists (data/US, VN, THAI).
3. User clicks “Start Registration,” specifying batch size.
4. For each account:
4.1. Device module issues ADB commands to change emulator device ID.
4.2. AutoControl pushes or launches facebook.apk via ADB.
4.3. RequestFacebook initiates registration HTTP session with Facebook servers.
4.4. CaptchaService downloads captcha image, sends to solving API, receives solution.
4.5. AutoControl inputs solved captcha and other registration fields via simulated touches/keyboard.
4.6. RequestFacebook confirms registration and checks for 2FA or checkpoint.
4.7. Results (success, errors) are logged to output/facebook/*.txt and to log/log.txt.
5. End loop. UI shows summary of registered accounts and any failures.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% UI Layer
    subgraph "UI Layer"
        UI_Main["frmMain"]:::ui
        UI_View["frmViewLD"]:::ui
        UI_ns0["frmNapxu"]:::ui
        UI_ns2["frmContainer"]:::ui
        UI_ns3["frmAutoFunction"]:::ui
        UI_ns4["frmVeriPhoneNoveri"]:::ui
        UI_ns5["frmAddMailReg"]:::ui
        UI_ns6["frmVeriMailNoveri"]:::ui
        UI_ns7["frmShopee"]:::ui
    end

    %% Core Automation Layer
    subgraph "Core Automation Module"
        AutoControl["AutoControl.cs"]:::core
        DeviceMgr["Device.cs"]:::core
        ADBExe["adb.exe"]:::core
    end

    %% Registration Engine Layer
    subgraph "Registration Engine"
        ReqFB["RequestFacebook.cs"]:::core
        ReqCommon["Request.cs"]:::core
        CaptchaSvc["CaptchaService.cs"]:::core
    end

    %% Emulator Layer
    subgraph "Emulator Layer"
        LDPlayer["LDPlayer Emulator"]:::emu
        APK1["facebook.apk"]:::emu
        APK2["facebooklite.apk"]:::emu
        APK3["ADBKeyboard.apk"]:::emu
        APK4["DeviceIdChangerPro.apk"]:::emu
        RegClone["RegCloneLD.exe"]:::emu
    end

    %% Data & Config
    subgraph "Data & Configuration"
        DataFolder["data/"]:::data
        Settings1["setting.ini"]:::data
        Settings2["settingEng.ini"]:::data
        Settings3["setting_danhba.ini"]:::data
        Settings4["setting_veriaccnoveri.ini"]:::data
        Settings5["setting_verimailaccnoveri.ini"]:::data
    end

    %% Logs & Output
    subgraph "Logs & Output"
        LogFile["log.txt"]:::data
        OutputFolder["output/facebook/"]:::data
    end

    %% External Services
    subgraph "External Services"
        CaptchaAPI["Captcha Solving API"]:::ext
        FacebookSrv["Facebook Servers"]:::ext
    end

    %% Workflow Arrows
    UI_Main -->|1 Launch Application| Settings1
    UI_Main -->|2 Load data lists| DataFolder
    UI_Main -->|3 Start Registration| AutoControl

    AutoControl -->|4.1 Change Device ID| DeviceMgr
    DeviceMgr -->|uses adb| ADBExe
    AutoControl -->|4.2 Push & Launch APK| LDPlayer
    LDPlayer --> APK1
    LDPlayer --> APK2
    LDPlayer --> APK3
    LDPlayer --> APK4
    LDPlayer --> RegClone

    AutoControl -->|4.5 Simulate Input| ADBExe

    ReqFB -->|4.3 HTTP Init| FacebookSrv
    CaptchaSvc -->|4.4 Solve Captcha| CaptchaAPI
    CaptchaSvc -->|returns solution| AutoControl

    AutoControl --> ReqFB
    AutoControl --> CaptchaSvc

    ReqFB -->|4.6 Registration Confirmation| FacebookSrv

    ReqFB -->|log results| OutputFolder
    ReqFB -->|log details| LogFile

    %% Click Events
    click UI_Main "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/ToolRegFB/frmMain.cs"
    click UI_View "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/ToolRegFB/frmViewLD.cs"
    click UI_ns0 "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/ToolRegFB/ns0/frmNapxu.cs"
    click UI_ns2 "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/ToolRegFB/ns2/frmContainer.cs"
    click UI_ns3 "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/ToolRegFB/ns3/frmAutoFunction.cs"
    click UI_ns4 "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/ToolRegFB/ns4/frmVeriPhoneNoveri.cs"
    click UI_ns5 "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/ToolRegFB/ns5/frmAddMailReg.cs"
    click UI_ns6 "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/ToolRegFB/ns6/frmVeriMailNoveri.cs"
    click UI_ns7 "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/ToolRegFB/ns7/frmShopee.cs"

    click AutoControl "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/ToolRegFB/AutoControl.cs"
    click DeviceMgr "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/ToolRegFB/Device.cs"
    click ADBExe "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/bin/Debug/net48/adb.exe"

    click ReqFB "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/ToolRegFB/RequestFacebook.cs"
    click ReqCommon "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/ToolRegFB/Request.cs"
    click CaptchaSvc "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/ToolRegFB/CaptchaService.cs"

    click APK1 "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/bin/Debug/net48/app/facebook.apk"
    click APK2 "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/bin/Debug/net48/app/facebooklite.apk"
    click APK3 "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/bin/Debug/net48/app/ADBKeyboard.apk"
    click APK4 "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/bin/Debug/net48/app/DeviceIdChangerPro.apk"
    click RegClone "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/bin/Debug/net48/RegCloneLD.exe"

    click DataFolder "https://github.com/catblackcrack/rabbit_modmailtm/tree/main/bin/Debug/net48/data/"
    click Settings1 "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/bin/Debug/net48/setting.ini"
    click Settings2 "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/bin/Debug/net48/settingEng.ini"
    click Settings3 "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/bin/Debug/net48/setting_danhba.ini"
    click Settings4 "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/bin/Debug/net48/setting_veriaccnoveri.ini"
    click Settings5 "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/bin/Debug/net48/setting_verimailaccnoveri.ini"

    click LogFile "https://github.com/catblackcrack/rabbit_modmailtm/blob/main/bin/Debug/net48/log/log.txt"
    click OutputFolder "https://github.com/catblackcrack/rabbit_modmailtm/tree/main/bin/Debug/net48/output/facebook/"

    %% Styles
    classDef ui fill:#D0E8FF,stroke:#005A9E,color:#005A9E
    classDef core fill:#DFF5E1,stroke:#2E7D32,color:#2E7D32
    classDef emu fill:#FFE8CC,stroke:#EF6C00,color:#EF6C00
    classDef data fill:#FFF4E5,stroke:#BF360C,color:#BF360C
    classDef ext fill:#E8D0FF,stroke:#6A1B9A,color:#6A1B9A
```
