# vrc-emulator/vrc-eac-emulator architecture

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

- Interactive diagram: https://gitdiagram.com/vrc-emulator/vrc-eac-emulator
- Repository: https://github.com/vrc-emulator/vrc-eac-emulator

## Overview

This repository implements a VRChat EasyAntiCheat emulator: a Windows-side compatibility DLL communicates with a Linux-side emulator through HTTP and WebSocket interfaces. The principal flow is client initialization and packet exchange, followed by Linux-side EOS platform and AntiCheat operations; HTTP task requests cover login, login-status, and ID/string operations. The README also documents a Linux launch guard that validates EAC offsets before preventing two EAC actions. Edges use the supplied excerpts, source-index references, or README; unsampled transport and server wiring is not asserted.

Main entry points: [`src/linux/handlers`](https://github.com/vrc-emulator/vrc-eac-emulator/tree/master/src/linux/handlers) (Packet feature handlers), [`src/win/handler/handlers/client_packet_handler.cpp`](https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/win/handler/handlers/client_packet_handler.cpp) (Client packet handler), [`src/win/emulator_client.cpp`](https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/win/emulator_client.cpp) (Emulator client), [`src/linux/api`](https://github.com/vrc-emulator/vrc-eac-emulator/tree/master/src/linux/api) (Login and account API handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Windows Client Emulator"]
  node_dll["Windows compatibility DLL<br/>[dllmain.cpp]"]
  node_emulator_client["Emulator client"]
  node_client_handler["Client packet handler"]
  node_handler_registry_win["Client handler registry"]
  node_websocket_client["WebSocket client"]
  node_packet_sender["Packet sender<br/>[packet_sender.cpp]"]
  node_eos_win["EOS compatibility implementations"]
end

subgraph group_protocol["Shared Protocol and API"]
  node_packet_types["Protocol packet types"]
  node_packet_codec["Packet codec<br/>[packet_codec.cpp]"]
  node_api_factory["HTTP request/response factory<br/>[session_factory.h]"]
  node_json["JSON serialization<br/>[json.hpp]"]
  node_base64["Base64 encoding<br/>[base64.hpp]"]
end

subgraph group_server["Linux Emulator"]
  node_linux_bootstrap["Linux emulator bootstrap<br/>[bootstrapper.cpp]"]
  node_linux_ws["WebSocket server"]
  node_linux_http["HTTP server<br/>[http_server.cpp]"]
  node_linux_api["Login and account API handlers"]
  node_eos_platform["EOS platform and Connect<br/>[eos_platform.cpp]"]
  node_eos_anticheat["EOS AntiCheat<br/>[eos_anticheat.cpp]"]
  node_linux_registry["Packet handler registry<br/>[handler_registry.h]"]
  node_linux_handlers["Packet feature handlers"]
end

subgraph group_launch["Linux Launch Guard"]
  node_launch_guard["EAC memory-protection guard"]
end

node_game(("VRChat game"))
node_proton_game(("Proton-launched game"))

node_game -.->|"loads"| node_dll
node_dll -.->|"initializes"| node_emulator_client
node_emulator_client -->|"instantiates"| node_client_handler
node_emulator_client -->|"starts"| node_packet_sender
node_emulator_client -->|"runs"| node_websocket_client
node_emulator_client -->|"creates responses"| node_api_factory
node_client_handler -->|"registers handlers"| node_handler_registry_win
node_client_handler -->|"sends packets"| node_packet_sender
node_client_handler -->|"dispatches EOS callbacks"| node_eos_win
node_client_handler -->|"handles packets"| node_packet_types
node_websocket_client -->|"encodes packets"| node_packet_codec
node_websocket_client -->|"dispatches packets"| node_client_handler
node_packet_sender -->|"sends packets"| node_packet_types
node_linux_bootstrap -.->|"starts server"| node_linux_ws
node_linux_bootstrap -.->|"starts server"| node_linux_http
node_linux_registry -->|"routes packets"| node_linux_handlers
node_linux_handlers -->|"uses platform"| node_eos_platform
node_linux_handlers -->|"calls AntiCheat"| node_eos_anticheat
node_linux_handlers -->|"decodes packet data"| node_packet_types
node_linux_handlers -->|"sends notifications"| node_linux_ws
node_linux_api -->|"gets Connect interface"| node_eos_platform
node_linux_api -->|"waits for connection"| node_linux_ws
node_linux_api -->|"uses request types"| node_api_factory
node_linux_handlers -->|"decodes messages"| node_base64
node_launch_guard -->|"launches and guards"| node_proton_game

click node_dll "https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/win/dllmain.cpp"
click node_emulator_client "https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/win/emulator_client.cpp"
click node_client_handler "https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/win/handler/handlers/client_packet_handler.cpp"
click node_handler_registry_win "https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/win/handler/handler_registry.cpp"
click node_websocket_client "https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/win/sock/websocket_client.cpp"
click node_packet_sender "https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/win/sock/packet_sender.cpp"
click node_eos_win "https://github.com/vrc-emulator/vrc-eac-emulator/tree/master/src/win/eos_impl"
click node_packet_types "https://github.com/vrc-emulator/vrc-eac-emulator/tree/master/src/common/protocol/packets"
click node_packet_codec "https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/common/protocol/packet_codec.cpp"
click node_api_factory "https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/common/api/session_factory.h"
click node_json "https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/includes/json.hpp"
click node_base64 "https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/includes/base64.hpp"
click node_linux_bootstrap "https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/linux/bootstrapper.cpp"
click node_linux_ws "https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/linux/servers/websocket_server.cpp"
click node_linux_http "https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/linux/servers/http_server.cpp"
click node_linux_api "https://github.com/vrc-emulator/vrc-eac-emulator/tree/master/src/linux/api"
click node_eos_platform "https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/linux/eos/eos_platform.cpp"
click node_eos_anticheat "https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/linux/eos/eos_anticheat.cpp"
click node_linux_registry "https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/linux/handlers/handler_registry.h"
click node_linux_handlers "https://github.com/vrc-emulator/vrc-eac-emulator/tree/master/src/linux/handlers"
click node_launch_guard "https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/tools/eac_mprotect_guard.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_dll,node_emulator_client,node_client_handler,node_handler_registry_win,node_websocket_client,node_packet_sender,node_eos_win toneBlue
class node_packet_types,node_packet_codec,node_api_factory,node_json,node_base64 toneAmber
class node_linux_bootstrap,node_linux_ws,node_linux_http,node_linux_api,node_eos_platform,node_eos_anticheat,node_linux_registry,node_linux_handlers toneMint
class node_launch_guard toneRose
class node_game,node_proton_game toneIndigo
```

## Components

### Windows Client Emulator

- [Windows compatibility DLL](https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/win/dllmain.cpp): `src/win/dllmain.cpp`
- [Emulator client](https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/win/emulator_client.cpp): `src/win/emulator_client.cpp`
- [Client packet handler](https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/win/handler/handlers/client_packet_handler.cpp): `src/win/handler/handlers/client_packet_handler.cpp`
- [Client handler registry](https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/win/handler/handler_registry.cpp): `src/win/handler/handler_registry.cpp`
- [WebSocket client](https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/win/sock/websocket_client.cpp): `src/win/sock/websocket_client.cpp`
- [Packet sender](https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/win/sock/packet_sender.cpp): `src/win/sock/packet_sender.cpp`
- [EOS compatibility implementations](https://github.com/vrc-emulator/vrc-eac-emulator/tree/master/src/win/eos_impl): `src/win/eos_impl`

### Shared Protocol and API

- [Protocol packet types](https://github.com/vrc-emulator/vrc-eac-emulator/tree/master/src/common/protocol/packets): `src/common/protocol/packets`
- [Packet codec](https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/common/protocol/packet_codec.cpp): `src/common/protocol/packet_codec.cpp`
- [HTTP request/response factory](https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/common/api/session_factory.h): `src/common/api/session_factory.h`
- [JSON serialization](https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/includes/json.hpp): `includes/json.hpp`
- [Base64 encoding](https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/includes/base64.hpp): `includes/base64.hpp`

### Linux Emulator

- [Linux emulator bootstrap](https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/linux/bootstrapper.cpp): `src/linux/bootstrapper.cpp`
- [WebSocket server](https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/linux/servers/websocket_server.cpp): `src/linux/servers/websocket_server.cpp`
- [HTTP server](https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/linux/servers/http_server.cpp): `src/linux/servers/http_server.cpp`
- [Login and account API handlers](https://github.com/vrc-emulator/vrc-eac-emulator/tree/master/src/linux/api): `src/linux/api`
- [EOS platform and Connect](https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/linux/eos/eos_platform.cpp): `src/linux/eos/eos_platform.cpp`
- [EOS AntiCheat](https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/linux/eos/eos_anticheat.cpp): `src/linux/eos/eos_anticheat.cpp`
- [Packet handler registry](https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/src/linux/handlers/handler_registry.h): `src/linux/handlers/handler_registry.h`
- [Packet feature handlers](https://github.com/vrc-emulator/vrc-eac-emulator/tree/master/src/linux/handlers): `src/linux/handlers`

### Linux Launch Guard

- [EAC memory-protection guard](https://github.com/vrc-emulator/vrc-eac-emulator/blob/master/tools/eac_mprotect_guard.py): `tools/eac_mprotect_guard.py`

### Other components

- **VRChat game**
- **Proton-launched game**

## Connections

- VRChat game → Windows compatibility DLL: loads
- Windows compatibility DLL → Emulator client: initializes
- Emulator client → Client packet handler: instantiates (evidence: `src/win/emulator_client.cpp`)
- Emulator client → Packet sender: starts (evidence: `src/win/emulator_client.cpp`)
- Emulator client → WebSocket client: runs (evidence: `src/win/emulator_client.cpp`)
- Emulator client → HTTP request/response factory: creates responses (evidence: `src/win/emulator_client.cpp`)
- Client packet handler → Client handler registry: registers handlers (evidence: `src/win/handler/handlers/client_packet_handler.cpp`)
- Client packet handler → Packet sender: sends packets (evidence: `src/win/handler/handlers/client_packet_handler.cpp`)
- Client packet handler → EOS compatibility implementations: dispatches EOS callbacks (evidence: `src/win/handler/handlers/client_packet_handler.cpp`)
- Client packet handler → Protocol packet types: handles packets (evidence: `src/win/handler/handlers/client_packet_handler.cpp`)
- WebSocket client → Packet codec: encodes packets (evidence: `src/win/sock/websocket_client.cpp`)
- WebSocket client → Client packet handler: dispatches packets (evidence: `src/win/sock/websocket_client.cpp`)
- Packet sender → Protocol packet types: sends packets
- Linux emulator bootstrap → WebSocket server: starts server
- Linux emulator bootstrap → HTTP server: starts server
- Packet handler registry → Packet feature handlers: routes packets (evidence: `src/linux/handlers/handler_registry.h`)
- Packet feature handlers → EOS platform and Connect: uses platform (evidence: `src/linux/handlers/anticheat/begin_session_handler.cpp`)
- Packet feature handlers → EOS AntiCheat: calls AntiCheat (evidence: `src/linux/handlers/anticheat/begin_session_handler.cpp`)
- Packet feature handlers → Protocol packet types: decodes packet data (evidence: `src/linux/handlers/anticheat/begin_session_handler.cpp`)
- Packet feature handlers → WebSocket server: sends notifications (evidence: `src/linux/handlers/notification/notify_message_to_server_handler.cpp`)
- Login and account API handlers → EOS platform and Connect: gets Connect interface (evidence: `src/linux/api/login_handler.cpp`)
- Login and account API handlers → WebSocket server: waits for connection (evidence: `src/linux/api/login_handler.cpp`)
- Login and account API handlers → HTTP request/response factory: uses request types (evidence: `src/common/api/session_factory.h`)
- Packet feature handlers → Base64 encoding: decodes messages (evidence: `src/linux/handlers/notification/notify_message_to_server_handler.cpp`)
- EAC memory-protection guard → Proton-launched game: launches and guards (evidence: `README.md`)
