t7x/src/client/game/game.cpp

23 lines
394 B
C++
Raw Normal View History

#include <std_include.hpp>
#include "game.hpp"
2022-11-11 11:19:26 -05:00
#include <utils/nt.hpp>
2022-06-02 07:49:43 -04:00
namespace game
{
2022-11-11 11:19:26 -05:00
size_t get_base()
2022-06-02 07:49:43 -04:00
{
2022-11-11 11:19:26 -05:00
static auto base = []
2022-06-02 07:49:43 -04:00
{
2022-11-11 11:19:26 -05:00
const utils::nt::library host{};
if (!host || host == utils::nt::library::get_by_address(get_base))
2022-06-02 07:49:43 -04:00
{
2022-11-11 11:19:26 -05:00
throw std::runtime_error("Invalid host application");
2022-06-02 07:49:43 -04:00
}
2022-10-28 16:16:14 -04:00
2022-11-26 03:07:09 -05:00
return reinterpret_cast<size_t>(host.get_ptr());
2022-11-11 11:19:26 -05:00
}();
return base;
2022-10-28 16:16:14 -04:00
}
2022-06-02 07:49:43 -04:00
}