A class providing various memory access routines.
More...
#include <mem_accessor.hpp>
|
static bool | MemCopy (MemAddr dest, MemAddr src, size_t size) |
| Defines a memory read/write routine that may fail ungracefully. It's expected this library will only ever use this routine in cases that are expected to succeed. More...
|
|
static bool | SafeMemCopy (MemAddr dest, MemAddr src, size_t size, size_t &written) noexcept |
| Defines a memory write routine that will not throw exceptions, and can handle potential writes to NO_ACCESS or otherwise inaccessible memory pages. Defaults to WriteProcessMemory. Must fail gracefully. More...
|
|
static bool | SafeMemRead (MemAddr src, MemAddr dest, size_t size, size_t &read) noexcept |
| Defines a memory read routine that will not throw exceptions, and can handle potential reads from NO_ACCESS or otherwise inaccessible memory pages. Defaults to ReadProcessMemory. Must fail gracefully. More...
|
|
static ProtFlag | MemProtect (MemAddr dest, size_t size, ProtFlag newProtection, bool &status) |
| Defines a memory protection set/unset routine that may fail ungracefully. More...
|
|
A class providing various memory access routines.
Definition at line 12 of file mem_accessor.hpp.
◆ MemCopy()
static bool plugify::MemAccessor::MemCopy |
( |
MemAddr |
dest, |
|
|
MemAddr |
src, |
|
|
size_t |
size |
|
) |
| |
|
static |
Defines a memory read/write routine that may fail ungracefully. It's expected this library will only ever use this routine in cases that are expected to succeed.
- Parameters
-
dest | The destination memory address. |
src | The source memory address. |
size | The number of bytes to copy. |
- Returns
- True if the memory copy succeeds, false otherwise.
◆ MemProtect()
static ProtFlag plugify::MemAccessor::MemProtect |
( |
MemAddr |
dest, |
|
|
size_t |
size, |
|
|
ProtFlag |
newProtection, |
|
|
bool & |
status |
|
) |
| |
|
static |
Defines a memory protection set/unset routine that may fail ungracefully.
- Parameters
-
dest | The memory address to change protection for. |
size | The number of bytes to change protection for. |
newProtection | The new protection flags to set. |
status | A reference to a variable that will hold the success status of the operation. |
- Returns
- The previous protection flags if the operation succeeds, otherwise an appropriate error code.
◆ SafeMemCopy()
static bool plugify::MemAccessor::SafeMemCopy |
( |
MemAddr |
dest, |
|
|
MemAddr |
src, |
|
|
size_t |
size, |
|
|
size_t & |
written |
|
) |
| |
|
staticnoexcept |
Defines a memory write routine that will not throw exceptions, and can handle potential writes to NO_ACCESS or otherwise inaccessible memory pages. Defaults to WriteProcessMemory. Must fail gracefully.
- Parameters
-
dest | The destination memory address. |
src | The source memory address. |
size | The number of bytes to copy. |
written | A reference to the variable that will hold the number of bytes successfully written. |
- Returns
- True if the memory copy succeeds, false otherwise.
◆ SafeMemRead()
static bool plugify::MemAccessor::SafeMemRead |
( |
MemAddr |
src, |
|
|
MemAddr |
dest, |
|
|
size_t |
size, |
|
|
size_t & |
read |
|
) |
| |
|
staticnoexcept |
Defines a memory read routine that will not throw exceptions, and can handle potential reads from NO_ACCESS or otherwise inaccessible memory pages. Defaults to ReadProcessMemory. Must fail gracefully.
- Parameters
-
src | The source memory address. |
dest | The destination memory address. |
size | The number of bytes to read. |
read | A reference to the variable that will hold the number of bytes successfully read. |
- Returns
- True if the memory read succeeds, false otherwise.
The documentation for this class was generated from the following file: