Skip to content

Lua External Memory Tool runs user-provided Lua scripts to inspect and modify external process memory on Linux and Android. Root privileges are required.

License

Notifications You must be signed in to change notification settings

Klarexxx/LuaExMemoryTool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LuaExMemoryTool

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.

Overview

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

Build

This is a standard Rust project.

Requirements:

  • Rust toolchain
  • Cargo

Build command:

cargo build --release

The resulting executable will be located under:

target/release/

Usage

Run the executable and pass a Lua script path:

./LuaExMemoryTool script.lua

Example Lua scripts are provided in the examples/ directory.

Lua API

Process List

Retrieve the list of currently running processes:

for _, item in ipairs(get_process_list()) do
    local pid = item.pid
    local package_name = item.name
end

Aliases:

  • get_process_list
  • process_list

Each item contains:

  • pid: number
  • name: string

Kill Process

Terminate a process by PID:

kill_process(pid)

process Class

Used to initialize and manage a target process.

Initialization

Initialize by package name:

process = process.init("package_name")

Initialize by PID:

process = process.init_via_pid(pid)

Fields:

  • pid: number
  • name: string

Memory Maps

Retrieve memory mappings of the process:

for map in process:get_maps() do
    -- ...
end

Each map entry contains:

  • start: number
  • end: number
  • perms: string
  • offset: number
  • dev: string
  • inode: number
  • path: string

memory Class

Used to read and write process memory.

Initialization

process = process.init("package_name")
memory = memory.init(process)

Read / Write Methods

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)

Examples

Example Lua scripts are available in the examples/ directory and demonstrate:

  • Process listing
  • Process initialization
  • Memory map inspection
  • Memory read/write operations

License

MIT License

About

Lua External Memory Tool runs user-provided Lua scripts to inspect and modify external process memory on Linux and Android. Root privileges are required.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages