cmake lists

This commit is contained in:
rjindael 2023-07-26 21:15:28 -07:00
parent c7119b6796
commit 4fe99822c0
No known key found for this signature in database
GPG Key ID: D069369C906CCF31
4 changed files with 72 additions and 6 deletions

View File

@ -3,4 +3,6 @@ cmake_minimum_required(VERSION 3.4)
project(Kiseki.Patcher VERSION 1.0.0) project(Kiseki.Patcher VERSION 1.0.0)
option(COMPILE_PLAYER "Include player-specific code" OFF) option(COMPILE_PLAYER "Include player-specific code" OFF)
option(COMPILE_SERVER "Include server-specific code" OFF) option(COMPILE_SERVER "Include server-specific code" OFF)
add_subdirectory(Kiseki.Patcher)

View File

@ -0,0 +1,51 @@
list(APPEND SOURCE
Source/main.cpp
Source/Patcher.cpp
Source/Helpers.cpp
Source/Hooks/Crypt.cpp
Source/Hooks/Http.cpp
)
list(APPEND HEADER
Header/Patcher.hpp
Header/Helpers.hpp
Header/Hooks/Crypt.hpp
Header/Hooks/Http.hpp
Resource/Information.h
Resource/Script.h
)
if(COMPILE_PLAYER)
list(APPEND SOURCE
Source/Discord.cpp
Source/Hooks/CRoblox.cpp
)
list(APPEND HEADER
Header/Discord.cpp
Header/Hooks/CRoblox.hpp
)
endif()
if(COMPILE_SERVER)
list(APPEND SOURCE
Source/Server.cpp
Source/Hooks/DataModel.cpp
Source/Hooks/ServerReplicator.cpp
Source/Hooks/StandardOut.cpp
)
list(APPEND HEADER
Header/Server.cpp
Header/Hooks/DataModel.cpp
Header/Hooks/ServerReplicator.cpp
Header/Hooks/StandardOut.cpp
)
endif()
add_library(Kiseki.Patcher ${SOURCE} ${HEADER})

View File

@ -1,3 +1,5 @@
#if defined(PLAYER) || defined(SERVER)
#pragma once #pragma once
#include <curl/curl.h> #include <curl/curl.h>
@ -43,5 +45,9 @@ void __fastcall CRobloxCommandLineInfo__ParseParam_hook(CRobloxCommandLineInfo*
extern CRobloxApp__InitInstance_t CRobloxApp__InitInstance; extern CRobloxApp__InitInstance_t CRobloxApp__InitInstance;
extern CRobloxCommandLineInfo__ParseParam_t CRobloxCommandLineInfo__ParseParam; extern CRobloxCommandLineInfo__ParseParam_t CRobloxCommandLineInfo__ParseParam;
#ifdef SERVER
extern std::wstring jobId; extern std::wstring jobId;
extern bool hasJobId; extern bool hasJobId;
#endif
#endif

View File

@ -1,3 +1,5 @@
#if defined(PLAYER) || defined(SERVER)
#include "Hooks/CRoblox.hpp" #include "Hooks/CRoblox.hpp"
#ifdef SERVER #ifdef SERVER
@ -7,12 +9,15 @@
bool hasAuthenticationUrl = false; bool hasAuthenticationUrl = false;
bool hasAuthenticationTicket = false; bool hasAuthenticationTicket = false;
bool hasJoinScriptUrl = false; bool hasJoinScriptUrl = false;
bool hasJobId = false;
std::wstring authenticationUrl; std::wstring authenticationUrl;
std::wstring authenticationTicket; std::wstring authenticationTicket;
std::wstring joinScriptUrl; std::wstring joinScriptUrl;
#ifdef SERVER
bool hasJobId = false;
std::wstring jobId; std::wstring jobId;
#endif
CRobloxApp__InitInstance_t CRobloxApp__InitInstance = (CRobloxApp__InitInstance_t)ADDRESS_CROBLOXAPP__INITINSTANCE; CRobloxApp__InitInstance_t CRobloxApp__InitInstance = (CRobloxApp__InitInstance_t)ADDRESS_CROBLOXAPP__INITINSTANCE;
CRobloxCommandLineInfo__ParseParam_t CRobloxCommandLineInfo__ParseParam = (CRobloxCommandLineInfo__ParseParam_t)ADDRESS_CROBLOXCOMMANDLINEINFO__PARSEPARAM; CRobloxCommandLineInfo__ParseParam_t CRobloxCommandLineInfo__ParseParam = (CRobloxCommandLineInfo__ParseParam_t)ADDRESS_CROBLOXCOMMANDLINEINFO__PARSEPARAM;
@ -44,14 +49,14 @@ BOOL __fastcall CRobloxApp__InitInstance_hook(CRobloxApp* _this)
} }
} }
#ifdef PLAYER #ifdef SERVER
if (!hasAuthenticationUrl || !hasAuthenticationTicket || !hasJoinScriptUrl) if (!hasAuthenticationUrl || !hasAuthenticationTicket || !hasJoinScriptUrl)
{ {
return FALSE; return FALSE;
} }
#endif #endif
#ifdef SERVER #ifdef PLAYER
if (!hasAuthenticationUrl || !hasAuthenticationTicket || !hasJoinScriptUrl || !hasJobId) if (!hasAuthenticationUrl || !hasAuthenticationTicket || !hasJoinScriptUrl || !hasJobId)
{ {
ShellExecute(0, 0, L"https://kiseki.lol/games", 0, 0, SW_SHOW); ShellExecute(0, 0, L"https://kiseki.lol/games", 0, 0, SW_SHOW);
@ -145,4 +150,6 @@ void __fastcall CRobloxCommandLineInfo__ParseParam_hook(CRobloxCommandLineInfo*
#endif #endif
CRobloxCommandLineInfo__ParseParam(_this, pszParam, bFlag, bLast); CRobloxCommandLineInfo__ParseParam(_this, pszParam, bFlag, bLast);
} }
#endif