mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2026-04-09 17:26:14 +00:00
- fix launcher pinning a thread
- add fall back lua state listener
This commit is contained in:
@@ -16,13 +16,14 @@ class BeamNG {
|
||||
static void SendIPC(const std::string& Data);
|
||||
|
||||
private:
|
||||
static inline std::unique_ptr<Hook<def::GEUpdate>> TickCountDetour;
|
||||
static inline std::unique_ptr<Hook<def::update_function>> UpdateDetour;
|
||||
static inline std::unique_ptr<Hook<def::lua_open_jit>> OpenJITDetour;
|
||||
static inline std::unique_ptr<IPC> IPCFromLauncher;
|
||||
static inline std::unique_ptr<IPC> IPCToLauncher;
|
||||
static inline uint64_t GameBaseAddr;
|
||||
static inline uint64_t DllBaseAddr;
|
||||
static int lua_open_jit_D(lua_State* State);
|
||||
static uint64_t update_D(lua_State* State);
|
||||
static void RegisterGEFunctions();
|
||||
// static int GetTickCount_D(void* GEState, void* Param2, void* Param3, void*
|
||||
// Param4);
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace def {
|
||||
void* Param4);
|
||||
typedef uint32_t (*GetTickCount)();
|
||||
typedef int (*lua_open_jit)(lua_State* L);
|
||||
typedef uint64_t (*update_function)(lua_State* L);
|
||||
typedef void (*lua_get_field)(lua_State* L, int idx, const char* k);
|
||||
typedef const char* (*lua_push_fstring)(lua_State* L, const char* fmt, ...);
|
||||
typedef int (*lua_p_call)(lua_State* L, int arg, int res, int err);
|
||||
|
||||
@@ -13,6 +13,7 @@ class GELua {
|
||||
static inline def::lua_settop lua_settop;
|
||||
static inline def::GetTickCount GetTickCount;
|
||||
static inline def::lua_open_jit lua_open_jit;
|
||||
static inline def::update_function update_function;
|
||||
static inline def::lua_push_fstring lua_push_fstring;
|
||||
static inline def::lua_get_field lua_get_field;
|
||||
static inline def::lua_p_call lua_p_call;
|
||||
|
||||
@@ -14,6 +14,7 @@ class Memory {
|
||||
static uint32_t GetLauncherPID(const std::set<uint32_t>& BL);
|
||||
static uint64_t GetModuleBase(const char* Name);
|
||||
static void Print(const std::string& msg);
|
||||
static std::string GetHex(uint64_t num);
|
||||
static void Inject(uint32_t PID);
|
||||
static uint32_t GetTickCount();
|
||||
static uint32_t EntryPoint();
|
||||
|
||||
@@ -64,4 +64,8 @@ namespace Patterns {
|
||||
const char* lua_settop[2]{
|
||||
"\x4c\x8b\xc1\x85\xd2\x7e\x00\x48\x8b\x41\x00\x48\x8b\x49",
|
||||
"xxxxxx?xxx?xxx"};
|
||||
const char* update_function[2] {
|
||||
"\x48\x89\x4c\x24\x00\x48\x83\xec\x00\xba\x00\x00\x00\x00\xe8\x00\x00\x00\x00\x48\x8b\x48",
|
||||
"xxxx?xxx?x????x????xxx"
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user