# maverickchiu/h5obfuscator architecture

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

- Interactive diagram: https://gitdiagram.com/maverickchiu/h5obfuscator
- Repository: https://github.com/maverickchiu/h5obfuscator

## Overview

##### Project type and purpose
- This is a command‐line Node.js tool (“H5 Obfuscator”) for bulk-obfuscating JavaScript files. It preserves directory structure, offers configurable obfuscation strategies, and integrates easily into CI/CD (e.g., GitHub Actions).

##### File structure
- Top‐level files:
- README.md – project overview and usage
- package.json – Node dependencies and scripts
- obfuscator.bat – Windows wrapper for easy invocation
- src/
- index.js – CLI entry point (argument parsing, orchestration)
- obfuscator.js – core obfuscation engine (implements transformations)

##### README for additional insights
- Confirms the CLI parameters (–source, –output, –config)
- Lists built-in obfuscation techniques (control-flow flattening, dead-code injection, etc.)
- Mentions GitHub Actions support (implies a step in CI pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "CLI Layer"
        CLI_BAT["obfuscator.bat"]:::cli
        CLI_JS["src/index.js"]:::cli
    end

    subgraph "Configuration Manager"
        CONFIG["Config Manager"]:::config
    end

    subgraph "Core Engine"
        ENGINE["Obfuscation Engine"]:::engine
    end

    subgraph "File System I/O"
        FS_READ["Source Reader"]:::io
        FS_WRITE["Output Writer"]:::io
    end

    GHA["GitHub Actions"]:::external

    CLI_BAT -->|"invokes CLI"| CLI_JS
    CLI_JS -->|"parses CLI Args"| CONFIG
    CONFIG -->|"supplies Config Object"| ENGINE
    ENGINE -->|"streams File Paths"| FS_READ
    FS_READ -->|"code files"| ENGINE
    ENGINE -->|"obfuscated code"| FS_WRITE
    GHA -->|"runs CLI"| CLI_BAT

    click CLI_BAT "https://github.com/maverickchiu/h5obfuscator/blob/main/obfuscator.bat"
    click CLI_JS "https://github.com/maverickchiu/h5obfuscator/blob/main/src/index.js"
    click ENGINE "https://github.com/maverickchiu/h5obfuscator/blob/main/src/obfuscator.js"
    click FS_READ "https://github.com/maverickchiu/h5obfuscator/blob/main/src/obfuscator.js"
    click FS_WRITE "https://github.com/maverickchiu/h5obfuscator/blob/main/src/obfuscator.js"

    classDef cli fill:#f9f,stroke:#333,stroke-width:1px
    classDef config fill:#bbf,stroke:#333,stroke-width:1px
    classDef engine fill:#bfb,stroke:#333,stroke-width:1px
    classDef io fill:#ffb,stroke:#333,stroke-width:1px
    classDef external fill:#fbb,stroke:#333,stroke-width:1px
```
