# lyall/atelieryumiafix architecture

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

- Interactive diagram: https://gitdiagram.com/lyall/atelieryumiafix
- Repository: https://github.com/lyall/atelieryumiafix

## Overview

##### Project Type & High-Level Overview
- This is a single dynamic library (DLL) plugin meant to be loaded by a game through an ASI loader.
- It intercepts and hooks native game routines using the “safetyhook” mechanisms.
- It features configuration reading (via inipp) and logging (via spdlog) to enable configurable fixes and debugging.

##### Main Components
- Game Executable: Demarcate the original game process where the ASI plugin is injected.
- ASI Plugin (Dynamic Library): Represent the core plugin containing src/dllmain.cpp, helper.hpp, and stdafx.h, responsible for hooking and applying fixes.
- Hooking Mechanism: Highlight the safetyhook component (safetyhook.cpp/.hpp and associated external files) that intercepts game code execution.
- Configuration Module: Represent the configuration management using the AtelierYumiaFix.ini file and inipp library (external/inipp) for reading and applying user-defined settings.
- Logging Module: Denote the spdlog integration (external/spdlog) used for logging plugin activity.
- External Dependencies: Note that there are third-party libraries like safetyhook, inipp, and spdlog that integrate into the plugin. Although these libraries are “external,” they are critical for intercepting game functions, reading configurations, and logging runtime events.

##### Relationships & Interactions
- The plugin (DLL) is loaded into the game’s process space via an ASI loader.
- The configuration module (inipp) reads settings from AtelierYumiaFix.ini at startup, influencing how hooks or patches are activated.
- The logging module (using spdlog) logs events, errors, and debug information, showing a clear data flow between triggered hooks and logging outputs.
- Optional: You might include an “External Loader” component (as hinted in the Credits, referencing Ultimate ASI Loader) that handles the plugin injection process.

##### Architectural Patterns & Design Principles
- The design follows a plugin architecture with dependency injection – the game injects the DLL, which in turn calls external libraries to perform its tasks.
- The system also uses abstraction to wrap complex hooking operations and config processing.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Game Environment
    subgraph "Game Environment"
        Game("Game Executable"):::gameProcess
        Loader("ASI Loader"):::gameProcess
    end

    %% ASI Plugin Environment
    subgraph "ASI Plugin"
        CoreLogic("Core Logic (dllmain.cpp, helper.hpp, stdafx.h)"):::plugin
        Safetyhook("Hooking Module (safetyhook)"):::external
        ConfigModule("Configuration Module (inipp)"):::external
        Spdlog("Logging Module (spdlog)"):::external
    end

    %% Connections
    Game -->|"loads"| Loader
    Loader -->|"injects"| CoreLogic
    CoreLogic -->|"initHook"| Safetyhook
    CoreLogic -->|"readSettings"| ConfigModule
    CoreLogic -->|"logEvents"| Spdlog
    Safetyhook -->|"intercepts"| Game

    %% Click Events
    click CoreLogic "https://github.com/lyall/atelieryumiafix/blob/main/src/dllmain.cpp"
    click ConfigModule "https://github.com/lyall/atelieryumiafix/blob/main/AtelierYumiaFix.ini"
    click Safetyhook "https://github.com/lyall/atelieryumiafix/blob/main/external/safetyhook/safetyhook.cpp"
    click Spdlog "https://github.com/lyall/atelieryumiafix/tree/main/external/spdlog"

    %% Styles
    classDef gameProcess fill:#ffcccb,stroke:#333,stroke-width:2px;
    classDef plugin fill:#add8e6,stroke:#333,stroke-width:2px;
    classDef external fill:#90ee90,stroke:#333,stroke-width:2px;
```
