plugify 1.2.6
|
A wrapper class for memory addresses, providing utility functions for pointer manipulation. More...
#include <mem_addr.hpp>
Public Member Functions | |
constexpr | MemAddr () noexcept |
Default constructor initializing the pointer to 0. | |
constexpr | MemAddr (const uintptr_t ptr) noexcept |
Constructor initializing the pointer with a uintptr_t value. | |
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. | |
constexpr | MemAddr (const MemAddr &other) noexcept=default |
Constructor initializing the pointer with a void pointer. | |
constexpr | MemAddr (MemAddr &&other) noexcept=default |
Move constructor initializing the pointer with another MemAddr. | |
constexpr MemAddr & | operator= (const MemAddr &other) noexcept=default |
Assignment operator to copy another MemAddr. | |
constexpr MemAddr & | operator= (MemAddr &&other) noexcept=default |
Move assignment operator to move another MemAddr. | |
constexpr | operator uintptr_t () const noexcept |
Converts the MemAddr object to a uintptr_t. | |
constexpr | operator void * () const noexcept |
Converts the MemAddr object to a void pointer. | |
constexpr | operator bool () const noexcept |
Explicit conversion operator to bool, indicating if the pointer is non-zero. | |
constexpr bool | operator!= (const MemAddr addr) const noexcept |
Inequality operator. | |
constexpr bool | operator< (const MemAddr addr) const noexcept |
Less-than comparison operator. | |
constexpr bool | operator== (const MemAddr addr) const noexcept |
Equality operator. | |
constexpr bool | operator== (const uintptr_t addr) const noexcept |
Equality operator for comparing with uintptr_t. | |
constexpr uintptr_t | GetPtr () const noexcept |
Returns the uintptr_t representation of the pointer. | |
template<class T > | |
constexpr T | GetValue () const noexcept |
Retrieves the value at the memory address. | |
template<typename T > | |
constexpr T | CCast () const noexcept |
Casts the pointer to a specified type using C-style cast. | |
template<typename T > | |
constexpr T | RCast () const noexcept |
Casts the pointer to a specified type using reinterpret_cast. | |
template<typename T > | |
constexpr T | UCast () const noexcept |
Casts the pointer to a specified type using a union cast. | |
constexpr MemAddr | Offset (const ptrdiff_t offset) const noexcept |
Offsets the memory address by a specified amount. | |
constexpr MemAddr & | OffsetSelf (const ptrdiff_t offset) noexcept |
Offsets the memory address by a specified amount in-place. | |
constexpr MemAddr | Deref (ptrdiff_t deref=1) const |
Dereferences the memory address a specified number of times. | |
constexpr MemAddr & | DerefSelf (ptrdiff_t deref=1) |
Dereferences the memory address a specified number of times in-place. | |
MemAddr | FollowNearCall (const ptrdiff_t opcodeOffset=0x1, const ptrdiff_t nextInstructionOffset=0x5) const |
Follows a near call to resolve the address. | |
MemAddr & | FollowNearCallSelf (const ptrdiff_t opcodeOffset=0x1, const ptrdiff_t nextInstructionOffset=0x5) |
Follows a near call to resolve the address in-place. | |
MemAddr | ResolveRelativeAddress (const ptrdiff_t registerOffset=0x0, const ptrdiff_t nextInstructionOffset=0x4) const |
Resolves a relative address. | |
MemAddr & | ResolveRelativeAddressSelf (const ptrdiff_t registerOffset=0x0, const ptrdiff_t nextInstructionOffset=0x4) |
Resolves a relative address in-place. | |
A wrapper class for memory addresses, providing utility functions for pointer manipulation.
Definition at line 10 of file mem_addr.hpp.
|
inlineconstexprnoexcept |
Default constructor initializing the pointer to 0.
Definition at line 15 of file mem_addr.hpp.
|
inlineconstexprnoexcept |
Constructor initializing the pointer with a uintptr_t value.
ptr | The uintptr_t value to initialize the pointer with. |
Definition at line 21 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.
|
constexprdefaultnoexcept |
Constructor initializing the pointer with a void pointer.
other | The void pointer to initialize with. |
|
constexprdefaultnoexcept |
|
inlineconstexprnoexcept |
Casts the pointer to a specified type using C-style cast.
T | The type to cast to. |
Definition at line 141 of file mem_addr.hpp.
|
inlineconstexpr |
Dereferences the memory address a specified number of times.
deref | The number of times to dereference. |
Definition at line 193 of file mem_addr.hpp.
|
inlineconstexpr |
Dereferences the memory address a specified number of times in-place.
deref | The number of times to dereference. |
Definition at line 209 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 224 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 234 of file mem_addr.hpp.
|
inlineconstexprnoexcept |
Returns the uintptr_t representation of the pointer.
Definition at line 121 of file mem_addr.hpp.
|
inlineconstexprnoexcept |
Retrieves the value at the memory address.
T | The type of the value. |
Definition at line 131 of file mem_addr.hpp.
|
inlineconstexprnoexcept |
Offsets the memory address by a specified amount.
offset | The offset value. |
Definition at line 174 of file mem_addr.hpp.
|
inlineconstexprnoexcept |
Offsets the memory address by a specified amount in-place.
offset | The offset value. |
Definition at line 183 of file mem_addr.hpp.
|
inlineexplicitconstexprnoexcept |
Explicit conversion operator to bool, indicating if the pointer is non-zero.
Definition at line 77 of file mem_addr.hpp.
|
inlineconstexprnoexcept |
Converts the MemAddr object to a uintptr_t.
Definition at line 61 of file mem_addr.hpp.
|
inlineconstexprnoexcept |
Converts the MemAddr object to a void pointer.
Definition at line 69 of file mem_addr.hpp.
|
inlineconstexprnoexcept |
Inequality operator.
addr | The MemAddr object to compare with. |
Definition at line 86 of file mem_addr.hpp.
|
inlineconstexprnoexcept |
Less-than comparison operator.
addr | The MemAddr object to compare with. |
Definition at line 95 of file mem_addr.hpp.
|
inlineconstexprnoexcept |
Equality operator.
addr | The MemAddr object to compare with. |
Definition at line 104 of file mem_addr.hpp.
|
inlineconstexprnoexcept |
Equality operator for comparing with uintptr_t.
addr | The uintptr_t value to compare with. |
Definition at line 113 of file mem_addr.hpp.
|
inlineconstexprnoexcept |
Casts the pointer to a specified type using reinterpret_cast.
T | The type to cast to. |
Definition at line 151 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 244 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 257 of file mem_addr.hpp.
|
inlineconstexprnoexcept |
Casts the pointer to a specified type using a union cast.
T | The type to cast to. |
Definition at line 161 of file mem_addr.hpp.
void* plugify::MemAddr::_addr |
Definition at line 267 of file mem_addr.hpp.
uintptr_t plugify::MemAddr::_ptr |
Definition at line 268 of file mem_addr.hpp.