# xianlabs/boexile architecture

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

- Interactive diagram: https://gitdiagram.com/xianlabs/boexile
- Repository: https://github.com/xianlabs/boexile

## Overview

##### Core Engine Layer
- Components:
- Memory Management (Pointer.hpp, MemoryOffsets.hpp)
- Assembly Interface (Functions.asm, Hooks.asm)
- DLL Integration (DLLMain.cpp, HideDLL.hpp)

##### Entity System Layer
- This above the Core Engine
- Relationship between:
- Base Entity (Entity.hpp)
- Component System (CComponent.hpp)
- Specialized Entities:
- Actor/Player (Actor.hpp, Player.hpp)
- Local Actor (LocalActor.hpp)
- Chest (Chest.hpp)
- Life (Life.hpp)

##### Game Interaction Layer
- Include:
- Pathfinding System (PathFinder.hpp)
- Bot Logic (BotBase.hpp)
- Area Transitions (AreaTransition.hpp)
- Inventory Management (Inventories.hpp)

##### Network Layer
- This on the right side
- Show:
- Packet System:
- PacketBuilder
- PacketWriter
- PacketControls
- Network Logging (NetLogger.hpp)
- Encryption (Blowfish.hpp)

##### User Interface Layer
- At the top
- Include:
- Forms (MyForm.h)
- Hotkey System (Hotkeys.hpp)

##### Scripting Integration
- On the left side
- Include:
- LUA Integration
- LUAWrapper

##### A Notes Section
- Mention the version compatibility (Pre-3.16)
- Component-based architecture
- Memory manipulation aspects

Special Considerations:

##### Entity-Component System
- How all game objects inherit from the base Entity class
- Component list structure
- Demonstrate how components store and manage data

##### Security Layer
- DLL hiding mechanism
- Blowfish encryption integration
- Memory manipulation safety measures

##### Bot Logic Flow
- Decision-making process
- Pathfinding integration
- Demonstrate how the bot interacts with game elements

Level of Detail:
- Keep main systems visible at a glance
- Memory offset relationships without specific values
- Major data flows without implementation details

## Diagram (Mermaid)

```mermaid
graph TB
    classDef core fill:#ffcccc,stroke:#333,stroke-width:2px
    classDef entity fill:#cce5ff,stroke:#333,stroke-width:2px
    classDef network fill:#ccffcc,stroke:#333,stroke-width:2px
    classDef ui fill:#e5ccff,stroke:#333,stroke-width:2px
    classDef script fill:#ffffcc,stroke:#333,stroke-width:2px

    subgraph UI["User Interface Layer"]
        UI_Form["Forms Interface"]
        UI_Hotkey["Hotkey System"]
    end

    subgraph GameInt["Game Interaction Layer"]
        PathFind["Pathfinding System"]
        BotLogic["Bot Logic"]
        AreaTrans["Area Transitions"]
        InvMgmt["Inventory Management"]
    end

    subgraph Script["Scripting Layer"]
        LUA["LUA Engine"]
        LUAWrap["LUA Wrapper"]
    end

    subgraph Network["Network Layer"]
        PacketSys["Packet System"]
        NetLog["Network Logger"]
        Encrypt["Encryption"]
        
        subgraph PacketComponents
            PacketBuild["Packet Builder"]
            PacketWrite["Packet Writer"]
            PacketCtrl["Packet Controls"]
        end
    end

    subgraph Entity["Entity System Layer"]
        BaseEntity["Base Entity"]
        CompSys["Component System"]
        
        subgraph Entities
            Actor["Actor"]
            Player["Player"]
            LocalActor["Local Actor"]
            Chest["Chest"]
            Life["Life"]
        end
    end

    subgraph Core["Core Engine Layer"]
        MemMgmt["Memory Management"]
        AsmInt["Assembly Interface"]
        DLLInt["DLL Integration"]
    end

    %% Relationships
    UI_Form --> BotLogic
    UI_Hotkey --> BotLogic
    
    BotLogic --> PathFind
    BotLogic --> AreaTrans
    BotLogic --> InvMgmt
    
    LUA --> LUAWrap
    LUAWrap --> BotLogic
    
    PacketSys --> PacketBuild
    PacketSys --> PacketWrite
    PacketSys --> PacketCtrl
    PacketSys --> NetLog
    PacketSys --> Encrypt
    
    BaseEntity --> CompSys
    CompSys --> Actor
    Actor --> Player
    Player --> LocalActor
    CompSys --> Chest
    CompSys --> Life
    
    MemMgmt --> BaseEntity
    AsmInt --> MemMgmt
    DLLInt --> MemMgmt

    %% Click events
    click MemMgmt "https://github.com/XianLabs/BoExile/blob/master/Pointer.hpp"
    click AsmInt "https://github.com/XianLabs/BoExile/blob/master/Functions.asm"
    click DLLInt "https://github.com/XianLabs/BoExile/blob/master/DLLMain.cpp"
    click BaseEntity "https://github.com/XianLabs/BoExile/blob/master/Entity.hpp"
    click CompSys "https://github.com/XianLabs/BoExile/blob/master/CComponent.hpp"
    click Actor "https://github.com/XianLabs/BoExile/blob/master/Actor.hpp"
    click Player "https://github.com/XianLabs/BoExile/blob/master/Player.hpp"
    click LocalActor "https://github.com/XianLabs/BoExile/blob/master/LocalActor.hpp"
    click Chest "https://github.com/XianLabs/BoExile/blob/master/Chest.hpp"
    click Life "https://github.com/XianLabs/BoExile/blob/master/Life.hpp"
    click PathFind "https://github.com/XianLabs/BoExile/blob/master/PathFinder.hpp"
    click BotLogic "https://github.com/XianLabs/BoExile/blob/master/BotBase.hpp"
    click AreaTrans "https://github.com/XianLabs/BoExile/blob/master/AreaTransition.hpp"
    click InvMgmt "https://github.com/XianLabs/BoExile/blob/master/Inventories.hpp"
    click PacketBuild "https://github.com/XianLabs/BoExile/blob/master/PacketBuilder.hpp"
    click PacketWrite "https://github.com/XianLabs/BoExile/blob/master/PacketWriter.hpp"
    click PacketCtrl "https://github.com/XianLabs/BoExile/blob/master/PacketControls.h"
    click NetLog "https://github.com/XianLabs/BoExile/blob/master/NetLogger.hpp"
    click Encrypt "https://github.com/XianLabs/BoExile/blob/master/Blowfish.hpp"
    click UI_Form "https://github.com/XianLabs/BoExile/blob/master/MyForm.h"
    click UI_Hotkey "https://github.com/XianLabs/BoExile/blob/master/Hotkeys.hpp"
    click LUA "https://github.com/XianLabs/BoExile/blob/master/LUA/lua.hpp"
    click LUAWrap "https://github.com/XianLabs/BoExile/blob/master/LUAWrapper.hpp"

    %% Styling
    class MemMgmt,AsmInt,DLLInt core
    class BaseEntity,CompSys,Actor,Player,LocalActor,Chest,Life entity
    class PacketSys,PacketBuild,PacketWrite,PacketCtrl,NetLog,Encrypt network
    class UI_Form,UI_Hotkey ui
    class LUA,LUAWrap script
```
