Added scrValue (#116)

This commit is contained in:
Forever Gone 2023-06-10 05:39:23 -04:00 committed by GitHub
parent 22b0242869
commit 14adf08cac
3 changed files with 28 additions and 7 deletions

19
rage/scrValue.hpp Normal file
View File

@ -0,0 +1,19 @@
#pragma once
#include <cstdint>
using LPCSTR = const char*; //For Linux support, but I didn't want to make the class inaccurate
namespace rage
{
union scrValue
{
int Int;
unsigned int Uns;
float Float;
LPCSTR String;
scrValue* Reference;
uint64_t Any;
bool operator==(const scrValue& val) {
return Int == val.Int;
}
};
}

View File

@ -2,6 +2,7 @@
#include <cstdint>
#include "../base/pgBase.hpp"
#include "../rage/scrValue.hpp"
#pragma pack(push, 1)
namespace rage
@ -16,9 +17,9 @@ namespace rage
std::uint32_t m_local_count; // 0x24
std::uint32_t m_global_count; // 0x28
std::uint32_t m_native_count; // 0x2C
void *m_local_data; // 0x30
std::int64_t **m_global_data; // 0x38
void **m_native_entrypoints; // 0x40
scrValue *m_local_data; // 0x30
scrValue **m_global_data; // 0x38
scrNativeHandler *m_native_entrypoints; // 0x40
std::uint32_t m_proc_count; // 0x48
char pad_004C[4]; // 0x4C
const char** m_proc_names; // 0x50
@ -84,7 +85,7 @@ namespace rage
return nullptr;
}
void** get_address_of_native_entrypoint(void* entrypoint)
scrNativeHandler* get_address_of_native_entrypoint(scrNativeHandler entrypoint)
{
for (std::uint32_t i = 0; i < m_native_count; ++i)
{

View File

@ -2,6 +2,7 @@
#include "scriptHandler.hpp"
#include "scriptHandlerNetComponent.hpp"
#include "scrThreadContext.hpp"
#include "../rage/scrValue.hpp"
namespace rage
{
@ -16,7 +17,7 @@ namespace rage
public:
scrThreadContext m_context; // 0x08
void* m_stack; // 0xB0
scrValue* m_stack; // 0xB0
char m_padding[0x4]; // 0xB8
uint32_t m_arg_size; // 0xBC
uint32_t m_arg_loc; // 0xC0