2022-11-09 05:11:50 +08:00
|
|
|
#pragma once
|
|
|
|
#include "../rage/sysMemAllocator.hpp"
|
|
|
|
#include "scrThread.hpp"
|
|
|
|
|
2022-11-16 07:39:24 +08:00
|
|
|
#if _WIN32
|
|
|
|
#include <intrin.h>
|
|
|
|
#endif
|
|
|
|
|
2022-11-09 05:11:50 +08:00
|
|
|
namespace rage
|
|
|
|
{
|
2022-11-16 07:39:24 +08:00
|
|
|
#pragma pack(push, 1)
|
2022-11-09 05:11:50 +08:00
|
|
|
class tlsContext
|
|
|
|
{
|
|
|
|
public:
|
2022-11-16 07:39:24 +08:00
|
|
|
char gap0[180];
|
|
|
|
std::uint8_t m_unk_byte; // 0xB4
|
|
|
|
char gapB5[3];
|
|
|
|
sysMemAllocator *m_allocator; // 0xB8
|
|
|
|
sysMemAllocator *m_allocator2; // 0xC0 - Same as 0xB8
|
|
|
|
sysMemAllocator *m_allocator3; // 0xC8 - Same as 0xB8
|
|
|
|
uint32_t m_console_smth; // 0xD0
|
|
|
|
char gapD4[188];
|
|
|
|
uint64_t m_unk; // 0x190
|
2024-04-16 22:43:30 +08:00
|
|
|
char gap198[1728];
|
|
|
|
rage::scrThread* m_script_thread; // 0x858
|
|
|
|
bool m_is_script_thread_active; // 0x860
|
2022-11-16 07:39:24 +08:00
|
|
|
|
|
|
|
#if _WIN32
|
|
|
|
static tlsContext* get()
|
|
|
|
{
|
|
|
|
constexpr std::uint32_t TlsIndex = 0x0;
|
|
|
|
return *reinterpret_cast<tlsContext**>(__readgsqword(0x58) + TlsIndex);
|
|
|
|
}
|
|
|
|
#endif
|
2022-11-09 05:11:50 +08:00
|
|
|
};
|
2024-04-16 22:43:30 +08:00
|
|
|
static_assert(sizeof(tlsContext) == 0x861);
|
2022-11-16 07:39:24 +08:00
|
|
|
#pragma pack(pop)
|
2022-11-09 05:11:50 +08:00
|
|
|
}
|