Skip to content

en_read_memory

伏秋洛 edited this page Jun 17, 2023 · 2 revisions

Preface

Reading memory is a normal and necessary operation, otherwise this project is meaningless. This project provides three ways to read/write memory, including 1, directly operating after injection. 2, operating the /proc/pid/mem file. 3, using syscall.

Plan

Provide kernel model block external memory operation interface to avoid detection (Gu Gu Gu). If necessary, please provide an issue reminder.

Example

Using Reader

#include "process.h"
#include "reader.h"

using namespace hak;

pid_t pid = 123456;
auto process = std::make_shared<hak::process>(pid);
process->set_memory_mode(memory_mode::SYSCALL); // set mode
auto reader = hak::memory_reader(process);

Simple reading method

#include "process.h"

using namespace hak;

pid_t pid = 123456;
auto process = std::make_shared<hak::process>(pid);
process->set_memory_mode(memory_mode::SYSCALL); // set mode

int data;
pointer address = 0x1234567;
process->read(address, &data, sizeof(data));