The LuaExMemoryTool is a Rust-based executable that allows running Lua scripts for external process memory access and manipulation on Linux and Android systems.
It uses the mlua library to embed Lua and exposes additional native functions for process and memory operations.
Root access is required.
The project compiles into a standalone executable.
You provide a .lua file path as an argument, and the executable runs that Lua script with extended memory-related APIs.
Supported platforms:
- Linux
- Android
This is a standard Rust project.
Requirements:
- Rust toolchain
- Cargo
Build command:
cargo build --releaseThe resulting executable will be located under:
target/release/
Run the executable and pass a Lua script path:
./LuaExMemoryTool script.luaExample Lua scripts are provided in the examples/ directory.
Retrieve the list of currently running processes:
for _, item in ipairs(get_process_list()) do
local pid = item.pid
local package_name = item.name
endAliases:
get_process_listprocess_list
Each item contains:
pid: numbername: string
Terminate a process by PID:
kill_process(pid)Used to initialize and manage a target process.
Initialize by package name:
process = process.init("package_name")Initialize by PID:
process = process.init_via_pid(pid)Fields:
pid: numbername: string
Retrieve memory mappings of the process:
for map in process:get_maps() do
-- ...
endEach map entry contains:
start: numberend: numberperms: stringoffset: numberdev: stringinode: numberpath: string
Used to read and write process memory.
process = process.init("package_name")
memory = memory.init(process)Read methods require only an address. Write methods require an address and a value.
Supported methods:
read_i8(address)/write_i8(address, value)read_bool(address)/write_bool(address, value)read_i16(address)/write_i16(address, value)read_i32(address)/write_i32(address, value)read_i64(address)/write_i64(address, value)read_float(address)/write_float(address, value)read_float64(address)/write_float64(address, value)read_pointer(address)/write_pointer(address, value)read_hex(address, length)write_hex(address, hex_string)
Example Lua scripts are available in the examples/ directory and demonstrate:
- Process listing
- Process initialization
- Memory map inspection
- Memory read/write operations
MIT License