mirror of
https://github.com/EricPlayZ/EGameTools.git
synced 2025-07-18 17:37:53 +08:00
before trying fs::open hook
This commit is contained in:
@ -1,7 +1,3 @@
|
||||
#include <MinHook.h>
|
||||
#include <Windows.h>
|
||||
#include <iostream>
|
||||
#include <thread>
|
||||
#include "ImGui\impl\d3d11_impl.h"
|
||||
#include "ImGui\impl\d3d12_impl.h"
|
||||
#include "config\config.h"
|
||||
@ -10,6 +6,10 @@
|
||||
#include "kiero.h"
|
||||
#include "menu\menu.h"
|
||||
#include "sigscan\offsets.h"
|
||||
#include <MinHook.h>
|
||||
#include <Windows.h>
|
||||
#include <iostream>
|
||||
#include <thread>
|
||||
|
||||
#pragma region KeyBindOption
|
||||
bool KeyBindOption::wasAnyKeyPressed = false;
|
||||
|
@ -1,6 +1,3 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include "config\config.h"
|
||||
#include "game_classes.h"
|
||||
#include "memory.h"
|
||||
@ -10,6 +7,9 @@
|
||||
#include "print.h"
|
||||
#include "sigscan\offsets.h"
|
||||
#include "utils.h"
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
|
||||
namespace Core {
|
||||
extern void OnPostUpdate();
|
||||
@ -247,20 +247,25 @@ namespace GamePH {
|
||||
}
|
||||
#pragma endregion*/
|
||||
|
||||
/*#pragma region PossibleLoadScrFile
|
||||
#pragma region PossibleLoadScrFile
|
||||
static LPVOID GetPossibleLoadScrFile() {
|
||||
return reinterpret_cast<LPVOID>(reinterpret_cast<DWORD64>(GetModuleHandle("gamedll_ph_x64_rwdi.dll")) + 0x171D830);
|
||||
}
|
||||
static Hook::MHook<LPVOID, DWORD64(*)(char*, const char*, char, DWORD64, DWORD64, DWORD64, char, DWORD64, DWORD64)> PossibleLoadScrFileHook{ &GetPossibleLoadScrFile, &detourPossibleLoadScrFile };
|
||||
|
||||
static DWORD64 detourPossibleLoadScrFile(char* file, const char* a2, char a3, DWORD64 a4, DWORD64 a5, DWORD64 a6, char a7, DWORD64 a8, DWORD64 a9) {
|
||||
std::string_view fileName = std::string_view(file);
|
||||
|
||||
if (!strcmp(file, "jump_parameters.scr")) {
|
||||
char file2[] = "C:\\Users\\EricPlayZ\\Desktop\\jump_parameters.scr";
|
||||
return PossibleLoadScrFileHook.pOriginal(file2, a2, true, a4, a5, a6, a7, a8, a9);
|
||||
char file2[] = "out\\settings\\EGameTools\\jump_parameters.scr";
|
||||
return PossibleLoadScrFileHook.pOriginal(file2, a2, a3, a4, a5, a6, a7, a8, a9);
|
||||
} else if (fileName.contains("default_weather_config.scr")) {
|
||||
char file2[] = "out\\settings\\EGameTools\\jump_parameters.scr";
|
||||
return PossibleLoadScrFileHook.pOriginal(file2, a2, a3, a4, a5, a6, a7, a8, a9);
|
||||
}
|
||||
return PossibleLoadScrFileHook.pOriginal(file, a2, a3, a4, a5, a6, a7, a8, a9);
|
||||
}
|
||||
#pragma endregion*/
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
||||
#pragma region OtherFuncs
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "utils.h"
|
||||
#include <Windows.h>
|
||||
#include <shlobj.h>
|
||||
#include "utils.h"
|
||||
|
||||
namespace Utils {
|
||||
Timer::Timer(long timeMs) : timeToPass(timeMs), timePassed(false) {
|
||||
@ -45,12 +45,19 @@ namespace Utils {
|
||||
}
|
||||
|
||||
std::string_view GetDesktopDir() {
|
||||
char path[MAX_PATH + 1];
|
||||
char path[MAX_PATH + 1]{};
|
||||
if (!SHGetSpecialFolderPathA(HWND_DESKTOP, path, CSIDL_DESKTOP, FALSE))
|
||||
return {};
|
||||
|
||||
return path;
|
||||
}
|
||||
std::string_view GetDocumentsDir() {
|
||||
char path[MAX_PATH + 1]{};
|
||||
if (SHGetFolderPathA(nullptr, CSIDL_MYDOCUMENTS, nullptr, SHGFP_TYPE_CURRENT, path) != S_OK)
|
||||
return {};
|
||||
|
||||
return path;
|
||||
}
|
||||
WindowsVersion GetWindowsVersion() {
|
||||
OSVERSIONINFOEX info{};
|
||||
DWORDLONG dwlConditionMask = 0;
|
||||
|
@ -36,5 +36,6 @@ namespace Utils {
|
||||
extern FARPROC GetProcAddr(std::string_view module, std::string_view funcName);
|
||||
|
||||
extern std::string_view GetDesktopDir();
|
||||
extern std::string_view GetDocumentsDir();
|
||||
extern WindowsVersion GetWindowsVersion();
|
||||
}
|
Reference in New Issue
Block a user