# maldev-academy/dumpbrowsersecrets architecture

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

- Interactive diagram: https://gitdiagram.com/maldev-academy/dumpbrowsersecrets
- Repository: https://github.com/maldev-academy/dumpbrowsersecrets

## Overview

1. **Repository purpose**
   - This is a Windows C++ project for collecting browser-stored secrets and browsing data from Chromium-family browsers and Firefox.
   - The architecture is split between a main extractor executable and a small DLL used only for Chromium App-Bound key recovery.

2. **Top-level build and component boundary**
   - `DumpBrowserSecrets.sln` ties together three main code areas:
     - `DumpBrowserSecrets/` — the primary EXE
     - `DllExtractChromiumSecrets/` — injected DLL payload
     - `Common/` — shared helpers, data structures, hashing, obfuscation, and file/secret handling
   - `Fnv1aHasher/` is a separate Python helper project, likely used to generate or validate API hashes used by the native code.

3. **Main control plane: `DumpBrowserSecrets.exe`**
   - `Main.cpp` is the entry point and argument dispatcher.
   - The EXE decides which browser families to target, whether to spoof process creation, whether to encrypt output, and whether to run extraction or decryption mode.
   - It is the central coordinator that ties together process setup, key retrieval, file parsing, and output generation.

4. **Chromium App-Bound key retrieval path**
   - For Chrome, Edge, and Brave, the EXE creates a Chromium process and injects `DllExtractChromiumSecrets.dll`.
   - The DLL runs inside the browser context and extracts the App-Bound decryption material from browser-local state using `IElevator` COM-related logic.
   - The recovered key material is sent back to the EXE, which then performs the actual on-disk data extraction.

5. **Non-DLL Chromium path for DPAPI-based browsers**
   - Opera, Opera GX, and Vivaldi are handled directly by the EXE without DLL injection.
   - Their secrets are decrypted using browser-stored DPAPI-protected material rather than App-Bound keys.
   - This keeps the browser-specific decryption logic in the extractor, while the injected DLL remains Chromium-App-Bound specific.

6. **Firefox path**
   - Firefox is handled separately from Chromium-based browsers.
   - The EXE directly reads Firefox profile files such as `logins.json`, `cookies.sqlite`, `places.sqlite`, and related profile artifacts.
   - Firefox uses NSS/AES/3DES-based protection for login data, so its extraction and decryption logic is a distinct subsystem.

7. **On-disk data extraction layer**
   - The files `ExtractChromiumData.cpp`, `ExtractFireFoxData.cpp`, and `Utilities.cpp` implement the per-browser parsing and collection logic.
   - Input sources include SQLite databases and JSON files located under browser profile directories.
   - The repo supports multiple data categories: cookies, credentials, tokens, autofill, history, bookmarks, and payment data.

8. **SQLite and file-access strategy**
   - The project includes `SQLoot/` plus an embedded `sqlite-amalgamation-3510100/` directory, indicating custom database parsing support rather than relying purely on system SQLite.
   - The README notes handle duplication to bypass browser file locks, so the extractor can read live databases even when browsers are running.
   - This layer is responsible for traversing local browser artifacts and turning them into structured records.

9. **Output formatting and encrypted pack flow**
   - `FormatOutput.cpp` and `HandleEncryptedOutput.cpp` control how extracted records are serialized.
   - Output can be emitted as JSON or wrapped into an encrypted “pack” using a user-supplied signature.
   - The EXE also supports a decryption mode that reverses that pack format and restores JSON files.

10. **Stealth, process creation, and spoofing subsystem**
   - `ChromiumProcCreation.cpp`, `CsrssRegistration.cpp`, and related headers implement process-launch behavior with PPID/argument spoofing.
   - The README calls out `NtCreateUserProcess`-based creation and manual CSRSS registration, so process setup is treated as its own subsystem rather than a standard CreateProcess flow.
   - This layer exists to make the Chromium host process look more legitimate before DLL injection.

