-
Notifications
You must be signed in to change notification settings - Fork 54
zh_write_memory
伏秋洛 edited this page Jun 14, 2023
·
2 revisions
直接梭哈,没什么说的。
#include "process.h"
#include "proc.h"
#include "writer.h"
using namespace hak;
std::string packageName = "bin.mt.plus";
try {
auto pid = hak::find_process(packageName);
std::cout << "pid: " << pid << "\n";
auto process = std::make_shared<hak::process>(pid);
process->set_memory_mode(memory_mode::SYSCALL);
auto writer = hak::memory_writer(process);
pointer address = 0x1234567;
writer.write_i32(address, 777);
} catch (std::exception& e) {
std::cout << "error: " << e.what() << "\n";
}
#include "process.h"
#include "proc.h"
using namespace hak;
std::string packageName = "bin.mt.plus";
try {
auto pid = hak::find_process(packageName);
std::cout << "pid: " << pid << "\n";
auto process = std::make_shared<hak::process>(pid);
process->set_memory_mode(memory_mode::SYSCALL);
pointer address = 0x1234567;
i32 data = 777;
process->write(address, &data, sizeof(data));
} catch (std::exception& e) {
std::cout << "error: " << e.what() << "\n";
}
Only through learning and communication!