h2-mod/src/client/game/game.hpp

58 lines
831 B
C++
Raw Normal View History

2021-04-20 00:56:11 +02:00
#pragma once
#include "structs.hpp"
2021-09-07 00:40:37 +02:00
#include "launcher/launcher.hpp"
2021-04-20 00:56:11 +02:00
namespace game
{
extern uint64_t base_address;
void load_base_address();
2022-01-28 00:27:53 +01:00
extern std::string mod_folder;
2021-09-07 00:40:37 +02:00
namespace environment
{
launcher::mode get_mode();
launcher::mode get_real_mode();
bool is_sp();
bool is_mp();
bool is_dedi();
void set_mode(launcher::mode mode);
std::string get_string();
}
2021-04-20 00:56:11 +02:00
template <typename T>
class symbol
{
public:
symbol(const size_t address)
: address_(reinterpret_cast<T*>(address))
{
}
T* get() const
{
return reinterpret_cast<T*>((uint64_t)address_ + base_address);
}
operator T* () const
{
return this->get();
}
T* operator->() const
{
return this->get();
}
private:
T* address_;
};
}
uintptr_t operator"" _b(const uintptr_t ptr);
2021-04-20 00:56:11 +02:00
#include "symbols.hpp"