1 个不稳定版本

0.1.0 2023年4月5日

#194Windows API

GPL-3.0-only

17KB
178

WMem

一个基本的Windows内存操作库,旨在为作弊训练器提供支持。

使用示例

获取注入进程的句柄

let handle = Memory::open_current();
/// ...

写入

// Write "Johnny Smith" to the specified address.
let new_name = b"Johnny Smith";
// + 1 to get a null-byte at the end of the slice when writing it.
Memory::write::<[u8; 12]>(handle, address, *new_name, Some(new_name.len() + 1));

// Write 100 to the specified address.
Memory::write::<i32>(handle, address, 100, None);

读取

// `read` returns a `Vec<T>` of the type specified for scenarios where you're reading
// an array of bytes.
// If you're just reading a value like `i32` or similar, grab the first entry and continue.

// Read the name of the entity with 32 characters being set as the max capacity.
let name = String::from_utf8(Memory::read::<u8>(handle, address, Some(32))).unwrap();

// Read the health of the entity.
let health = Memory::read::<i32>(handle, address, None)[0];

依赖项

~240KB