diff options
author | F1F7Y <64418963+F1F7Y@users.noreply.github.com> | 2023-07-07 12:28:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-07 12:28:35 +0200 |
commit | 513705e33f59273c5b463c0da874a0066e8d0589 (patch) | |
tree | 76c66af8d46d0cdd864cefcc2ef9a237a80ddb5b /NorthstarDLL/core/memory.h | |
parent | 043fb83d8febc9d277064d5b24e60832375a110f (diff) | |
download | NorthstarLauncher-513705e33f59273c5b463c0da874a0066e8d0589.tar.gz NorthstarLauncher-513705e33f59273c5b463c0da874a0066e8d0589.zip |
Memory class renaming (#469)
- Renames `MemoryAddress` to `CMemoryAddress`
- Renames `CMemoryAddress::As` to `CMemoryAddress::RCast`
Diffstat (limited to 'NorthstarDLL/core/memory.h')
-rw-r--r-- | NorthstarDLL/core/memory.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/NorthstarDLL/core/memory.h b/NorthstarDLL/core/memory.h index 38c76cb3..db0a38b3 100644 --- a/NorthstarDLL/core/memory.h +++ b/NorthstarDLL/core/memory.h @@ -1,39 +1,39 @@ #pragma once -class MemoryAddress +class CMemoryAddress { public: uintptr_t m_nAddress; public: - MemoryAddress(); - MemoryAddress(const uintptr_t nAddress); - MemoryAddress(const void* pAddress); + CMemoryAddress(); + CMemoryAddress(const uintptr_t nAddress); + CMemoryAddress(const void* pAddress); // operators operator uintptr_t() const; operator void*() const; operator bool() const; - bool operator==(const MemoryAddress& other) const; - bool operator!=(const MemoryAddress& other) const; + bool operator==(const CMemoryAddress& other) const; + bool operator!=(const CMemoryAddress& other) const; bool operator==(const uintptr_t& addr) const; bool operator!=(const uintptr_t& addr) const; - MemoryAddress operator+(const MemoryAddress& other) const; - MemoryAddress operator-(const MemoryAddress& other) const; - MemoryAddress operator+(const uintptr_t& other) const; - MemoryAddress operator-(const uintptr_t& other) const; - MemoryAddress operator*() const; + CMemoryAddress operator+(const CMemoryAddress& other) const; + CMemoryAddress operator-(const CMemoryAddress& other) const; + CMemoryAddress operator+(const uintptr_t& other) const; + CMemoryAddress operator-(const uintptr_t& other) const; + CMemoryAddress operator*() const; - template <typename T> T As() + template <typename T> T RCast() { return reinterpret_cast<T>(m_nAddress); } // traversal - MemoryAddress Offset(const uintptr_t nOffset) const; - MemoryAddress Deref(const int nNumDerefs = 1) const; + CMemoryAddress Offset(const uintptr_t nOffset) const; + CMemoryAddress Deref(const int nNumDerefs = 1) const; // patching void Patch(const uint8_t* pBytes, const size_t nSize); @@ -45,7 +45,7 @@ class MemoryAddress }; // based on https://github.com/Mauler125/r5sdk/blob/master/r5dev/public/include/module.h -class CModule : public MemoryAddress +class CModule : public CMemoryAddress { public: struct ModuleSections_t @@ -84,7 +84,7 @@ class CModule : public MemoryAddress CModule(const HMODULE pModule); CModule(const char* pModuleName); - MemoryAddress GetExport(const char* pExportName); - MemoryAddress FindPattern(const uint8_t* pPattern, const char* pMask); - MemoryAddress FindPattern(const char* pPattern); + CMemoryAddress GetExport(const char* pExportName); + CMemoryAddress FindPattern(const uint8_t* pPattern, const char* pMask); + CMemoryAddress FindPattern(const char* pPattern); }; |