# lsnbm/linux-android-arm64 architecture

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

- Interactive diagram: https://gitdiagram.com/lsnbm/linux-android-arm64
- Repository: https://github.com/lsnbm/linux-android-arm64

## Overview

LuckyStar is an Android ARM64 kernel memory-debugging driver with Android and Windows user-facing tools. The principal workflow is: a user operates a client, the client sends an operation over the documented fixed-address shared-memory protocol, and the kernel dispatcher invokes the requested memory, breakpoint, input, or monitoring capability. The graph also preserves the documented ARM64 instruction and Windows MCP branches. Some connections are based on README documentation or the SOURCE INDEX; unsampled implementation details are not inferred.

Main entry points: [`lsdriver/lsdriver.c`](https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/lsdriver.c) (Request Dispatcher), [`android/jni/src/main.cpp`](https://github.com/lsnbm/linux-android-arm64/blob/main/android/jni/src/main.cpp) (Android App), [`lsdriver/break_point.h`](https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/break_point.h) (Breakpoints), [`android/jni/include/memory_tool.h`](https://github.com/lsnbm/linux-android-arm64/blob/main/android/jni/include/memory_tool.h) (Memory Tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_kernel["Kernel Driver"]
  node_shared_protocol["Shared Protocol<br/>[io_struct.h]"]
  node_kernel_dispatch["Request Dispatcher<br/>[lsdriver.c]"]
  node_memory_rw["Process Memory I/O"]
  node_memory_enum["Memory Layout"]
  node_virtual_input["Virtual Input<br/>[virtual_input.h]"]
  node_sensor_monitor["Sensors and Monitors<br/>[virtual_gyro.h]"]
end

subgraph group_debug["ARM64 Debugging"]
  node_breakpoints["Breakpoints<br/>[break_point.h]"]
  node_hw_debug["Hardware Debug<br/>[arm64_hwdbg.h]"]
  node_pte_debug["PTE Debug"]
  node_step_dpt["Step and DPT<br/>[arm64_stepdbg.h]"]
  node_hook_framework["Hook Framework"]
  node_arm_decoder["ARM64 Decoder<br/>[arm64_decode.h]"]
  node_arm_encoder["ARM64 Encoder<br/>[arm64_encode.h]"]
  node_arm_emulator["Instruction Emulator<br/>[emulate_inst.h]"]
end

subgraph group_android["Android Client"]
  node_android_entry["Android App<br/>[main.cpp]"]
  node_memory_tool["Memory Tools<br/>[memory_tool.h]"]
  node_driver_api["Driver API<br/>[driver.h]"]
  node_http_server["HTTP Server<br/>[http_server.h]"]
  node_android_input["Touch Input"]
  node_surface["Surface Control"]
  node_renderers["ImGui Renderers"]
end

subgraph group_desktop["Windows Clients"]
  node_windows_ui["Windows UI<br/>[LuckyStar.py]"]
  node_http_bridge["HTTP Bridge<br/>[http_bridge.py]"]
  node_mcp_server["MCP Server<br/>[LuckyStarMcp.py]"]
  node_go_ui["Go Client UI<br/>[app.go]"]
  node_go_bridge["Go Bridge Client<br/>[client.go]"]
  node_go_mcp["Go MCP Server<br/>[server.go]"]
end

node_user(("User"))

node_user -->|"uses"| node_android_entry
node_android_entry -->|"presents tools"| node_memory_tool
node_memory_tool -->|"calls"| node_driver_api
node_memory_tool -->|"uses disassembly"| node_arm_decoder
node_android_entry -->|"starts service"| node_http_server
node_http_server -->|"uses"| node_memory_tool
node_android_entry -->|"uses"| node_android_input
node_android_entry -->|"uses"| node_renderers
node_renderers -->|"uses"| node_surface
node_android_input -.->|"accepts touch"| node_user
node_user -->|"uses"| node_windows_ui
node_windows_ui -->|"uses"| node_http_bridge
node_windows_ui -->|"sends requests"| node_http_server
node_user -->|"uses"| node_mcp_server
node_mcp_server -.->|"bridges requests"| node_http_bridge
node_user -.->|"uses"| node_go_ui
node_go_ui -.->|"delegates"| node_go_bridge
node_go_mcp -.->|"uses"| node_go_bridge
node_driver_api -->|"matches protocol"| node_shared_protocol
node_shared_protocol -->|"carries requests"| node_kernel_dispatch
node_kernel_dispatch -->|"dispatches"| node_memory_rw
node_kernel_dispatch -->|"dispatches"| node_memory_enum
node_kernel_dispatch -->|"dispatches"| node_virtual_input
node_kernel_dispatch -->|"dispatches"| node_sensor_monitor
node_kernel_dispatch -->|"dispatches"| node_breakpoints
node_breakpoints -->|"uses"| node_hw_debug
node_breakpoints -->|"uses"| node_pte_debug
node_breakpoints -->|"uses"| node_step_dpt
node_hw_debug -.->|"uses hooks"| node_hook_framework
node_pte_debug -->|"decodes instructions"| node_arm_decoder
node_pte_debug -->|"emulates instructions"| node_arm_emulator
node_hook_framework -->|"decodes instructions"| node_arm_decoder
node_hook_framework -->|"encodes instructions"| node_arm_encoder
node_arm_emulator -->|"uses decoder"| node_arm_decoder

click node_android_entry "https://github.com/lsnbm/linux-android-arm64/blob/main/android/jni/src/main.cpp"
click node_memory_tool "https://github.com/lsnbm/linux-android-arm64/blob/main/android/jni/include/memory_tool.h"
click node_driver_api "https://github.com/lsnbm/linux-android-arm64/blob/main/android/jni/driver/driver.h"
click node_http_server "https://github.com/lsnbm/linux-android-arm64/blob/main/android/jni/include/http_server.h"
click node_android_input "https://github.com/lsnbm/linux-android-arm64/blob/main/android/jni/android_imgui_input/imgui_touch_input.h"
click node_surface "https://github.com/lsnbm/linux-android-arm64/blob/main/android/jni/android_surface/surface_control_manager.h"
click node_renderers "https://github.com/lsnbm/linux-android-arm64/blob/main/android/jni/android_draw/opengl_imgui_renderer.h"
click node_shared_protocol "https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/io_struct.h"
click node_kernel_dispatch "https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/lsdriver.c"
click node_memory_rw "https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/virtual_memory_rw.h"
click node_memory_enum "https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/virtual_memory_enum.h"
click node_virtual_input "https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/virtual_input.h"
click node_sensor_monitor "https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/virtual_gyro.h"
click node_breakpoints "https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/break_point.h"
click node_hw_debug "https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/arm64_hwdbg.h"
click node_pte_debug "https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/arm64_ptedbg-20260822-000439.h"
click node_step_dpt "https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/arm64_stepdbg.h"
click node_hook_framework "https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/inline_hook_frame.h"
click node_arm_decoder "https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/arm64_decode/arm64_decode.h"
click node_arm_encoder "https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/arm64_encode/arm64_encode.h"
click node_arm_emulator "https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/arm64_emulate/emulate_inst.h"
click node_windows_ui "https://github.com/lsnbm/linux-android-arm64/blob/main/windows/LuckyStar.py"
click node_http_bridge "https://github.com/lsnbm/linux-android-arm64/blob/main/windows/http_bridge.py"
click node_mcp_server "https://github.com/lsnbm/linux-android-arm64/blob/main/windows/LuckyStarMcp.py"
click node_go_ui "https://github.com/lsnbm/linux-android-arm64/blob/main/windows/go_client/internal/ui/app.go"
click node_go_bridge "https://github.com/lsnbm/linux-android-arm64/blob/main/windows/go_client/internal/bridge/client.go"
click node_go_mcp "https://github.com/lsnbm/linux-android-arm64/blob/main/windows/go_client/internal/mcp/server.go"

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_shared_protocol,node_kernel_dispatch,node_memory_rw,node_memory_enum,node_virtual_input,node_sensor_monitor,node_user toneBlue
class node_breakpoints,node_hw_debug,node_pte_debug,node_step_dpt,node_hook_framework,node_arm_decoder,node_arm_encoder,node_arm_emulator toneAmber
class node_android_entry,node_memory_tool,node_driver_api,node_http_server,node_android_input,node_surface,node_renderers toneMint
class node_windows_ui,node_http_bridge,node_mcp_server,node_go_ui,node_go_bridge,node_go_mcp toneRose
```

## Components

### Kernel Driver

- [Shared Protocol](https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/io_struct.h): `lsdriver/io_struct.h`
- [Request Dispatcher](https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/lsdriver.c): `lsdriver/lsdriver.c`
- [Process Memory I/O](https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/virtual_memory_rw.h): `lsdriver/virtual_memory_rw.h`
- [Memory Layout](https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/virtual_memory_enum.h): `lsdriver/virtual_memory_enum.h`
- [Virtual Input](https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/virtual_input.h): `lsdriver/virtual_input.h`
- [Sensors and Monitors](https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/virtual_gyro.h): `lsdriver/virtual_gyro.h`

### ARM64 Debugging

- [Breakpoints](https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/break_point.h): `lsdriver/break_point.h`
- [Hardware Debug](https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/arm64_hwdbg.h): `lsdriver/arm64_hwdbg.h`
- [PTE Debug](https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/arm64_ptedbg-20260822-000439.h): `lsdriver/arm64_ptedbg-20260822-000439.h`
- [Step and DPT](https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/arm64_stepdbg.h): `lsdriver/arm64_stepdbg.h`
- [Hook Framework](https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/inline_hook_frame.h): `lsdriver/inline_hook_frame.h`
- [ARM64 Decoder](https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/arm64_decode/arm64_decode.h): `lsdriver/arm64_decode/arm64_decode.h`
- [ARM64 Encoder](https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/arm64_encode/arm64_encode.h): `lsdriver/arm64_encode/arm64_encode.h`
- [Instruction Emulator](https://github.com/lsnbm/linux-android-arm64/blob/main/lsdriver/arm64_emulate/emulate_inst.h): `lsdriver/arm64_emulate/emulate_inst.h`

### Android Client

- [Android App](https://github.com/lsnbm/linux-android-arm64/blob/main/android/jni/src/main.cpp): `android/jni/src/main.cpp`
- [Memory Tools](https://github.com/lsnbm/linux-android-arm64/blob/main/android/jni/include/memory_tool.h): `android/jni/include/memory_tool.h`
- [Driver API](https://github.com/lsnbm/linux-android-arm64/blob/main/android/jni/driver/driver.h): `android/jni/driver/driver.h`
- [HTTP Server](https://github.com/lsnbm/linux-android-arm64/blob/main/android/jni/include/http_server.h): `android/jni/include/http_server.h`
- [Touch Input](https://github.com/lsnbm/linux-android-arm64/blob/main/android/jni/android_imgui_input/imgui_touch_input.h): `android/jni/android_imgui_input/imgui_touch_input.h`
- [Surface Control](https://github.com/lsnbm/linux-android-arm64/blob/main/android/jni/android_surface/surface_control_manager.h): `android/jni/android_surface/surface_control_manager.h`
- [ImGui Renderers](https://github.com/lsnbm/linux-android-arm64/blob/main/android/jni/android_draw/opengl_imgui_renderer.h): `android/jni/android_draw/opengl_imgui_renderer.h`

### Windows Clients

- [Windows UI](https://github.com/lsnbm/linux-android-arm64/blob/main/windows/LuckyStar.py): `windows/LuckyStar.py`
- [HTTP Bridge](https://github.com/lsnbm/linux-android-arm64/blob/main/windows/http_bridge.py): `windows/http_bridge.py`
- [MCP Server](https://github.com/lsnbm/linux-android-arm64/blob/main/windows/LuckyStarMcp.py): `windows/LuckyStarMcp.py`
- [Go Client UI](https://github.com/lsnbm/linux-android-arm64/blob/main/windows/go_client/internal/ui/app.go): `windows/go_client/internal/ui/app.go`
- [Go Bridge Client](https://github.com/lsnbm/linux-android-arm64/blob/main/windows/go_client/internal/bridge/client.go): `windows/go_client/internal/bridge/client.go`
- [Go MCP Server](https://github.com/lsnbm/linux-android-arm64/blob/main/windows/go_client/internal/mcp/server.go): `windows/go_client/internal/mcp/server.go`

### Other components

- **User**

## Connections

- User → Android App: uses (evidence: `README.md`)
- Android App → Memory Tools: presents tools (evidence: `android/jni/src/main.cpp`)
- Memory Tools → Driver API: calls (evidence: `android/jni/include/memory_tool.h`)
- Memory Tools → ARM64 Decoder: uses disassembly (evidence: `android/jni/include/memory_tool.h`)
- Android App → HTTP Server: starts service (evidence: `android/jni/src/main.cpp`)
- HTTP Server → Memory Tools: uses (evidence: `android/jni/include/http_server.h`)
- Android App → Touch Input: uses (evidence: `android/jni/src/main.cpp`)
- Android App → ImGui Renderers: uses (evidence: `android/jni/src/main.cpp`)
- ImGui Renderers → Surface Control: uses (evidence: `android/jni/android_draw/opengl_imgui_renderer.h`)
- Touch Input → User: accepts touch
- User → Windows UI: uses (evidence: `README.md`)
- Windows UI → HTTP Bridge: uses (evidence: `windows/LuckyStar.py`)
- Windows UI → HTTP Server: sends requests (evidence: `README.md`)
- User → MCP Server: uses (evidence: `README.md`)
- MCP Server → HTTP Bridge: bridges requests
- User → Go Client UI: uses
- Go Client UI → Go Bridge Client: delegates
- Go MCP Server → Go Bridge Client: uses
- Driver API → Shared Protocol: matches protocol (evidence: `README.md`)
- Shared Protocol → Request Dispatcher: carries requests (evidence: `README.md`)
- Request Dispatcher → Process Memory I/O: dispatches (evidence: `README.md`)
- Request Dispatcher → Memory Layout: dispatches (evidence: `README.md`)
- Request Dispatcher → Virtual Input: dispatches (evidence: `README.md`)
- Request Dispatcher → Sensors and Monitors: dispatches (evidence: `README.md`)
- Request Dispatcher → Breakpoints: dispatches (evidence: `README.md`)
- Breakpoints → Hardware Debug: uses (evidence: `README.md`)
- Breakpoints → PTE Debug: uses (evidence: `README.md`)
- Breakpoints → Step and DPT: uses (evidence: `README.md`)
- Hardware Debug → Hook Framework: uses hooks
- PTE Debug → ARM64 Decoder: decodes instructions
- PTE Debug → Instruction Emulator: emulates instructions (evidence: `lsdriver/arm64_ptedbg-20260822-000439.h`)
- Hook Framework → ARM64 Decoder: decodes instructions (evidence: `lsdriver/inline_hook_frame.h`)
- Hook Framework → ARM64 Encoder: encodes instructions (evidence: `lsdriver/inline_hook_frame.h`)
- Instruction Emulator → ARM64 Decoder: uses decoder (evidence: `lsdriver/arm64_emulate/emulate_inst.h`)
