plugify  1.0.0.0
mem_accessor.hpp
1 #pragma once
2 
3 #include <plugify/mem_addr.hpp>
4 #include <plugify/prot_flag.hpp>
5 #include <plugify_export.h>
6 
7 namespace plugify {
12  class PLUGIFY_API MemAccessor {
13  public:
22  static bool MemCopy(MemAddr dest, MemAddr src, size_t size);
23 
34  static bool SafeMemCopy(MemAddr dest, MemAddr src, size_t size, size_t& written) noexcept;
35 
46  static bool SafeMemRead(MemAddr src, MemAddr dest, size_t size, size_t& read) noexcept;
47 
56  static ProtFlag MemProtect(MemAddr dest, size_t size, ProtFlag newProtection, bool& status);
57  };
58 } // namespace plugify
A class providing various memory access routines.
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_...
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_...
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 ...
static ProtFlag MemProtect(MemAddr dest, size_t size, ProtFlag newProtection, bool &status)
Defines a memory protection set/unset routine that may fail ungracefully.
A wrapper class for memory addresses, providing utility functions for pointer manipulation.
Definition: mem_addr.hpp:11