Add option to use global import hook instead of MinHook for OpenProcess (#860)

This commit is contained in:
kizer 2022-05-31 00:54:29 +09:00 committed by GitHub
parent d1e69ed6fd
commit c5f84eb27d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 775 additions and 165 deletions

View file

@ -3,8 +3,23 @@
#include "utils.h"
namespace bootconfig {
inline bool is_wait_messagebox() {
return utils::get_env<bool>(L"DALAMUD_WAIT_MESSAGEBOX");
enum WaitMessageboxFlags : int {
None = 0,
BeforeInitialize = 1 << 0,
BeforeDalamudEntrypoint = 1 << 1,
};
inline WaitMessageboxFlags wait_messagebox() {
return static_cast<WaitMessageboxFlags>(utils::get_env<int>(L"DALAMUD_WAIT_MESSAGEBOX"));
}
enum DotNetOpenProcessHookMode : int {
ImportHooks = 0,
DirectHook = 1,
};
inline DotNetOpenProcessHookMode dotnet_openprocess_hook_mode() {
return static_cast<DotNetOpenProcessHookMode>(utils::get_env<int>(L"DALAMUD_DOTNET_OPENPROCESS_HOOKMODE"));
}
inline bool is_show_console() {
@ -20,6 +35,18 @@ namespace bootconfig {
}
inline bool is_veh_full() {
return utils::get_env<bool>("DALAMUD_IS_VEH_FULL");
return utils::get_env<bool>(L"DALAMUD_IS_VEH_FULL");
}
inline bool gamefix_is_enabled(const wchar_t* name) {
static const auto list = utils::get_env_list<std::wstring>(L"DALAMUD_GAMEFIX_LIST");
for (const auto& item : list)
if (item == name)
return true;
return false;
}
inline std::vector<std::wstring> gamefix_unhookdll_list() {
return utils::get_env_list<std::wstring>(L"DALAMUD_UNHOOK_DLLS");
}
}