# theprofessionaldumbass/memoryk architecture

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

- Interactive diagram: https://gitdiagram.com/theprofessionaldumbass/memoryk
- Repository: https://github.com/theprofessionaldumbass/memoryk

## Overview

MiProtect is a Linux/Android kernel driver with a user-space C++ client. The sample app finds a target process, asks the driver for a module base, then reads memory; the client also exposes memory writes and virtual-touch commands. The kernel ioctl dispatcher routes these requests to process-memory, module-lookup, or touch handling. The tree and sampled source support these paths; no README content was provided, so undocumented capabilities cannot be assessed.

Main entry points: [`kernel/entry.c`](https://github.com/theprofessionaldumbass/memoryk/blob/main/kernel/entry.c) (Device ioctl dispatch), [`kernel/memory.c`](https://github.com/theprofessionaldumbass/memoryk/blob/main/kernel/memory.c) (Process memory ops), [`kernel/process.c`](https://github.com/theprofessionaldumbass/memoryk/blob/main/kernel/process.c) (Module lookup), [`user/main.cpp`](https://github.com/theprofessionaldumbass/memoryk/blob/main/user/main.cpp) (Sample app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User client"]
  node_app_user["Sample app<br/>[main.cpp]"]
  node_client_api["Driver API<br/>[driver.hpp]"]
end

subgraph group_kernel["Kernel driver"]
  node_device_dispatch["Device ioctl dispatch<br/>[entry.c]"]
  node_memory_operations["Process memory ops<br/>[memory.c]"]
  node_address_translation["Address translation<br/>[memory.c]"]
  node_physical_access["Physical access<br/>[memory.c]"]
  node_module_lookup["Module lookup<br/>[process.c]"]
  node_touch_commands["Touch event handling<br/>[input_hook.c]"]
  node_virtual_touch["Virtual input device<br/>[input_hook.c]"]
end

subgraph group_services["Kernel services"]
  node_kernel_mm["Kernel process memory"]
end

node_process_discovery(("Process discovery"))
node_target_process(("Target process"))
node_linux_input["Linux input subsystem"]

node_app_user -->|"finds PID"| node_process_discovery
node_app_user -->|"calls API"| node_client_api
node_client_api -->|"sends ioctls"| node_device_dispatch
node_device_dispatch -->|"dispatches read/write"| node_memory_operations
node_device_dispatch -->|"dispatches lookup"| node_module_lookup
node_device_dispatch -->|"dispatches touch"| node_touch_commands
node_memory_operations -->|"gets process memory"| node_kernel_mm
node_memory_operations -->|"translates addresses"| node_address_translation
node_address_translation -->|"maps physical address"| node_physical_access
node_module_lookup -->|"scans mappings"| node_kernel_mm
node_memory_operations -->|"reads or writes"| node_target_process
node_module_lookup -->|"finds module mapping"| node_target_process
node_touch_commands -->|"reports contacts"| node_virtual_touch
node_virtual_touch -->|"emits input events"| node_linux_input

click node_app_user "https://github.com/theprofessionaldumbass/memoryk/blob/main/user/main.cpp"
click node_client_api "https://github.com/theprofessionaldumbass/memoryk/blob/main/user/driver.hpp"
click node_device_dispatch "https://github.com/theprofessionaldumbass/memoryk/blob/main/kernel/entry.c"
click node_memory_operations "https://github.com/theprofessionaldumbass/memoryk/blob/main/kernel/memory.c"
click node_address_translation "https://github.com/theprofessionaldumbass/memoryk/blob/main/kernel/memory.c"
click node_physical_access "https://github.com/theprofessionaldumbass/memoryk/blob/main/kernel/memory.c"
click node_module_lookup "https://github.com/theprofessionaldumbass/memoryk/blob/main/kernel/process.c"
click node_touch_commands "https://github.com/theprofessionaldumbass/memoryk/blob/main/kernel/input_hook.c"
click node_virtual_touch "https://github.com/theprofessionaldumbass/memoryk/blob/main/kernel/input_hook.c"

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_app_user,node_client_api toneBlue
class node_device_dispatch,node_memory_operations,node_address_translation,node_physical_access,node_module_lookup,node_touch_commands,node_virtual_touch toneAmber
class node_kernel_mm toneMint
class node_process_discovery,node_target_process,node_linux_input toneIndigo
```

## Components

### User client

- [Sample app](https://github.com/theprofessionaldumbass/memoryk/blob/main/user/main.cpp): `user/main.cpp`
- [Driver API](https://github.com/theprofessionaldumbass/memoryk/blob/main/user/driver.hpp): `user/driver.hpp`

### Kernel driver

- [Device ioctl dispatch](https://github.com/theprofessionaldumbass/memoryk/blob/main/kernel/entry.c): `kernel/entry.c`
- [Process memory ops](https://github.com/theprofessionaldumbass/memoryk/blob/main/kernel/memory.c): `kernel/memory.c`
- [Address translation](https://github.com/theprofessionaldumbass/memoryk/blob/main/kernel/memory.c): `kernel/memory.c`
- [Physical access](https://github.com/theprofessionaldumbass/memoryk/blob/main/kernel/memory.c): `kernel/memory.c`
- [Module lookup](https://github.com/theprofessionaldumbass/memoryk/blob/main/kernel/process.c): `kernel/process.c`
- [Touch event handling](https://github.com/theprofessionaldumbass/memoryk/blob/main/kernel/input_hook.c): `kernel/input_hook.c`
- [Virtual input device](https://github.com/theprofessionaldumbass/memoryk/blob/main/kernel/input_hook.c): `kernel/input_hook.c`

### Kernel services

- **Kernel process memory**

### Other components

- **Process discovery**
- **Target process**
- **Linux input subsystem**

## Connections

- Sample app → Process discovery: finds PID
- Sample app → Driver API: calls API
- Driver API → Device ioctl dispatch: sends ioctls
- Device ioctl dispatch → Process memory ops: dispatches read/write
- Device ioctl dispatch → Module lookup: dispatches lookup
- Device ioctl dispatch → Touch event handling: dispatches touch
- Process memory ops → Kernel process memory: gets process memory
- Process memory ops → Address translation: translates addresses
- Address translation → Physical access: maps physical address
- Module lookup → Kernel process memory: scans mappings
- Process memory ops → Target process: reads or writes
- Module lookup → Target process: finds module mapping
- Touch event handling → Virtual input device: reports contacts
- Virtual input device → Linux input subsystem: emits input events
