diff --git a/include/RED4ext/CNamePool-inl.hpp b/include/RED4ext/CNamePool-inl.hpp index 9e39a552a..5957e8849 100644 --- a/include/RED4ext/CNamePool-inl.hpp +++ b/include/RED4ext/CNamePool-inl.hpp @@ -39,7 +39,7 @@ RED4EXT_INLINE void RED4ext::CNamePool::Add(const CName& aName, const CString& a RED4EXT_INLINE const char* RED4ext::CNamePool::Get(const CName& aName) { - static UniversalRelocFunc func(Detail::AddressHashes::CNamePool_Get); + static UniversalRelocFunc func(Detail::AddressHashes::CNamePool_GetString); auto result = func(aName); if (result) { @@ -57,7 +57,7 @@ RED4EXT_INLINE RED4ext::CNamePool* RED4ext::CNamePool::GetPool() RED4EXT_INLINE RED4ext::CNamePoolNode* RED4ext::CNamePoolNodeInner::Outer() { - return reinterpret_cast(reinterpret_cast(this) - 1); + return reinterpret_cast(reinterpret_cast(this) - offsetof(RED4ext::CNamePoolNode, inner)); } RED4EXT_INLINE RED4ext::CNamePoolNodeInner* RED4ext::CNamePoolNodeInner::NextInList() const @@ -67,17 +67,17 @@ RED4EXT_INLINE RED4ext::CNamePoolNodeInner* RED4ext::CNamePoolNodeInner::NextInL RED4EXT_INLINE RED4ext::CNamePoolNodeInner* RED4ext::CNamePoolNodeInner::NextInHashBin() { - return this->next; + return next; } RED4EXT_INLINE RED4ext::CNamePoolNode* RED4ext::CNamePoolNode::NextInList() const { - return reinterpret_cast(reinterpret_cast(&this->inner) + this->len); + return reinterpret_cast(reinterpret_cast(&inner) + len); } RED4EXT_INLINE RED4ext::CNamePoolNode* RED4ext::CNamePoolNode::NextInHashBin() { - return this->inner.next->Outer(); + return inner.next->Outer(); } RED4EXT_INLINE RED4ext::CNamePoolAllocator::Iterator& RED4ext::CNamePoolAllocator::Iterator::operator++() @@ -122,7 +122,7 @@ RED4EXT_INLINE RED4ext::CNamePoolAllocator::Iterator RED4ext::CNamePoolAllocator RED4EXT_INLINE RED4ext::CNamePoolNodeInner*& RED4ext::CNamePoolHashmap::operator[](const uint64_t aKey) { - return this->nodesByHash[aKey & 0x7ffff]; + return nodesByHash[aKey & 0x7ffff]; } RED4EXT_INLINE RED4ext::CNamePoolHashmap::Iterator RED4ext::CNamePoolHashmap::Begin(const CName& aKey) @@ -147,7 +147,7 @@ RED4EXT_INLINE RED4ext::CNamePoolHashmap::Iterator RED4ext::CNamePoolHashmap::En RED4EXT_INLINE RED4ext::CNamePoolNodeInner*& RED4ext::CNamePoolHashmap::operator[](const CName& aKey) { - return this->nodesByHash[aKey.hash & 0x7ffff]; + return nodesByHash[aKey.hash & 0x7ffff]; } RED4EXT_INLINE RED4ext::CNamePoolHashmap::Iterator& RED4ext::CNamePoolHashmap::Iterator::operator++() diff --git a/include/RED4ext/CNamePool.hpp b/include/RED4ext/CNamePool.hpp index 73415c2f7..94121be1b 100644 --- a/include/RED4ext/CNamePool.hpp +++ b/include/RED4ext/CNamePool.hpp @@ -1,6 +1,6 @@ #pragma once -#include "DynArray.hpp" +#include #include #include @@ -156,28 +156,28 @@ struct CNamePoolAllocator CNamePoolNode* listEnd; // 10 // I believe these three pointers would be used if more space than `head` has available is needed, but the amount // of allocated space is so large that it shouldn't come up - CNamePoolNode* unkNodePtr; // 18 - CNamePoolNode* unkNodePtr2; // 20 - CNamePoolNode* unkNodePtr3; // 28 + CNamePoolNode* unk18; // 18 + CNamePoolNode* unk20; // 20 + CNamePoolNode* unk28; // 28 // potentially padding char unk[8]; // 30 // some kind of memory allocation handler, or something like that - void* unkPtr; // 38 + void* unk38; // 38 // should always be 0x8_0000 - uint32_t unk2; // 40 + uint32_t unk40; // 40 // should always be 3 - uint32_t unk3; // 44 + uint32_t unk44; // 44 }; RED4EXT_ASSERT_OFFSET(CNamePoolAllocator, head, 0x00); RED4EXT_ASSERT_OFFSET(CNamePoolAllocator, endAvailableSpace, 0x08); RED4EXT_ASSERT_OFFSET(CNamePoolAllocator, listEnd, 0x10); -RED4EXT_ASSERT_OFFSET(CNamePoolAllocator, unkNodePtr, 0x18); -RED4EXT_ASSERT_OFFSET(CNamePoolAllocator, unkNodePtr2, 0x20); -RED4EXT_ASSERT_OFFSET(CNamePoolAllocator, unkNodePtr3, 0x28); +RED4EXT_ASSERT_OFFSET(CNamePoolAllocator, unk18, 0x18); +RED4EXT_ASSERT_OFFSET(CNamePoolAllocator, unk20, 0x20); +RED4EXT_ASSERT_OFFSET(CNamePoolAllocator, unk28, 0x28); RED4EXT_ASSERT_OFFSET(CNamePoolAllocator, unk, 0x30); -RED4EXT_ASSERT_OFFSET(CNamePoolAllocator, unkPtr, 0x38); -RED4EXT_ASSERT_OFFSET(CNamePoolAllocator, unk2, 0x40); -RED4EXT_ASSERT_OFFSET(CNamePoolAllocator, unk3, 0x44); +RED4EXT_ASSERT_OFFSET(CNamePoolAllocator, unk38, 0x38); +RED4EXT_ASSERT_OFFSET(CNamePoolAllocator, unk40, 0x40); +RED4EXT_ASSERT_OFFSET(CNamePoolAllocator, unk44, 0x44); RED4EXT_ASSERT_SIZE(CNamePoolAllocator, 0x48); /** @@ -336,7 +336,7 @@ struct CNamePool SharedSpinLock listLock; // 400018 // potentially padding - uint64_t unk2[4]; // 400020 + uint64_t unk400020[4]; // 400020 /// @brief Essentially an allocation arena for `CNamePoolNode`s /// @sa CNamePoolAllocator @@ -346,7 +346,7 @@ RED4EXT_ASSERT_OFFSET(CNamePool, hashmapLock, 0x00); RED4EXT_ASSERT_OFFSET(CNamePool, nodes, 0x08); RED4EXT_ASSERT_OFFSET(CNamePool, hashmap, 0x18); RED4EXT_ASSERT_OFFSET(CNamePool, listLock, 0x400018); -RED4EXT_ASSERT_OFFSET(CNamePool, unk2, 0x400020); +RED4EXT_ASSERT_OFFSET(CNamePool, unk400020, 0x400020); RED4EXT_ASSERT_OFFSET(CNamePool, allocator, 0x400040); RED4EXT_ASSERT_SIZE(CNamePool, 0x400088); diff --git a/include/RED4ext/Detail/AddressHashes.hpp b/include/RED4ext/Detail/AddressHashes.hpp index 4377de8cf..a3744d194 100644 --- a/include/RED4ext/Detail/AddressHashes.hpp +++ b/include/RED4ext/Detail/AddressHashes.hpp @@ -74,8 +74,8 @@ constexpr std::uint32_t CGlobalFunction_ctor = 0xFA6B24D0; constexpr std::uint32_t CNamePool_AddCstr = 0xA00C9B; constexpr std::uint32_t CNamePool_AddCString = 0xFFD61709; constexpr std::uint32_t CNamePool_AddPair = 0xD9840BD8; -constexpr std::uint32_t CNamePool_Get = 0x68DF07DC; -constexpr std::uint32_t CNamePool_GetPool = 0xC5E711D3; +constexpr std::uint32_t CNamePool_GetString = 0x68DF07DC; +constexpr std::uint32_t CNamePool_GetPool = 3320254931; #pragma endregion #pragma region CommandListContext