plugify
1.0.0.0
|
A class to manage memory protection settings. More...
#include <mem_protector.hpp>
Public Member Functions | |
MemProtector ()=delete | |
MemProtector (MemAddr address, size_t length, ProtFlag prot, bool unsetOnDestroy=true) | |
Constructs a MemProtector object to set memory protection. More... | |
~MemProtector () | |
Destructor to restore the original protection settings if required. | |
ProtFlag | OriginalProt () const noexcept |
Gets the original protection settings. More... | |
bool | IsValid () const noexcept |
Checks if the memory protection was successfully set. More... | |
A class to manage memory protection settings.
This class allows setting and unsetting memory protection for a given memory region. It ensures that the original protection settings are restored when the object is destroyed.
Definition at line 17 of file mem_protector.hpp.
|
delete |
Deleted default constructor.
plugify::MemProtector::MemProtector | ( | MemAddr | address, |
size_t | length, | ||
ProtFlag | prot, | ||
bool | unsetOnDestroy = true |
||
) |
Constructs a MemProtector object to set memory protection.
address | The memory address to protect. |
length | The length of the memory region to protect. |
prot | The protection flags to set. |
unsetOnDestroy | If true, the original protection settings will be restored when the object is destroyed. |
|
inlinenoexcept |
Checks if the memory protection was successfully set.
Definition at line 48 of file mem_protector.hpp.
|
inlinenoexcept |
Gets the original protection settings.
Definition at line 41 of file mem_protector.hpp.