static void HookMain(void * retAddr) { if(hookInstalled) return; else hookInstalled = true; _MESSAGE("HookMain: thread = %d retaddr = %016I64X", GetCurrentThreadId(), retAddr); std::string runtimePath = GetRuntimePath(); _MESSAGE("runtimePath = %s", runtimePath.c_str()); bool isEditor = false; // check version etc std::string dllSuffix; ProcHookInfo procHookInfo; if(!IdentifyEXE(runtimePath.c_str(), isEditor, &dllSuffix, &procHookInfo)) { _ERROR("unknown exe"); return; } const char * dllPrefix = (isEditor == false) ? "\\skse64_" : "\\skse64_editor_"; g_dllPath = GetRuntimeDirectory() + dllPrefix + dllSuffix + ".dll"; _MESSAGE("dll = %s", g_dllPath.c_str()); LoadLibrary(g_dllPath.c_str()); }
bool PluginManager::FindPluginDirectory(void) { bool result = false; // find the path <runtime directory>/data/skse/ std::string runtimeDirectory = GetRuntimeDirectory(); if(!runtimeDirectory.empty()) { m_pluginDirectory = runtimeDirectory + "Data\\SKSE\\Plugins\\"; result = true; } return result; }
const std::string & GetConfigPath() { static std::string s_configPath; if(s_configPath.empty()) { std::string runtimePath = GetRuntimeDirectory(); if(!runtimePath.empty()) { s_configPath = runtimePath + "Data\\F4SE\\f4se.ini"; _MESSAGE("config path = %s", s_configPath.c_str()); } } return s_configPath; }