11. **Shared `Common/` library**
   - `Common.cpp`, `Common.h`, `Structures.h`, `ApiHashing.cpp`, `FetchSecretFiles.cpp`, and `Obfuscate.hpp` provide reusable primitives.
   - This area likely contains:
     - shared data models for extracted secrets
     - API hashing and lookup support
     - compile-time string obfuscation
     - file discovery helpers for browser profile artifacts
   - It is the main utility boundary used by both the EXE and the DLL.

12. **DLL payload boundary**
   - `DllMain.cpp` in `DllExtractChromiumSecrets/` keeps the injected component minimal.
   - Its only job is Chromium-side key recovery and returning that material to the host EXE.
   - All heavy parsing, decryption, and output generation stays outside the DLL in the main executable.

13. **Overall data flow**
   - Browser profile files on disk are the primary input.
   - For Chromium App-Bound browsers, the EXE first obtains a decryption key via the injected DLL.
   - The EXE then reads SQLite/JSON artifacts, decrypts protected fields, normalizes them into records, and optionally emits encrypted or decrypted output.

14. **Architectural summary**
   - The repo is organized around a clear separation between:
     - orchestration and output in the EXE
     - browser-context key recovery in the DLL
     - shared helpers in `Common/`
     - browser-specific extraction paths for Chromium-family and Firefox
   - That split is the key structural feature to capture in an architecture diagram.

Main entry points: [`DumpBrowserSecrets/Main.cpp`](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/Main.cpp) (Main), [`Common/Common.cpp`](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/Common/Common.cpp) (Common), [`DumpBrowserSecrets/Utilities.cpp`](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/Utilities.cpp) (Profile parse), [`DumpBrowserSecrets.sln`](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets.sln) (Solution)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_solution["Solution"]
  node_sln["Solution"]
end

subgraph group_extractor["Extractor EXE"]
  node_main["Main<br/>CLI entry<br/>[Main.cpp]"]
  node_proc["Proc setup<br/>spawn/spoof"]
  node_csrss["CSRSS reg<br/>process init"]
  node_inject["DLL inject<br/>injection"]
  node_chrome["Chromium path<br/>browser flow"]
  node_dpapi["DPAPI path<br/>browser flow"]
  node_firefox["Firefox path<br/>browser flow"]
  node_parse["Profile parse<br/>artifact parser<br/>[Utilities.cpp]"]
  node_output["Format output<br/>serialization<br/>[FormatOutput.cpp]"]
  node_encout["Encrypted pack<br/>packaging"]
end

subgraph group_shared["Shared Code"]
  node_data["Record model<br/>secret schema<br/>[Structures.h]"]
  node_common["Common<br/>shared helpers<br/>[Common.cpp]"]
  node_hash["API hash<br/>lookup support<br/>[ApiHashing.cpp]"]
  node_files["File finders<br/>artifact discovery"]
  node_obf["Obfuscation<br/>string hiding<br/>[Obfuscate.hpp]"]
end

subgraph group_payload["DLL Payload"]
  node_dllmain["DllMain<br/>DLL entry<br/>[DllMain.cpp]"]
end

subgraph group_helper["Hash Helper"]
  node_helperpy["FNV helper<br/>python tool<br/>[Fnv1aHasher.py]"]
end

node_sln -->|"builds"| node_main
node_sln -->|"builds"| node_dllmain
node_sln -->|"shares"| node_common
node_sln -->|"includes"| node_helperpy
node_main -->|"launches"| node_proc
node_main -->|"uses"| node_inject
node_main -->|"routes"| node_chrome
node_main -->|"routes"| node_dpapi
node_main -->|"routes"| node_firefox
node_proc -->|"registers"| node_csrss
node_inject -->|"loads"| node_dllmain
node_dllmain -->|"returns key"| node_chrome
node_chrome -->|"reads"| node_parse
node_dpapi -->|"reads"| node_parse
node_firefox -->|"reads"| node_parse
node_parse -->|"fills"| node_data
node_parse -->|"uses"| node_common
node_common -->|"contains"| node_hash
node_common -->|"contains"| node_files
node_common -->|"contains"| node_obf
node_output -->|"wraps"| node_encout
node_main -->|"emits"| node_output
node_main -->|"decrypts"| node_encout
node_hash -.->|"mirrors"| node_helperpy

