plugify
1.0.0.0
|
A wrapper class for memory addresses, providing utility functions for pointer manipulation. More...
#include <mem_addr.hpp>
Public Member Functions | |
MemAddr () noexcept | |
Default constructor initializing the pointer to 0. | |
MemAddr (uintptr_t ptr) noexcept | |
Constructor initializing the pointer with a uintptr_t value. More... | |
template<typename T > | |
requires (std::is_pointer_v< T > or std::is_null_pointer_v< T >) MemAddr(T ptr) noexcept | |
Template constructor initializing the pointer with a typed pointer. More... | |
operator uintptr_t () const noexcept | |
Converts the MemAddr object to a uintptr_t. More... | |
operator void * () const noexcept | |
Converts the MemAddr object to a void pointer. More... | |
operator bool () const noexcept | |
Explicit conversion operator to bool, indicating if the pointer is non-zero. More... | |
bool | operator!= (const MemAddr &addr) const noexcept |
Inequality operator. More... | |
bool | operator== (const MemAddr &addr) const noexcept |
Equality operator. More... | |
bool | operator== (const uintptr_t &addr) const noexcept |
Equality operator for comparing with uintptr_t. More... | |
uintptr_t | GetPtr () const noexcept |
Returns the uintptr_t representation of the pointer. More... | |
template<class T > | |
T | GetValue () const noexcept |
Retrieves the value at the memory address. More... | |
template<typename T > | |
T | CCast () const noexcept |
Casts the pointer to a specified type using C-style cast. More... | |
template<typename T > | |
T | RCast () const noexcept |
Casts the pointer to a specified type using reinterpret_cast. More... | |
template<typename T > | |
T | UCast () const noexcept |
Casts the pointer to a specified type using a union cast. More... | |
MemAddr | Offset (ptrdiff_t offset) const noexcept |
Offsets the memory address by a specified amount. More... | |
MemAddr & | OffsetSelf (ptrdiff_t offset) noexcept |
Offsets the memory address by a specified amount in-place. More... | |
MemAddr | Deref (ptrdiff_t deref=1) const |
Dereferences the memory address a specified number of times. More... | |
MemAddr & | DerefSelf (ptrdiff_t deref=1) |
Dereferences the memory address a specified number of times in-place. More... | |
MemAddr | FollowNearCall (ptrdiff_t opcodeOffset=0x1, ptrdiff_t nextInstructionOffset=0x5) const |
Follows a near call to resolve the address. More... | |
MemAddr & | FollowNearCallSelf (ptrdiff_t opcodeOffset=0x1, ptrdiff_t nextInstructionOffset=0x5) |
Follows a near call to resolve the address in-place. More... | |
MemAddr | ResolveRelativeAddress (ptrdiff_t registerOffset=0x0, ptrdiff_t nextInstructionOffset=0x4) const |
Resolves a relative address. More... | |
MemAddr & | ResolveRelativeAddressSelf (ptrdiff_t registerOffset=0x0, ptrdiff_t nextInstructionOffset=0x4) |
Resolves a relative address in-place. More... | |
A wrapper class for memory addresses, providing utility functions for pointer manipulation.
Definition at line 11 of file mem_addr.hpp.
|
inlinenoexcept |
Constructor initializing the pointer with a uintptr_t value.
ptr | The uintptr_t value to initialize the pointer with. |
Definition at line 22 of file mem_addr.hpp.
|
inlinenoexcept |
Casts the pointer to a specified type using C-style cast.
T | The type to cast to. |
Definition at line 107 of file mem_addr.hpp.
|
inline |
Dereferences the memory address a specified number of times.
deref | The number of times to dereference. |
Definition at line 159 of file mem_addr.hpp.
|
inline |
Dereferences the memory address a specified number of times in-place.
deref | The number of times to dereference. |
Definition at line 175 of file mem_addr.hpp.
|
inline |
Follows a near call to resolve the address.
opcodeOffset | The offset to the opcode. |
nextInstructionOffset | The offset to the next instruction. |
Definition at line 190 of file mem_addr.hpp.
|
inline |
Follows a near call to resolve the address in-place.
opcodeOffset | The offset to the opcode. |
nextInstructionOffset | The offset to the next instruction. |
Definition at line 200 of file mem_addr.hpp.
|
inlinenoexcept |
Returns the uintptr_t representation of the pointer.
Definition at line 87 of file mem_addr.hpp.
|
inlinenoexcept |
Retrieves the value at the memory address.
T | The type of the value. |
Definition at line 97 of file mem_addr.hpp.
|
inlinenoexcept |
Offsets the memory address by a specified amount.
offset | The offset value. |
Definition at line 140 of file mem_addr.hpp.
|
inlinenoexcept |
Offsets the memory address by a specified amount in-place.
offset | The offset value. |
Definition at line 149 of file mem_addr.hpp.
|
inlineexplicitnoexcept |
Explicit conversion operator to bool, indicating if the pointer is non-zero.
Definition at line 52 of file mem_addr.hpp.
|
inlinenoexcept |
Converts the MemAddr object to a uintptr_t.
Definition at line 36 of file mem_addr.hpp.
|
inlinenoexcept |
Converts the MemAddr object to a void pointer.
Definition at line 44 of file mem_addr.hpp.
|
inlinenoexcept |
Inequality operator.
addr | The MemAddr object to compare with. |
Definition at line 61 of file mem_addr.hpp.
|
inlinenoexcept |
Equality operator.
addr | The MemAddr object to compare with. |
Definition at line 70 of file mem_addr.hpp.
|
inlinenoexcept |
Equality operator for comparing with uintptr_t.
addr | The uintptr_t value to compare with. |
Definition at line 79 of file mem_addr.hpp.
|
inlinenoexcept |
Casts the pointer to a specified type using reinterpret_cast.
T | The type to cast to. |
Definition at line 117 of file mem_addr.hpp.
|
inlinenoexcept |
Template constructor initializing the pointer with a typed pointer.
T | The type of the pointer. |
ptr | The typed pointer to initialize with. |
Definition at line 29 of file mem_addr.hpp.
|
inline |
Resolves a relative address.
registerOffset | The offset to the register. |
nextInstructionOffset | The offset to the next instruction. |
Definition at line 210 of file mem_addr.hpp.
|
inline |
Resolves a relative address in-place.
registerOffset | The offset to the register. |
nextInstructionOffset | The offset to the next instruction. |
Definition at line 223 of file mem_addr.hpp.
|
inlinenoexcept |
Casts the pointer to a specified type using a union cast.
T | The type to cast to. |
Definition at line 127 of file mem_addr.hpp.