#pragma once
#include "../driver/driver_interface_v3.h"


extern DriverInterfaceV3* g_Driver;
extern DWORD g_ApexPid;
extern uintptr_t g_ApexBase;


template<typename T>
inline T Read(uintptr_t address) {
    T value{};
    if (g_Driver && g_ApexPid) {
        g_Driver->ReadMemory(g_ApexPid, address, &value, sizeof(T));
    }
    return value;
}


template<typename T>
inline bool ReadArray(uintptr_t address, T* buffer, size_t count) {
    if (g_Driver && g_ApexPid) {
        return g_Driver->ReadMemory(g_ApexPid, address, buffer, sizeof(T) * count);
    }
    return false;
}