click node_sln "https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets.sln"
click node_main "https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/Main.cpp"
click node_proc "https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/ChromiumProcCreation.cpp"
click node_csrss "https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/CsrssRegistration.cpp"
click node_inject "https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/InjectDllIntoChromium.cpp"
click node_chrome "https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/ExtractChromiumData.cpp"
click node_dpapi "https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/ExtractChromiumData.cpp"
click node_firefox "https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/ExtractFireFoxData.cpp"
click node_parse "https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/Utilities.cpp"
click node_output "https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/FormatOutput.cpp"
click node_encout "https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/HandleEncryptedOutput.cpp"
click node_data "https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/Common/Structures.h"
click node_common "https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/Common/Common.cpp"
click node_hash "https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/Common/ApiHashing.cpp"
click node_files "https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/Common/FetchSecretFiles.cpp"
click node_obf "https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/Common/Obfuscate.hpp"
click node_dllmain "https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DllExtractChromiumSecrets/DllMain.cpp"
click node_helperpy "https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/Fnv1aHasher/Fnv1aHasher.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sln toneBlue
class node_main,node_proc,node_csrss,node_inject,node_chrome,node_dpapi,node_firefox,node_parse,node_output,node_encout toneAmber
class node_data,node_common,node_hash,node_files,node_obf toneMint
class node_dllmain toneRose
class node_helperpy toneIndigo
```

## Components

### Solution

Top-level build that ties the native components together.

- [Solution](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets.sln): VS solution · Build entry that connects the main executable, DLL, shared code, and helper project. · `DumpBrowserSecrets.sln`

### Extractor EXE

Main executable that coordinates browser targeting, key recovery, parsing, and output.

- [Main](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/Main.cpp): CLI entry · Argument parsing and top-level mode dispatch for extraction, decryption, and browser selection. · `DumpBrowserSecrets/Main.cpp`
- [Proc setup](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/ChromiumProcCreation.cpp): spawn/spoof · Creates browser host processes with NtCreateUserProcess-style flow and spoofing support. · `DumpBrowserSecrets/ChromiumProcCreation.cpp`
- [CSRSS reg](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/CsrssRegistration.cpp): process init · Manual CSRSS registration and process-launch support used during spoofed Chromium startup. · `DumpBrowserSecrets/CsrssRegistration.cpp`
- [DLL inject](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/InjectDllIntoChromium.cpp): injection · Loads the Chromium-only DLL into a browser process to recover App-Bound key material. · `DumpBrowserSecrets/InjectDllIntoChromium.cpp`
- [Chromium path](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/ExtractChromiumData.cpp): browser flow · Coordinates Chrome, Edge, and Brave handling that depends on injected key recovery. · `DumpBrowserSecrets/ExtractChromiumData.cpp`
- [DPAPI path](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/ExtractChromiumData.cpp): browser flow · Direct extraction path for Opera, Opera GX, and Vivaldi using browser-stored protected material. · `DumpBrowserSecrets/ExtractChromiumData.cpp`
- [Firefox path](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/ExtractFireFoxData.cpp): browser flow · Separate Firefox profile parsing and decryption flow for NSS/AES/3DES-protected data. · `DumpBrowserSecrets/ExtractFireFoxData.cpp`
- [Profile parse](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/Utilities.cpp): artifact parser · Reads browser profile artifacts from SQLite and JSON sources and normalizes records. · `DumpBrowserSecrets/Utilities.cpp`
- [Format output](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/FormatOutput.cpp): serialization · Serializes extracted records to JSON or pack format. · `DumpBrowserSecrets/FormatOutput.cpp`
- [Encrypted pack](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DumpBrowserSecrets/HandleEncryptedOutput.cpp): packaging · Wraps output into an encrypted pack and supports reverse decryption back to JSON. · `DumpBrowserSecrets/HandleEncryptedOutput.cpp`

### Shared Code

Reusable helpers and data structures consumed by the EXE and DLL.

- [Record model](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/Common/Structures.h): secret schema · Shared record structures for cookies, credentials, tokens, autofill, history, bookmarks, and payment data. · `Common/Structures.h`
- [Common](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/Common/Common.cpp): shared helpers · Core shared helpers used across the EXE and DLL. · `Common/Common.cpp`
- [API hash](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/Common/ApiHashing.cpp): lookup support · API hashing and resolution helpers for obfuscated native lookup paths. · `Common/ApiHashing.cpp`
- [File finders](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/Common/FetchSecretFiles.cpp): artifact discovery · Locates browser profile files and other secret-bearing artifacts. · `Common/FetchSecretFiles.cpp`
- [Obfuscation](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/Common/Obfuscate.hpp): string hiding · Compile-time string obfuscation and related helpers. · `Common/Obfuscate.hpp`

### DLL Payload

Injected Chromium-side component for App-Bound key recovery.

- [DllMain](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/DllExtractChromiumSecrets/DllMain.cpp): DLL entry · Minimal injected entrypoint that stays focused on Chromium-side key recovery. · `DllExtractChromiumSecrets/DllMain.cpp`

### Hash Helper

Separate Python helper for FNV-1a hashing workflows.

- [FNV helper](https://github.com/maldev-academy/dumpbrowsersecrets/blob/main/Fnv1aHasher/Fnv1aHasher.py): python tool · Standalone Python project for generating or validating FNV-1a hashes. · `Fnv1aHasher/Fnv1aHasher.py`

## Connections

- Solution → Main: builds · Solution includes the primary extractor executable.
- Solution → DllMain: builds · Solution includes the Chromium key-recovery DLL.
- Solution → Common: shares · Solution wires in the shared native library code.
- Solution → FNV helper: includes · Solution tree also contains the Python hashing helper.
- Main → Proc setup: launches · Main dispatch can create and spoof a browser host process.
- Main → DLL inject: uses · Main coordinates DLL injection for Chromium App-Bound browsers.
- Main → Chromium path: routes · Main selects the Chromium App-Bound extraction flow.
- Main → DPAPI path: routes · Main selects the direct DPAPI-based Chromium-family flow.
- Main → Firefox path: routes · Main selects the Firefox-specific extraction flow.
- Proc setup → CSRSS reg: registers · Process setup uses manual CSRSS registration during spoofed startup.
- DLL inject → DllMain: loads · Injector loads the DLL into the Chromium host process.
- DllMain → Chromium path: returns key · Injected DLL recovers App-Bound material used by the Chromium path.
- Chromium path → Profile parse: reads · Chromium flow reads profile files and local state artifacts for parsing.
- DPAPI path → Profile parse: reads · Direct Chromium-family flow parses browser profile databases and files.
- Firefox path → Profile parse: reads · Firefox flow parses logins, cookies, and history artifacts.
- Profile parse → Record model: fills · Parsed artifacts are normalized into shared secret records.
- Profile parse → Common: uses · Parsing reuses shared file and utility helpers.
- Common → API hash: contains · Shared library includes API hashing support.
- Common → File finders: contains · Shared library includes file discovery helpers.
- Common → Obfuscation: contains · Shared library includes string obfuscation helpers.
- Format output → Encrypted pack: wraps · Serialization can be wrapped into encrypted pack handling.
- Main → Format output: emits · Main orchestrates final output generation.
- Main → Encrypted pack: decrypts · Main can invoke pack decryption mode to recover JSON output.
- API hash → FNV helper: mirrors · Python helper likely supports the same FNV-1a hashing workflow.
