feat/bug: finalize everything and squash bugs

This commit is contained in:
rjindael 2023-07-27 00:20:50 -07:00
parent 862e97bdea
commit 4c6d3a6418
No known key found for this signature in database
GPG Key ID: D069369C906CCF31
6 changed files with 18 additions and 4 deletions

View File

@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.4) cmake_minimum_required(VERSION 3.4)
set(CMAKE_CXX_STANDARD 17)
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)

View File

@ -48,7 +48,7 @@ if(COMPILE_SERVER)
) )
endif() endif()
add_library(Kiseki.Patcher ${SOURCE} ${HEADER}) add_library(Kiseki.Patcher SHARED ${SOURCE} ${HEADER})
# Packages # Packages
find_package(CURL CONFIG REQUIRED) find_package(CURL CONFIG REQUIRED)
@ -59,10 +59,15 @@ find_package(RapidJSON CONFIG REQUIRED)
find_path(DETOURS_INCLUDE_DIRS "detours/detours.h") find_path(DETOURS_INCLUDE_DIRS "detours/detours.h")
find_library(DETOURS_LIBRARY detours REQUIRED) find_library(DETOURS_LIBRARY detours REQUIRED)
find_path(DISCORD_RPC_INCLUDE_DIRS "discord_rpc.h")
find_library(DISCORD_RPC_LIBRARY discord-rpc REQUIRED)
target_include_directories(Kiseki.Patcher PRIVATE Header ${DETOURS_INCLUDE_DIRS}) target_include_directories(Kiseki.Patcher PRIVATE Header ${DETOURS_INCLUDE_DIRS})
target_link_libraries(Kiseki.Patcher PRIVATE CURL::libcurl ${DETOURS_LIBRARY} OpenSSL::SSL OpenSSL::Crypto pugixml::shared pugixml::pugixml rapidjson) target_link_libraries(Kiseki.Patcher PRIVATE CURL::libcurl ${DETOURS_LIBRARY} OpenSSL::SSL OpenSSL::Crypto pugixml::static pugixml::pugixml rapidjson)
if(COMPILE_PLAYER) if(COMPILE_PLAYER)
target_include_directories(Kiseki.Patcher PRIVATE ${DISCORD_RPC_INCLUDE_DIRS})
target_link_libraries(Kiseki.Patcher PRIVATE ${DISCORD_RPC_LIBRARY})
target_compile_definitions(Kiseki.Patcher PRIVATE PLAYER) target_compile_definitions(Kiseki.Patcher PRIVATE PLAYER)
endif() endif()

View File

@ -1,6 +1,9 @@
#pragma once #pragma once
#include <algorithm>
#include <string> #include <string>
#include <string_view>
#include <sstream>
#include <vector> #include <vector>
#include <map> #include <map>

View File

@ -1,7 +1,8 @@
#pragma once #pragma once
#include <string> #include <stdexcept>
#include <windows.h>
#include <wincrypt.h> #include <wincrypt.h>
#include "Globals.hpp" #include "Globals.hpp"

View File

@ -3,6 +3,7 @@
#include <vector> #include <vector>
#include <utility> #include <utility>
#include <windows.h>
#include <detours/detours.h> #include <detours/detours.h>
namespace Patcher namespace Patcher

View File

@ -29,8 +29,10 @@ ADD_PATCH(Http__trustCheck, Http__trustCheck_hook)
ADD_PATCH(Crypt__verifySignatureBase64, Crypt__verifySignatureBase64_hook) ADD_PATCH(Crypt__verifySignatureBase64, Crypt__verifySignatureBase64_hook)
#if defined(PLAYER) or defined(SERVER)
ADD_PATCH(CRobloxApp__InitInstance, CRobloxApp__InitInstance_hook) ADD_PATCH(CRobloxApp__InitInstance, CRobloxApp__InitInstance_hook)
ADD_PATCH(CRobloxCommandLineInfo__ParseParam, CRobloxCommandLineInfo__ParseParam_hook) ADD_PATCH(CRobloxCommandLineInfo__ParseParam, CRobloxCommandLineInfo__ParseParam_hook)
#endif
#ifdef SERVER #ifdef SERVER
ADD_PATCH(DataModel__getJobId, DataModel__getJobId_hook) ADD_PATCH(DataModel__getJobId, DataModel__getJobId_hook)
@ -47,7 +49,7 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
{ {
if (ul_reason_for_call == DLL_PROCESS_ATTACH) if (ul_reason_for_call == DLL_PROCESS_ATTACH)
{ {
LONG patchesError = Patches::Apply(); LONG patchesError = Patcher::Apply();
if (patchesError != NO_ERROR) if (patchesError != NO_ERROR)
{ {
#ifdef _DEBUG #ifdef _DEBUG