This is a C-based memory tool for Android that allows you to read and write memory in a specified process. It leverages the process_vm_readv
and process_vm_writev
system calls for memory operations.
- read_memory: Read memory from a specified process.
- write_memory: Write data to a specified memory address in a process.
- get_pid: Get the process ID based on the process name.
- get_module_address: Get the base address of a specific module in the process's memory.
-
Include the tool:
#include "MemoryTool.h"
-
Read Memory:
ssize_t read_result = read_memory(pid, address, buffer, size); if (read_result == -1) { printf("Error: Failed to read memory.\n"); return 1; }
-
Write Memory:
ssize_t write_result = write_memory(pid, address, data, size); if (write_result == -1) { printf("Error: Failed to write memory.\n"); return 1; }
-
Get Process ID:
pid_t process_id = get_pid("target_process_name"); if (process_id == -1) { printf("Error: Process ID not found.\n"); return 1; }
-
Get Module Address:
unsigned long long module_address = get_module_address(process_id, "target_module_name"); if (module_address == 0) { printf("Error: Module address not found.\n"); return 1; }
To use this tool, create a file named main.c
and include the MemoryTool.h
header:
#include <stdio.h>
#include "MemoryTool.h"
int main() {
// Get the process ID of PUBG Mobile
pid_t pid = get_pid("com.tencent.ig");
if (pid == -1) {
printf("Error: PUBG Mobile process not found.\n");
return 1;
}
// Get the base address of libUE4.so module
unsigned long long base_address = get_module_address(pid, "libUE4.so");
if (base_address == 0) {
printf("Error: libUE4.so module not found in PUBG Mobile process.\n");
return 1;
}
// Modify memory to change the normal view into iPad view
float new_value = 240.0;
off_t offset = 0x3EF90E4;
ssize_t write_result = write_memory(pid, base_address + offset, &new_value, sizeof(float));
if (write_result == -1) {
printf("Error: Memory modification failed.\n");
return 1;
}
printf("Memory modification successful. PUBG Mobile view changed to iPad view!\n");
return 0;
}
Compile the tool using your preferred compiler, for example:
cc main.c -o main -Wall
This project is licensed under the MIT License.
Feel free to contribute by opening issues or creating pull requests.