rs-process-memory icon indicating copy to clipboard operation
rs-process-memory copied to clipboard

Expose rs-process-memory as a simple cdylib

Open Crain-32 opened this issue 3 years ago • 0 comments

Currently there are no good libraries for Read/Write actions against Processes that is cross platform (I'd love to be wrong about this), it would be great to expose parts of this library for use by external programs. I figure the main 4-5 functions would be something like the following. Subject to change if you want the library to support hooking only into one PID at a time, or multiple.

get_process_handle_from_pid(pid) -> ProcessHandle - Assume the calling application can find the target PID. free_process_handle(process_handle) - Let Rust handle freeing the process handle. read_process(process_handle, address, size, *mut buffer) - Read Process's Memory at address into a provided buffer We assume the buffer is properly sized to size write_process(process_handle, address, size, *mut buffer) - Same a read_process, but writing instead. Potentially return a Boolean? get_last_error() -> str - Having Rust blowing up the calling thread is a bit frustrating for the other application, so it would be nice to cache the error.

Regarding it being a cdylib vs dylib, it would fit my use case the best.

Crain-32 avatar Dec 11 '22 01:12 Crain-32