├── Nukem Detours ├── README.md ├── LICENSE └── Detours.h ├── Source ├── pch.cpp ├── ProxyFunctions │ ├── X3DAudio17.h │ ├── DInput8.h │ ├── bink2w64.h │ ├── WinHTTP.h │ ├── WinMM.h │ └── IpHlpAPI.h ├── pch.hpp ├── UnconditionalJump.asm ├── Common.h ├── Utility.h ├── Framework.hpp ├── DLLMain.cpp ├── Application.h ├── Detour.cpp ├── VectoredExceptionHandler.h ├── Detour.h ├── VectoredExceptionHandler.cpp ├── Application.cpp ├── ScriptExtenderDefinesBase.h ├── xSEPluginPreloader.h └── xSEPluginPreloaderFunctions.cpp ├── xSE PluginPreloader.rc ├── xSE PluginPreloader.aps ├── .editorconfig ├── resource.h ├── README.md ├── xSE PluginPreloader.sln ├── .gitattributes ├── ChangeLog.md ├── Exports ├── F4SE.def ├── SKSE64.def ├── NVSE.def └── SKSE.def ├── xSE PluginPreloader.vcxproj.filters ├── .gitignore ├── Build └── xSE PluginPreloader.xml ├── xSE PluginPreloader.vcxproj └── LICENSE /Nukem Detours/README.md: -------------------------------------------------------------------------------- 1 | https://github.com/Nukem9/detours -------------------------------------------------------------------------------- /Source/pch.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Karandra/xSE-PluginPreloader/HEAD/Source/pch.cpp -------------------------------------------------------------------------------- /xSE PluginPreloader.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Karandra/xSE-PluginPreloader/HEAD/xSE PluginPreloader.rc -------------------------------------------------------------------------------- /xSE PluginPreloader.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Karandra/xSE-PluginPreloader/HEAD/xSE PluginPreloader.aps -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | indent_size = 4 6 | charset = utf-8 7 | trim_trailing_whitespace = false 8 | insert_final_newline = true 9 | -------------------------------------------------------------------------------- /Source/ProxyFunctions/X3DAudio17.h: -------------------------------------------------------------------------------- 1 | namespace xSE::PluginPreloader::Library::X3DAudio17 2 | { 3 | enum Enum 4 | { 5 | X3DAudioCalculate, 6 | X3DAudioInitialize 7 | }; 8 | }; 9 | -------------------------------------------------------------------------------- /Source/pch.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define NOMINMAX 4 | #define WIN32_LEAN_AND_MEAN 5 | 6 | #include "Framework.hpp" 7 | #include 8 | 9 | #include "resource.h" 10 | -------------------------------------------------------------------------------- /Source/UnconditionalJump.asm: -------------------------------------------------------------------------------- 1 | .data 2 | extern UnconditionalJumpAddress: qword 3 | 4 | .code 5 | 6 | UnconditionalJump proc 7 | jmp qword ptr [UnconditionalJumpAddress] 8 | UnconditionalJump endp 9 | 10 | end 11 | -------------------------------------------------------------------------------- /Source/ProxyFunctions/DInput8.h: -------------------------------------------------------------------------------- 1 | namespace xSE::PluginPreloader::Library::DInput8 2 | { 3 | enum 4 | { 5 | DirectInput8Create, 6 | DllCanUnloadNow, 7 | DllGetClassObject, 8 | DllRegisterServer, 9 | DllUnregisterServer 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /Source/Common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Framework.hpp" 3 | 4 | namespace xSE::LogCategory 5 | { 6 | KX_DefineLogCategory(xSE); 7 | KX_DefineLogCategory(ScriptExtender); 8 | 9 | KX_DefineLogCategory(Environment); 10 | KX_DefineLogCategory(ImportAddressHook); 11 | KX_DefineLogCategory(CurrentModule); 12 | KX_DefineLogCategory(HostProcess); 13 | } 14 | -------------------------------------------------------------------------------- /Source/Utility.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Framework.hpp" 3 | 4 | namespace xSE::Utility 5 | { 6 | template 7 | __declspec(noinline) uint32_t SEHTryExcept(TFunc&& func) noexcept(std::is_nothrow_invocable_v) 8 | { 9 | __try 10 | { 11 | std::invoke(func); 12 | return 0; 13 | } 14 | __except (EXCEPTION_EXECUTE_HANDLER) 15 | { 16 | return ::GetExceptionCode(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Source/Framework.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // KxFramework 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | -------------------------------------------------------------------------------- /resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by xSE PluginPreloader.rc 4 | // 5 | #define IDR_XML_DEFAULT_CONFIGURATION 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # xSE PluginPreloader 2 | Plugin preloader for Fallout 4 Script Extender. 3 | 4 | Uses [KxFramework](https://github.com/KerberX/KxFramework). Use [VCPkg](https://github.com/microsoft/vcpkg) to get the framework as a dependency. Details on KxFramework page. 5 | Also uses [Nukem Detours](https://github.com/Nukem9/detours). There is no VCPkg package for it. Download the repository and place its files (from the folder with `.sln` file) in `Nukem Detours\Solution` folder, build required configuration and copy `.lib` files in `Nukem Detours\x64` and `Nukem Detours\x86` folders. 6 | 7 | # Download page 8 | Nexus: https://www.nexusmods.com/fallout4/mods/33946 9 | -------------------------------------------------------------------------------- /Source/DLLMain.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.hpp" 2 | #include "xSEPluginPreloader.h" 3 | 4 | BOOL APIENTRY DllMain(HMODULE handle, DWORD event, LPVOID lpReserved) 5 | { 6 | if (event == DLL_PROCESS_ATTACH) 7 | { 8 | auto& handler = xSE::PreloadHandler::CreateInstance(); 9 | if (handler.IsNull()) 10 | { 11 | kxf::Log::Critical("Invalid state of 'PreloadHandler' reported, terminating process"); 12 | return FALSE; 13 | } 14 | 15 | return handler.OnDLLMain(handle, event) ? TRUE : FALSE; 16 | } 17 | else if (auto instance = xSE::PreloadHandler::GetInstance()) 18 | { 19 | return instance->OnDLLMain(handle, event) ? TRUE : FALSE; 20 | } 21 | return FALSE; 22 | } 23 | -------------------------------------------------------------------------------- /Source/Application.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Framework.hpp" 3 | #include 4 | #include 5 | 6 | namespace xSE 7 | { 8 | class PreloadHandler; 9 | } 10 | 11 | namespace xSE 12 | { 13 | class Application: public kxf::RTTI::Implementation 14 | { 15 | private: 16 | PreloadHandler& m_PreloadHandler; 17 | kxf::AndroidLocalizationPackage m_LocalizationPackage; 18 | 19 | public: 20 | Application(PreloadHandler& handler); 21 | ~Application(); 22 | 23 | public: 24 | // ICoreApplication 25 | bool OnCreate() override; 26 | bool OnInit() override; 27 | 28 | bool OnMainLoopException() override; 29 | void OnUnhandledException() override; 30 | 31 | const kxf::ILocalizationPackage& GetLocalizationPackage() const override 32 | { 33 | return m_LocalizationPackage; 34 | } 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /Source/Detour.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.hpp" 2 | #include "Detour.h" 3 | 4 | #include "Nukem Detours/Detours.h" 5 | #if _WIN64 6 | 7 | namespace NukemDetoursBase = Detours; 8 | namespace NukemDetours = Detours::X64; 9 | using NukemDetoursOpt = Detours::X64Option; 10 | #pragma comment(lib, "Nukem Detours/x64/detours.lib") 11 | 12 | #else 13 | 14 | namespace NukemDetoursBase = Detours; 15 | namespace NukemDetours = Detours::X86; 16 | using NukemDetoursOpt = Detours::X86Option; 17 | #pragma comment(lib, "Nukem Detours/x86/detours.lib") 18 | 19 | #endif 20 | 21 | namespace xSE::Detour::Private 22 | { 23 | uintptr_t FunctionIAT(uintptr_t func, const char* libraryName, const char* functionName) noexcept 24 | { 25 | uintptr_t base = reinterpret_cast(::GetModuleHandleW(nullptr)); 26 | return NukemDetoursBase::IATHook(base, libraryName, functionName, func); 27 | } 28 | uintptr_t FunctionFromModule(HMODULE moduleBase, uintptr_t func, uintptr_t offset) noexcept 29 | { 30 | return NukemDetours::DetourFunction(reinterpret_cast(moduleBase) + offset, func); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Nukem Detours/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Nukem 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Source/VectoredExceptionHandler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Framework.hpp" 3 | 4 | namespace xSE 5 | { 6 | class VectoredExceptionHandler final 7 | { 8 | public: 9 | enum class Mode 10 | { 11 | ContinueHandler, 12 | ExceptionHandler 13 | }; 14 | enum class Order 15 | { 16 | First, 17 | Last 18 | }; 19 | enum class Result: uint32_t 20 | { 21 | ContinueSearch, 22 | ContinueExecution 23 | }; 24 | 25 | private: 26 | Mode m_Mode = Mode::ContinueHandler; 27 | void* m_Handle = nullptr; 28 | 29 | public: 30 | VectoredExceptionHandler() noexcept = default; 31 | VectoredExceptionHandler(const VectoredExceptionHandler&) = delete; 32 | ~VectoredExceptionHandler() 33 | { 34 | Remove(); 35 | } 36 | 37 | public: 38 | bool IsInstalled() const noexcept 39 | { 40 | return m_Handle != nullptr; 41 | } 42 | Mode GetMode() const noexcept 43 | { 44 | return m_Mode; 45 | } 46 | 47 | bool Install(LONG(NTAPI *func)(_EXCEPTION_POINTERS*), Mode mode, Order order) noexcept; 48 | bool Remove() noexcept; 49 | 50 | public: 51 | VectoredExceptionHandler& operator=(const VectoredExceptionHandler&) = delete; 52 | }; 53 | } 54 | -------------------------------------------------------------------------------- /Source/Detour.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Framework.hpp" 3 | 4 | namespace xSE::Detour::Private 5 | { 6 | uintptr_t FunctionIAT(uintptr_t func, const char* libraryName, const char* functionName) noexcept; 7 | uintptr_t FunctionFromModule(HMODULE moduleBase, uintptr_t func, uintptr_t offset) noexcept; 8 | } 9 | 10 | namespace xSE::Detour 11 | { 12 | template requires(std::is_function_v) 13 | T* FunctionIAT(T* func, const char* libraryName, const char* functionName) noexcept 14 | { 15 | return reinterpret_cast(Private::FunctionIAT(reinterpret_cast(func), libraryName, functionName)); 16 | } 17 | 18 | template requires(std::is_function_v) 19 | T FunctionFromModule(HMODULE moduleBase, T func, uintptr_t offset) noexcept 20 | { 21 | return reinterpret_cast(Private::FunctionFromModule(moduleBase, reinterpret_cast(func), offset)); 22 | } 23 | 24 | template requires(std::is_function_v) 25 | T* FunctionFromModuleByName(const wchar_t* libraryName, T* func, uintptr_t offset) noexcept 26 | { 27 | return FunctionFromModule(::GetModuleHandleW(libraryName), func, offset); 28 | } 29 | 30 | template requires(std::is_function_v) 31 | T* FunctionFromExecutingModule(T* func, uintptr_t offset) noexcept 32 | { 33 | return FunctionFromModuleByName(nullptr, func, offset); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/VectoredExceptionHandler.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.hpp" 2 | #include "VectoredExceptionHandler.h" 3 | 4 | namespace xSE 5 | { 6 | bool VectoredExceptionHandler::Install(LONG(NTAPI *func)(_EXCEPTION_POINTERS*), Mode mode, Order order) noexcept 7 | { 8 | KX_SCOPEDLOG_ARGS(func, mode, order); 9 | 10 | if (!m_Handle) 11 | { 12 | m_Mode = mode; 13 | if (mode == Mode::ExceptionHandler) 14 | { 15 | m_Handle = ::AddVectoredExceptionHandler(order == Order::First, func); 16 | } 17 | else if (mode == Mode::ContinueHandler) 18 | { 19 | m_Handle = ::AddVectoredContinueHandler(order == Order::First, func); 20 | } 21 | 22 | KX_SCOPEDLOG.SetSuccess(); 23 | return m_Handle != nullptr; 24 | } 25 | return false; 26 | } 27 | bool VectoredExceptionHandler::Remove() noexcept 28 | { 29 | KX_SCOPEDLOG_FUNC; 30 | KX_SCOPEDLOG.Info() KX_SCOPEDLOG_VALUE(m_Handle); 31 | 32 | if (m_Handle) 33 | { 34 | void* handle = m_Handle; 35 | m_Handle = nullptr; 36 | 37 | ULONG result = 0; 38 | if (m_Mode == Mode::ExceptionHandler) 39 | { 40 | result = ::RemoveVectoredExceptionHandler(handle); 41 | } 42 | else if (m_Mode == Mode::ContinueHandler) 43 | { 44 | result = ::RemoveVectoredContinueHandler(handle); 45 | } 46 | bool success = result != 0; 47 | 48 | KX_SCOPEDLOG.LogReturn(success, success); 49 | return success; 50 | } 51 | 52 | KX_SCOPEDLOG.LogReturn(false); 53 | return false; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Source/Application.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.hpp" 2 | #include "Application.h" 3 | #include "xSEPluginPreloader.h" 4 | #include 5 | #include 6 | 7 | namespace xSE 8 | { 9 | Application::Application(PreloadHandler& handler) 10 | :m_PreloadHandler(handler) 11 | { 12 | ICoreApplication::SetInstance(this); 13 | } 14 | Application::~Application() 15 | { 16 | ICoreApplication::SetInstance(nullptr); 17 | } 18 | 19 | bool Application::OnCreate() 20 | { 21 | SetName(m_PreloadHandler.GetLibraryName()); 22 | SetVersion(m_PreloadHandler.GetLibraryVersion()); 23 | SetVendorName("Karandra"); 24 | 25 | return true; 26 | } 27 | bool Application::OnInit() 28 | { 29 | Bind(kxf::DynamicLibraryEvent::EvtLoaded, [&](kxf::DynamicLibraryEvent& event) 30 | { 31 | kxf::Log::Trace("Library '{}' loaded from '{}'", event.GetBaseName().GetFullPath(), event.GetLibrary().GetFilePath().GetFullPath()); 32 | }, kxf::BindEventFlag::AlwaysSkip); 33 | Bind(kxf::DynamicLibraryEvent::EvtUnloaded, [&](kxf::DynamicLibraryEvent& event) 34 | { 35 | kxf::Log::Trace("Library '{}' unloaded", event.GetBaseName().GetFullPath()); 36 | }, kxf::BindEventFlag::AlwaysSkip); 37 | 38 | return true; 39 | } 40 | 41 | bool Application::OnMainLoopException() 42 | { 43 | kxf::String exceptionMessage; 44 | try 45 | { 46 | throw; 47 | } 48 | catch (const std::exception& e) 49 | { 50 | exceptionMessage = e.what(); 51 | } 52 | catch (const char* e) 53 | { 54 | exceptionMessage = e; 55 | } 56 | catch (...) 57 | { 58 | exceptionMessage = "unknown error"; 59 | } 60 | 61 | // Log error message 62 | kxf::Log::Critical("Unexpected exception has occurred: '{}', the program will terminate", exceptionMessage); 63 | 64 | // Exit the main loop and terminate the program 65 | return false; 66 | } 67 | void Application::OnUnhandledException() 68 | { 69 | Application::OnMainLoopException(); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Source/ProxyFunctions/bink2w64.h: -------------------------------------------------------------------------------- 1 | namespace xSE::PluginPreloader::Library::bink2w64 2 | { 3 | enum 4 | { 5 | BinkBufferBlit, 6 | BinkBufferCheckWinPos, 7 | BinkBufferClear, 8 | BinkBufferClose, 9 | BinkBufferGetDescription, 10 | BinkBufferGetError, 11 | BinkBufferLock, 12 | BinkBufferOpen, 13 | BinkBufferSetDirectDraw, 14 | BinkBufferSetHWND, 15 | BinkBufferSetOffset, 16 | BinkBufferSetResolution, 17 | BinkBufferSetScale, 18 | BinkBufferUnlock, 19 | BinkCheckCursor, 20 | BinkClose, 21 | BinkCloseTrack, 22 | BinkControlBackgroundIO, 23 | BinkControlPlatformFeatures, 24 | BinkCopyToBuffer, 25 | BinkCopyToBufferRect, 26 | BinkDDSurfaceType, 27 | BinkDX8SurfaceType, 28 | BinkDX9SurfaceType, 29 | BinkDoFrame, 30 | BinkDoFrameAsync, 31 | BinkDoFrameAsyncWait, 32 | BinkDoFramePlane, 33 | BinkFreeGlobals, 34 | BinkGetError, 35 | BinkGetFrameBuffersInfo, 36 | BinkGetKeyFrame, 37 | BinkGetPalette, 38 | BinkGetPlatformInfo, 39 | BinkGetRealtime, 40 | BinkGetRects, 41 | BinkGetSummary, 42 | BinkGetTrackData, 43 | BinkGetTrackID, 44 | BinkGetTrackMaxSize, 45 | BinkGetTrackType, 46 | BinkGoto, 47 | BinkIsSoftwareCursor, 48 | BinkLogoAddress, 49 | BinkNextFrame, 50 | BinkOpen, 51 | BinkOpenDirectSound, 52 | BinkOpenMiles, 53 | BinkOpenTrack, 54 | BinkOpenWaveOut, 55 | BinkOpenWithOptions, 56 | BinkOpenXAudio2, 57 | BinkPause, 58 | BinkRegisterFrameBuffers, 59 | BinkRequestStopAsyncThread, 60 | BinkRestoreCursor, 61 | BinkService, 62 | BinkSetError, 63 | BinkSetFileOffset, 64 | BinkSetFrameRate, 65 | BinkSetIO, 66 | BinkSetIOSize, 67 | BinkSetMemory, 68 | BinkSetPan, 69 | BinkSetSimulate, 70 | BinkSetSoundOnOff, 71 | BinkSetSoundSystem, 72 | BinkSetSoundSystem2, 73 | BinkSetSoundTrack, 74 | BinkSetSpeakerVolumes, 75 | BinkSetVideoOnOff, 76 | BinkSetVolume, 77 | BinkSetWillLoop, 78 | BinkShouldSkip, 79 | BinkStartAsyncThread, 80 | BinkUseTelemetry, 81 | BinkUseTmLite, 82 | BinkWait, 83 | BinkWaitStopAsyncThread, 84 | RADTimerRead 85 | }; 86 | }; 87 | -------------------------------------------------------------------------------- /xSE PluginPreloader.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31829.152 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xSE PluginPreloader", "xSE PluginPreloader.vcxproj", "{D8462034-E42F-47A3-863E-E6BC7252C178}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{224AF95A-A995-4BEA-889C-40A80EA05DF3}" 9 | ProjectSection(SolutionItems) = preProject 10 | .editorconfig = .editorconfig 11 | EndProjectSection 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | F4SE|x64 = F4SE|x64 16 | F4SE|x86 = F4SE|x86 17 | NVSE|x64 = NVSE|x64 18 | NVSE|x86 = NVSE|x86 19 | SKSE|x64 = SKSE|x64 20 | SKSE|x86 = SKSE|x86 21 | SKSE64|x64 = SKSE64|x64 22 | SKSE64|x86 = SKSE64|x86 23 | EndGlobalSection 24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 25 | {D8462034-E42F-47A3-863E-E6BC7252C178}.F4SE|x64.ActiveCfg = F4SE|x64 26 | {D8462034-E42F-47A3-863E-E6BC7252C178}.F4SE|x64.Build.0 = F4SE|x64 27 | {D8462034-E42F-47A3-863E-E6BC7252C178}.F4SE|x86.ActiveCfg = F4SE|Win32 28 | {D8462034-E42F-47A3-863E-E6BC7252C178}.NVSE|x64.ActiveCfg = NVSE|x64 29 | {D8462034-E42F-47A3-863E-E6BC7252C178}.NVSE|x86.ActiveCfg = NVSE|Win32 30 | {D8462034-E42F-47A3-863E-E6BC7252C178}.NVSE|x86.Build.0 = NVSE|Win32 31 | {D8462034-E42F-47A3-863E-E6BC7252C178}.SKSE|x64.ActiveCfg = SKSE|x64 32 | {D8462034-E42F-47A3-863E-E6BC7252C178}.SKSE|x86.ActiveCfg = SKSE|Win32 33 | {D8462034-E42F-47A3-863E-E6BC7252C178}.SKSE|x86.Build.0 = SKSE|Win32 34 | {D8462034-E42F-47A3-863E-E6BC7252C178}.SKSE64|x64.ActiveCfg = SKSE64|x64 35 | {D8462034-E42F-47A3-863E-E6BC7252C178}.SKSE64|x64.Build.0 = SKSE64|x64 36 | {D8462034-E42F-47A3-863E-E6BC7252C178}.SKSE64|x86.ActiveCfg = SKSE64|Win32 37 | EndGlobalSection 38 | GlobalSection(SolutionProperties) = preSolution 39 | HideSolutionNode = FALSE 40 | EndGlobalSection 41 | GlobalSection(ExtensibilityGlobals) = postSolution 42 | SolutionGuid = {CC2645FB-4913-4640-97D8-B86B5F913C5E} 43 | EndGlobalSection 44 | EndGlobal 45 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /ChangeLog.md: -------------------------------------------------------------------------------- 1 | *Dates in DD.MM.YYYY* 2 | 3 | # Version 0.3, 18.06.2024 4 | - Added xSE library loading detection. 5 | - Added xSE-PluginPreload initialization method. 6 | - Updated to support Fallout 4 NG update (switched to `WinHTTP.dll`). 7 | - Updated logging system, log file will now be created in `Documents\My Games\[Game]\[xSE]` folder if possible. 8 | - Marked game launcher, editor and xSE loader executables as not allowed to preload plugins. 9 | - Rebuilt with statically linked C runtime library. 10 | 11 | # Version 0.2.5.1, 19.11.2021 12 | - Added experimental support for Skyrim Legendary Edition. 13 | - Added `InstallExceptionHandler` option to disable vectored exception handler installation (it's enabled by default). 14 | - Default load method changed to `ImportAddressHook`. 15 | - Removed static link requirement for `DXGI.dll`. 16 | - General refactoring. 17 | 18 | # Version 0.2.5, 12.11.2021 19 | - Added experimental support for Skyrim (Special and Anniversary Edition). 20 | - Fixed possible bug in `ImportAddressHook` load method (wrong hook signature). 21 | - Added `HookDelay` option to pause the calling thread before hooking (for `ImportAddressHook` method only). 22 | 23 | # Version 0.2.4, 30.11.2020 24 | - Added DLL load time dependencies diagnostics when plugin failed to load. 25 | - Removed service pack logging for systems where it's not applicable (Win10+). 26 | 27 | # Version 0.2.3, 07.10.2020 28 | - Fixed warning message box about missing `DComp.dll` on Windows 7. 29 | 30 | # Version 0.2.2, 06.10.2020 31 | - Fixed bug with loading configuration from XML file (see: https://github.com/Karandra/KxFramework/commit/b563edc50e19587c1b9730bddb7465ad09be5ff9). 32 | - Added logging of the system version and some other environment information. 33 | 34 | # Version 0.2.1, 01.10.2020 35 | - Better logging of configuration file loading. 36 | - When the config file isn't found or can not be loaded it will be restored to the default one stored inside the DLL file. 37 | - Many pointers and pointer-like values are logged in hex now (0x12abcdef). 38 | 39 | # Version 0.2, 01.10.2020 40 | - Rewritten using [KxFramework](https://github.com/Karandra/KxFramework). 41 | - Added more logging and error reporting. 42 | - Added process filter to exclude some processes from preloading plugins. 43 | - Added back support for import address table (IAT) hooking method. 44 | - Config file uses XML format instead of INI. 45 | 46 | # Version 0.1.2, 02.10.2018 47 | - Incompatibility with HRTF (or any other mod which uses `X3DAudio1_7.dll`) is resolved. For Fallout 4 `IpHlpAPI.dll` is now used. 48 | 49 | # Version 0.1.1, 12.08.2018 50 | - Added config option to specify load method. Default is delayed loading for MO. 51 | - Changed delayed load method to second thread attach. Refer to `Source\DLLMain.cpp` for details. 52 | -------------------------------------------------------------------------------- /Source/ProxyFunctions/WinHTTP.h: -------------------------------------------------------------------------------- 1 | namespace xSE::PluginPreloader::Library::WinHTTP 2 | { 3 | enum Enum 4 | { 5 | WinHttpSetSecureLegacyServersAppCompat, 6 | DllCanUnloadNow, 7 | DllGetClassObject, 8 | Private1, 9 | SvchostPushServiceGlobals, 10 | WinHttpAddRequestHeaders, 11 | WinHttpAddRequestHeadersEx, 12 | WinHttpAutoProxySvcMain, 13 | WinHttpCheckPlatform, 14 | WinHttpCloseHandle, 15 | WinHttpConnect, 16 | WinHttpConnectionDeletePolicyEntries, 17 | WinHttpConnectionDeleteProxyInfo, 18 | WinHttpConnectionFreeNameList, 19 | WinHttpConnectionFreeProxyInfo, 20 | WinHttpConnectionFreeProxyList, 21 | WinHttpConnectionGetNameList, 22 | WinHttpConnectionGetProxyInfo, 23 | WinHttpConnectionGetProxyList, 24 | WinHttpConnectionOnlyConvert, 25 | WinHttpConnectionOnlyReceive, 26 | WinHttpConnectionOnlySend, 27 | WinHttpConnectionSetPolicyEntries, 28 | WinHttpConnectionSetProxyInfo, 29 | WinHttpConnectionUpdateIfIndexTable, 30 | WinHttpCrackUrl, 31 | WinHttpCreateProxyResolver, 32 | WinHttpCreateUrl, 33 | WinHttpDetectAutoProxyConfigUrl, 34 | WinHttpFreeProxyResult, 35 | WinHttpFreeProxyResultEx, 36 | WinHttpFreeProxySettings, 37 | WinHttpFreeProxySettingsEx, 38 | WinHttpFreeQueryConnectionGroupResult, 39 | WinHttpGetDefaultProxyConfiguration, 40 | WinHttpGetIEProxyConfigForCurrentUser, 41 | WinHttpGetProxyForUrl, 42 | WinHttpGetProxyForUrlEx, 43 | WinHttpGetProxyForUrlEx2, 44 | WinHttpGetProxyForUrlHvsi, 45 | WinHttpGetProxyResult, 46 | WinHttpGetProxyResultEx, 47 | WinHttpGetProxySettingsEx, 48 | WinHttpGetProxySettingsResultEx, 49 | WinHttpGetProxySettingsVersion, 50 | WinHttpGetTunnelSocket, 51 | WinHttpOpen, 52 | WinHttpOpenRequest, 53 | WinHttpPacJsWorkerMain, 54 | WinHttpProbeConnectivity, 55 | WinHttpQueryAuthSchemes, 56 | WinHttpQueryConnectionGroup, 57 | WinHttpQueryDataAvailable, 58 | WinHttpQueryHeaders, 59 | WinHttpQueryHeadersEx, 60 | WinHttpQueryOption, 61 | WinHttpReadData, 62 | WinHttpReadDataEx, 63 | WinHttpReadProxySettings, 64 | WinHttpReadProxySettingsHvsi, 65 | WinHttpReceiveResponse, 66 | WinHttpRegisterProxyChangeNotification, 67 | WinHttpResetAutoProxy, 68 | WinHttpSaveProxyCredentials, 69 | WinHttpSendRequest, 70 | WinHttpSetCredentials, 71 | WinHttpSetDefaultProxyConfiguration, 72 | WinHttpSetOption, 73 | WinHttpSetProxySettingsPerUser, 74 | WinHttpSetStatusCallback, 75 | WinHttpSetTimeouts, 76 | WinHttpTimeFromSystemTime, 77 | WinHttpTimeToSystemTime, 78 | WinHttpUnregisterProxyChangeNotification, 79 | WinHttpWebSocketClose, 80 | WinHttpWebSocketCompleteUpgrade, 81 | WinHttpWebSocketQueryCloseStatus, 82 | WinHttpWebSocketReceive, 83 | WinHttpWebSocketSend, 84 | WinHttpWebSocketShutdown, 85 | WinHttpWriteData, 86 | WinHttpWriteProxySettings 87 | }; 88 | }; 89 | -------------------------------------------------------------------------------- /Exports/F4SE.def: -------------------------------------------------------------------------------- 1 | LIBRARY WinHTTP 2 | EXPORTS 3 | WinHttpSetSecureLegacyServersAppCompat @1 4 | DllCanUnloadNow @2 5 | DllGetClassObject @3 6 | Private1 @4 7 | SvchostPushServiceGlobals @5 8 | WinHttpAddRequestHeaders @6 9 | WinHttpAddRequestHeadersEx @7 10 | WinHttpAutoProxySvcMain @8 11 | WinHttpCheckPlatform @9 12 | WinHttpCloseHandle @10 13 | WinHttpConnect @11 14 | WinHttpConnectionDeletePolicyEntries @12 15 | WinHttpConnectionDeleteProxyInfo @13 16 | WinHttpConnectionFreeNameList @14 17 | WinHttpConnectionFreeProxyInfo @15 18 | WinHttpConnectionFreeProxyList @16 19 | WinHttpConnectionGetNameList @17 20 | WinHttpConnectionGetProxyInfo @18 21 | WinHttpConnectionGetProxyList @19 22 | WinHttpConnectionOnlyConvert @20 23 | WinHttpConnectionOnlyReceive @21 24 | WinHttpConnectionOnlySend @22 25 | WinHttpConnectionSetPolicyEntries @23 26 | WinHttpConnectionSetProxyInfo @24 27 | WinHttpConnectionUpdateIfIndexTable @25 28 | WinHttpCrackUrl @26 29 | WinHttpCreateProxyResolver @27 30 | WinHttpCreateUrl @28 31 | WinHttpDetectAutoProxyConfigUrl @29 32 | WinHttpFreeProxyResult @30 33 | WinHttpFreeProxyResultEx @31 34 | WinHttpFreeProxySettings @32 35 | WinHttpFreeProxySettingsEx @33 36 | WinHttpFreeQueryConnectionGroupResult @34 37 | WinHttpGetDefaultProxyConfiguration @35 38 | WinHttpGetIEProxyConfigForCurrentUser @36 39 | WinHttpGetProxyForUrl @37 40 | WinHttpGetProxyForUrlEx @38 41 | WinHttpGetProxyForUrlEx2 @39 42 | WinHttpGetProxyForUrlHvsi @40 43 | WinHttpGetProxyResult @41 44 | WinHttpGetProxyResultEx @42 45 | WinHttpGetProxySettingsEx @43 46 | WinHttpGetProxySettingsResultEx @44 47 | WinHttpGetProxySettingsVersion @45 48 | WinHttpGetTunnelSocket @46 49 | WinHttpOpen @47 50 | WinHttpOpenRequest @48 51 | WinHttpPacJsWorkerMain @49 52 | WinHttpProbeConnectivity @50 53 | WinHttpQueryAuthSchemes @51 54 | WinHttpQueryConnectionGroup @52 55 | WinHttpQueryDataAvailable @53 56 | WinHttpQueryHeaders @54 57 | WinHttpQueryHeadersEx @55 58 | WinHttpQueryOption @56 59 | WinHttpReadData @57 60 | WinHttpReadDataEx @58 61 | WinHttpReadProxySettings @59 62 | WinHttpReadProxySettingsHvsi @60 63 | WinHttpReceiveResponse @61 64 | WinHttpRegisterProxyChangeNotification @62 65 | WinHttpResetAutoProxy @63 66 | WinHttpSaveProxyCredentials @64 67 | WinHttpSendRequest @65 68 | WinHttpSetCredentials @66 69 | WinHttpSetDefaultProxyConfiguration @67 70 | WinHttpSetOption @68 71 | WinHttpSetProxySettingsPerUser @69 72 | WinHttpSetStatusCallback @70 73 | WinHttpSetTimeouts @71 74 | WinHttpTimeFromSystemTime @72 75 | WinHttpTimeToSystemTime @73 76 | WinHttpUnregisterProxyChangeNotification @74 77 | WinHttpWebSocketClose @75 78 | WinHttpWebSocketCompleteUpgrade @76 79 | WinHttpWebSocketQueryCloseStatus @77 80 | WinHttpWebSocketReceive @78 81 | WinHttpWebSocketSend @79 82 | WinHttpWebSocketShutdown @80 83 | WinHttpWriteData @81 84 | WinHttpWriteProxySettings @82 85 | -------------------------------------------------------------------------------- /Exports/SKSE64.def: -------------------------------------------------------------------------------- 1 | LIBRARY WinHTTP 2 | EXPORTS 3 | WinHttpSetSecureLegacyServersAppCompat @1 4 | DllCanUnloadNow @2 5 | DllGetClassObject @3 6 | Private1 @4 7 | SvchostPushServiceGlobals @5 8 | WinHttpAddRequestHeaders @6 9 | WinHttpAddRequestHeadersEx @7 10 | WinHttpAutoProxySvcMain @8 11 | WinHttpCheckPlatform @9 12 | WinHttpCloseHandle @10 13 | WinHttpConnect @11 14 | WinHttpConnectionDeletePolicyEntries @12 15 | WinHttpConnectionDeleteProxyInfo @13 16 | WinHttpConnectionFreeNameList @14 17 | WinHttpConnectionFreeProxyInfo @15 18 | WinHttpConnectionFreeProxyList @16 19 | WinHttpConnectionGetNameList @17 20 | WinHttpConnectionGetProxyInfo @18 21 | WinHttpConnectionGetProxyList @19 22 | WinHttpConnectionOnlyConvert @20 23 | WinHttpConnectionOnlyReceive @21 24 | WinHttpConnectionOnlySend @22 25 | WinHttpConnectionSetPolicyEntries @23 26 | WinHttpConnectionSetProxyInfo @24 27 | WinHttpConnectionUpdateIfIndexTable @25 28 | WinHttpCrackUrl @26 29 | WinHttpCreateProxyResolver @27 30 | WinHttpCreateUrl @28 31 | WinHttpDetectAutoProxyConfigUrl @29 32 | WinHttpFreeProxyResult @30 33 | WinHttpFreeProxyResultEx @31 34 | WinHttpFreeProxySettings @32 35 | WinHttpFreeProxySettingsEx @33 36 | WinHttpFreeQueryConnectionGroupResult @34 37 | WinHttpGetDefaultProxyConfiguration @35 38 | WinHttpGetIEProxyConfigForCurrentUser @36 39 | WinHttpGetProxyForUrl @37 40 | WinHttpGetProxyForUrlEx @38 41 | WinHttpGetProxyForUrlEx2 @39 42 | WinHttpGetProxyForUrlHvsi @40 43 | WinHttpGetProxyResult @41 44 | WinHttpGetProxyResultEx @42 45 | WinHttpGetProxySettingsEx @43 46 | WinHttpGetProxySettingsResultEx @44 47 | WinHttpGetProxySettingsVersion @45 48 | WinHttpGetTunnelSocket @46 49 | WinHttpOpen @47 50 | WinHttpOpenRequest @48 51 | WinHttpPacJsWorkerMain @49 52 | WinHttpProbeConnectivity @50 53 | WinHttpQueryAuthSchemes @51 54 | WinHttpQueryConnectionGroup @52 55 | WinHttpQueryDataAvailable @53 56 | WinHttpQueryHeaders @54 57 | WinHttpQueryHeadersEx @55 58 | WinHttpQueryOption @56 59 | WinHttpReadData @57 60 | WinHttpReadDataEx @58 61 | WinHttpReadProxySettings @59 62 | WinHttpReadProxySettingsHvsi @60 63 | WinHttpReceiveResponse @61 64 | WinHttpRegisterProxyChangeNotification @62 65 | WinHttpResetAutoProxy @63 66 | WinHttpSaveProxyCredentials @64 67 | WinHttpSendRequest @65 68 | WinHttpSetCredentials @66 69 | WinHttpSetDefaultProxyConfiguration @67 70 | WinHttpSetOption @68 71 | WinHttpSetProxySettingsPerUser @69 72 | WinHttpSetStatusCallback @70 73 | WinHttpSetTimeouts @71 74 | WinHttpTimeFromSystemTime @72 75 | WinHttpTimeToSystemTime @73 76 | WinHttpUnregisterProxyChangeNotification @74 77 | WinHttpWebSocketClose @75 78 | WinHttpWebSocketCompleteUpgrade @76 79 | WinHttpWebSocketQueryCloseStatus @77 80 | WinHttpWebSocketReceive @78 81 | WinHttpWebSocketSend @79 82 | WinHttpWebSocketShutdown @80 83 | WinHttpWriteData @81 84 | WinHttpWriteProxySettings @82 85 | -------------------------------------------------------------------------------- /Source/ProxyFunctions/WinMM.h: -------------------------------------------------------------------------------- 1 | namespace xSE::PluginPreloader::Library::WinMM 2 | { 3 | enum Enum 4 | { 5 | Ordinal2, 6 | CloseDriver, 7 | DefDriverProc, 8 | DriverCallback, 9 | DrvGetModuleHandle, 10 | GetDriverModuleHandle, 11 | OpenDriver, 12 | PlaySound, 13 | PlaySoundA, 14 | PlaySoundW, 15 | SendDriverMessage, 16 | WOWAppExit, 17 | auxGetDevCapsA, 18 | auxGetDevCapsW, 19 | auxGetNumDevs, 20 | auxGetVolume, 21 | auxOutMessage, 22 | auxSetVolume, 23 | joyConfigChanged, 24 | joyGetDevCapsA, 25 | joyGetDevCapsW, 26 | joyGetNumDevs, 27 | joyGetPos, 28 | joyGetPosEx, 29 | joyGetThreshold, 30 | joyReleaseCapture, 31 | joySetCapture, 32 | joySetThreshold, 33 | mciDriverNotify, 34 | mciDriverYield, 35 | mciExecute, 36 | mciFreeCommandResource, 37 | mciGetCreatorTask, 38 | mciGetDeviceIDA, 39 | mciGetDeviceIDFromElementIDA, 40 | mciGetDeviceIDFromElementIDW, 41 | mciGetDeviceIDW, 42 | mciGetDriverData, 43 | mciGetErrorStringA, 44 | mciGetErrorStringW, 45 | mciGetYieldProc, 46 | mciLoadCommandResource, 47 | mciSendCommandA, 48 | mciSendCommandW, 49 | mciSendStringA, 50 | mciSendStringW, 51 | mciSetDriverData, 52 | mciSetYieldProc, 53 | midiConnect, 54 | midiDisconnect, 55 | midiInAddBuffer, 56 | midiInClose, 57 | midiInGetDevCapsA, 58 | midiInGetDevCapsW, 59 | midiInGetErrorTextA, 60 | midiInGetErrorTextW, 61 | midiInGetID, 62 | midiInGetNumDevs, 63 | midiInMessage, 64 | midiInOpen, 65 | midiInPrepareHeader, 66 | midiInReset, 67 | midiInStart, 68 | midiInStop, 69 | midiInUnprepareHeader, 70 | midiOutCacheDrumPatches, 71 | midiOutCachePatches, 72 | midiOutClose, 73 | midiOutGetDevCapsA, 74 | midiOutGetDevCapsW, 75 | midiOutGetErrorTextA, 76 | midiOutGetErrorTextW, 77 | midiOutGetID, 78 | midiOutGetNumDevs, 79 | midiOutGetVolume, 80 | midiOutLongMsg, 81 | midiOutMessage, 82 | midiOutOpen, 83 | midiOutPrepareHeader, 84 | midiOutReset, 85 | midiOutSetVolume, 86 | midiOutShortMsg, 87 | midiOutUnprepareHeader, 88 | midiStreamClose, 89 | midiStreamOpen, 90 | midiStreamOut, 91 | midiStreamPause, 92 | midiStreamPosition, 93 | midiStreamProperty, 94 | midiStreamRestart, 95 | midiStreamStop, 96 | mixerClose, 97 | mixerGetControlDetailsA, 98 | mixerGetControlDetailsW, 99 | mixerGetDevCapsA, 100 | mixerGetDevCapsW, 101 | mixerGetID, 102 | mixerGetLineControlsA, 103 | mixerGetLineControlsW, 104 | mixerGetLineInfoA, 105 | mixerGetLineInfoW, 106 | mixerGetNumDevs, 107 | mixerMessage, 108 | mixerOpen, 109 | mixerSetControlDetails, 110 | mmDrvInstall, 111 | mmGetCurrentTask, 112 | mmTaskBlock, 113 | mmTaskCreate, 114 | mmTaskSignal, 115 | mmTaskYield, 116 | mmioAdvance, 117 | mmioAscend, 118 | mmioClose, 119 | mmioCreateChunk, 120 | mmioDescend, 121 | mmioFlush, 122 | mmioGetInfo, 123 | mmioInstallIOProcA, 124 | mmioInstallIOProcW, 125 | mmioOpenA, 126 | mmioOpenW, 127 | mmioRead, 128 | mmioRenameA, 129 | mmioRenameW, 130 | mmioSeek, 131 | mmioSendMessage, 132 | mmioSetBuffer, 133 | mmioSetInfo, 134 | mmioStringToFOURCCA, 135 | mmioStringToFOURCCW, 136 | mmioWrite, 137 | mmsystemGetVersion, 138 | sndPlaySoundA, 139 | sndPlaySoundW, 140 | timeBeginPeriod, 141 | timeEndPeriod, 142 | timeGetDevCaps, 143 | timeGetSystemTime, 144 | timeGetTime, 145 | timeKillEvent, 146 | timeSetEvent, 147 | waveInAddBuffer, 148 | waveInClose, 149 | waveInGetDevCapsA, 150 | waveInGetDevCapsW, 151 | waveInGetErrorTextA, 152 | waveInGetErrorTextW, 153 | waveInGetID, 154 | waveInGetNumDevs, 155 | waveInGetPosition, 156 | waveInMessage, 157 | waveInOpen, 158 | waveInPrepareHeader, 159 | waveInReset, 160 | waveInStart, 161 | waveInStop, 162 | waveInUnprepareHeader, 163 | waveOutBreakLoop, 164 | waveOutClose, 165 | waveOutGetDevCapsA, 166 | waveOutGetDevCapsW, 167 | waveOutGetErrorTextA, 168 | waveOutGetErrorTextW, 169 | waveOutGetID, 170 | waveOutGetNumDevs, 171 | waveOutGetPitch, 172 | waveOutGetPlaybackRate, 173 | waveOutGetPosition, 174 | waveOutGetVolume, 175 | waveOutMessage, 176 | waveOutOpen, 177 | waveOutPause, 178 | waveOutPrepareHeader, 179 | waveOutReset, 180 | waveOutRestart, 181 | waveOutSetPitch, 182 | waveOutSetPlaybackRate, 183 | waveOutSetVolume, 184 | waveOutUnprepareHeader, 185 | waveOutWrite 186 | }; 187 | }; 188 | -------------------------------------------------------------------------------- /xSE PluginPreloader.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {50fce867-34ad-4e25-8c58-39eff42d1db8} 10 | 11 | 12 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 13 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 14 | 15 | 16 | {2a4bff16-3e05-4934-9f59-f5c51f1bf9fc} 17 | 18 | 19 | 20 | 21 | Source 22 | 23 | 24 | Source 25 | 26 | 27 | Source 28 | 29 | 30 | Source 31 | 32 | 33 | Source 34 | 35 | 36 | Source 37 | 38 | 39 | Source 40 | 41 | 42 | 43 | 44 | Resources 45 | 46 | 47 | Source 48 | 49 | 50 | Source 51 | 52 | 53 | Source\ProxyFunctions 54 | 55 | 56 | Source\ProxyFunctions 57 | 58 | 59 | Source\ProxyFunctions 60 | 61 | 62 | Source\ProxyFunctions 63 | 64 | 65 | Source\ProxyFunctions 66 | 67 | 68 | Source 69 | 70 | 71 | Source 72 | 73 | 74 | Source 75 | 76 | 77 | Source 78 | 79 | 80 | Source 81 | 82 | 83 | Source 84 | 85 | 86 | Source\ProxyFunctions 87 | 88 | 89 | Source 90 | 91 | 92 | 93 | 94 | Source 95 | 96 | 97 | 98 | 99 | Resources 100 | 101 | 102 | 103 | 104 | Resources 105 | 106 | 107 | 108 | 109 | Resources 110 | 111 | 112 | Resources 113 | 114 | 115 | Resources\Exports 116 | 117 | 118 | Resources\Exports 119 | 120 | 121 | Resources\Exports 122 | 123 | 124 | Resources\Exports 125 | 126 | 127 | -------------------------------------------------------------------------------- /Exports/NVSE.def: -------------------------------------------------------------------------------- 1 | LIBRARY WinMM 2 | EXPORTS 3 | Ordinal2 @1 4 | CloseDriver @2 5 | DefDriverProc @3 6 | DriverCallback @4 7 | DrvGetModuleHandle @5 8 | GetDriverModuleHandle @6 9 | OpenDriver @7 10 | PlaySound @8 11 | PlaySoundA @9 12 | PlaySoundW @10 13 | SendDriverMessage @11 14 | WOWAppExit @12 15 | auxGetDevCapsA @13 16 | auxGetDevCapsW @14 17 | auxGetNumDevs @15 18 | auxGetVolume @16 19 | auxOutMessage @17 20 | auxSetVolume @18 21 | joyConfigChanged @19 22 | joyGetDevCapsA @20 23 | joyGetDevCapsW @21 24 | joyGetNumDevs @22 25 | joyGetPos @23 26 | joyGetPosEx @24 27 | joyGetThreshold @25 28 | joyReleaseCapture @26 29 | joySetCapture @27 30 | joySetThreshold @28 31 | mciDriverNotify @29 32 | mciDriverYield @30 33 | mciExecute @31 34 | mciFreeCommandResource @32 35 | mciGetCreatorTask @33 36 | mciGetDeviceIDA @34 37 | mciGetDeviceIDFromElementIDA @35 38 | mciGetDeviceIDFromElementIDW @36 39 | mciGetDeviceIDW @37 40 | mciGetDriverData @38 41 | mciGetErrorStringA @39 42 | mciGetErrorStringW @40 43 | mciGetYieldProc @41 44 | mciLoadCommandResource @42 45 | mciSendCommandA @43 46 | mciSendCommandW @44 47 | mciSendStringA @45 48 | mciSendStringW @46 49 | mciSetDriverData @47 50 | mciSetYieldProc @48 51 | midiConnect @49 52 | midiDisconnect @50 53 | midiInAddBuffer @51 54 | midiInClose @52 55 | midiInGetDevCapsA @53 56 | midiInGetDevCapsW @54 57 | midiInGetErrorTextA @55 58 | midiInGetErrorTextW @56 59 | midiInGetID @57 60 | midiInGetNumDevs @58 61 | midiInMessage @59 62 | midiInOpen @60 63 | midiInPrepareHeader @61 64 | midiInReset @62 65 | midiInStart @63 66 | midiInStop @64 67 | midiInUnprepareHeader @65 68 | midiOutCacheDrumPatches @66 69 | midiOutCachePatches @67 70 | midiOutClose @68 71 | midiOutGetDevCapsA @69 72 | midiOutGetDevCapsW @70 73 | midiOutGetErrorTextA @71 74 | midiOutGetErrorTextW @72 75 | midiOutGetID @73 76 | midiOutGetNumDevs @74 77 | midiOutGetVolume @75 78 | midiOutLongMsg @76 79 | midiOutMessage @77 80 | midiOutOpen @78 81 | midiOutPrepareHeader @79 82 | midiOutReset @80 83 | midiOutSetVolume @81 84 | midiOutShortMsg @82 85 | midiOutUnprepareHeader @83 86 | midiStreamClose @84 87 | midiStreamOpen @85 88 | midiStreamOut @86 89 | midiStreamPause @87 90 | midiStreamPosition @88 91 | midiStreamProperty @89 92 | midiStreamRestart @90 93 | midiStreamStop @91 94 | mixerClose @92 95 | mixerGetControlDetailsA @93 96 | mixerGetControlDetailsW @94 97 | mixerGetDevCapsA @95 98 | mixerGetDevCapsW @96 99 | mixerGetID @97 100 | mixerGetLineControlsA @98 101 | mixerGetLineControlsW @99 102 | mixerGetLineInfoA @100 103 | mixerGetLineInfoW @101 104 | mixerGetNumDevs @102 105 | mixerMessage @103 106 | mixerOpen @104 107 | mixerSetControlDetails @105 108 | mmDrvInstall @106 109 | mmGetCurrentTask @107 110 | mmTaskBlock @108 111 | mmTaskCreate @109 112 | mmTaskSignal @110 113 | mmTaskYield @111 114 | mmioAdvance @112 115 | mmioAscend @113 116 | mmioClose @114 117 | mmioCreateChunk @115 118 | mmioDescend @116 119 | mmioFlush @117 120 | mmioGetInfo @118 121 | mmioInstallIOProcA @119 122 | mmioInstallIOProcW @120 123 | mmioOpenA @121 124 | mmioOpenW @122 125 | mmioRead @123 126 | mmioRenameA @124 127 | mmioRenameW @125 128 | mmioSeek @126 129 | mmioSendMessage @127 130 | mmioSetBuffer @128 131 | mmioSetInfo @129 132 | mmioStringToFOURCCA @130 133 | mmioStringToFOURCCW @131 134 | mmioWrite @132 135 | mmsystemGetVersion @133 136 | sndPlaySoundA @134 137 | sndPlaySoundW @135 138 | timeBeginPeriod @136 139 | timeEndPeriod @137 140 | timeGetDevCaps @138 141 | timeGetSystemTime @139 142 | timeGetTime @140 143 | timeKillEvent @141 144 | timeSetEvent @142 145 | waveInAddBuffer @143 146 | waveInClose @144 147 | waveInGetDevCapsA @145 148 | waveInGetDevCapsW @146 149 | waveInGetErrorTextA @147 150 | waveInGetErrorTextW @148 151 | waveInGetID @149 152 | waveInGetNumDevs @150 153 | waveInGetPosition @151 154 | waveInMessage @152 155 | waveInOpen @153 156 | waveInPrepareHeader @154 157 | waveInReset @155 158 | waveInStart @156 159 | waveInStop @157 160 | waveInUnprepareHeader @158 161 | waveOutBreakLoop @159 162 | waveOutClose @160 163 | waveOutGetDevCapsA @161 164 | waveOutGetDevCapsW @162 165 | waveOutGetErrorTextA @163 166 | waveOutGetErrorTextW @164 167 | waveOutGetID @165 168 | waveOutGetNumDevs @166 169 | waveOutGetPitch @167 170 | waveOutGetPlaybackRate @168 171 | waveOutGetPosition @169 172 | waveOutGetVolume @170 173 | waveOutMessage @171 174 | waveOutOpen @172 175 | waveOutPause @173 176 | waveOutPrepareHeader @174 177 | waveOutReset @175 178 | waveOutRestart @176 179 | waveOutSetPitch @177 180 | waveOutSetPlaybackRate @178 181 | waveOutSetVolume @179 182 | waveOutUnprepareHeader @180 183 | waveOutWrite @181 184 | -------------------------------------------------------------------------------- /Exports/SKSE.def: -------------------------------------------------------------------------------- 1 | LIBRARY WinMM 2 | EXPORTS 3 | Ordinal2 @1 4 | CloseDriver @2 5 | DefDriverProc @3 6 | DriverCallback @4 7 | DrvGetModuleHandle @5 8 | GetDriverModuleHandle @6 9 | OpenDriver @7 10 | PlaySound @8 11 | PlaySoundA @9 12 | PlaySoundW @10 13 | SendDriverMessage @11 14 | WOWAppExit @12 15 | auxGetDevCapsA @13 16 | auxGetDevCapsW @14 17 | auxGetNumDevs @15 18 | auxGetVolume @16 19 | auxOutMessage @17 20 | auxSetVolume @18 21 | joyConfigChanged @19 22 | joyGetDevCapsA @20 23 | joyGetDevCapsW @21 24 | joyGetNumDevs @22 25 | joyGetPos @23 26 | joyGetPosEx @24 27 | joyGetThreshold @25 28 | joyReleaseCapture @26 29 | joySetCapture @27 30 | joySetThreshold @28 31 | mciDriverNotify @29 32 | mciDriverYield @30 33 | mciExecute @31 34 | mciFreeCommandResource @32 35 | mciGetCreatorTask @33 36 | mciGetDeviceIDA @34 37 | mciGetDeviceIDFromElementIDA @35 38 | mciGetDeviceIDFromElementIDW @36 39 | mciGetDeviceIDW @37 40 | mciGetDriverData @38 41 | mciGetErrorStringA @39 42 | mciGetErrorStringW @40 43 | mciGetYieldProc @41 44 | mciLoadCommandResource @42 45 | mciSendCommandA @43 46 | mciSendCommandW @44 47 | mciSendStringA @45 48 | mciSendStringW @46 49 | mciSetDriverData @47 50 | mciSetYieldProc @48 51 | midiConnect @49 52 | midiDisconnect @50 53 | midiInAddBuffer @51 54 | midiInClose @52 55 | midiInGetDevCapsA @53 56 | midiInGetDevCapsW @54 57 | midiInGetErrorTextA @55 58 | midiInGetErrorTextW @56 59 | midiInGetID @57 60 | midiInGetNumDevs @58 61 | midiInMessage @59 62 | midiInOpen @60 63 | midiInPrepareHeader @61 64 | midiInReset @62 65 | midiInStart @63 66 | midiInStop @64 67 | midiInUnprepareHeader @65 68 | midiOutCacheDrumPatches @66 69 | midiOutCachePatches @67 70 | midiOutClose @68 71 | midiOutGetDevCapsA @69 72 | midiOutGetDevCapsW @70 73 | midiOutGetErrorTextA @71 74 | midiOutGetErrorTextW @72 75 | midiOutGetID @73 76 | midiOutGetNumDevs @74 77 | midiOutGetVolume @75 78 | midiOutLongMsg @76 79 | midiOutMessage @77 80 | midiOutOpen @78 81 | midiOutPrepareHeader @79 82 | midiOutReset @80 83 | midiOutSetVolume @81 84 | midiOutShortMsg @82 85 | midiOutUnprepareHeader @83 86 | midiStreamClose @84 87 | midiStreamOpen @85 88 | midiStreamOut @86 89 | midiStreamPause @87 90 | midiStreamPosition @88 91 | midiStreamProperty @89 92 | midiStreamRestart @90 93 | midiStreamStop @91 94 | mixerClose @92 95 | mixerGetControlDetailsA @93 96 | mixerGetControlDetailsW @94 97 | mixerGetDevCapsA @95 98 | mixerGetDevCapsW @96 99 | mixerGetID @97 100 | mixerGetLineControlsA @98 101 | mixerGetLineControlsW @99 102 | mixerGetLineInfoA @100 103 | mixerGetLineInfoW @101 104 | mixerGetNumDevs @102 105 | mixerMessage @103 106 | mixerOpen @104 107 | mixerSetControlDetails @105 108 | mmDrvInstall @106 109 | mmGetCurrentTask @107 110 | mmTaskBlock @108 111 | mmTaskCreate @109 112 | mmTaskSignal @110 113 | mmTaskYield @111 114 | mmioAdvance @112 115 | mmioAscend @113 116 | mmioClose @114 117 | mmioCreateChunk @115 118 | mmioDescend @116 119 | mmioFlush @117 120 | mmioGetInfo @118 121 | mmioInstallIOProcA @119 122 | mmioInstallIOProcW @120 123 | mmioOpenA @121 124 | mmioOpenW @122 125 | mmioRead @123 126 | mmioRenameA @124 127 | mmioRenameW @125 128 | mmioSeek @126 129 | mmioSendMessage @127 130 | mmioSetBuffer @128 131 | mmioSetInfo @129 132 | mmioStringToFOURCCA @130 133 | mmioStringToFOURCCW @131 134 | mmioWrite @132 135 | mmsystemGetVersion @133 136 | sndPlaySoundA @134 137 | sndPlaySoundW @135 138 | timeBeginPeriod @136 139 | timeEndPeriod @137 140 | timeGetDevCaps @138 141 | timeGetSystemTime @139 142 | timeGetTime @140 143 | timeKillEvent @141 144 | timeSetEvent @142 145 | waveInAddBuffer @143 146 | waveInClose @144 147 | waveInGetDevCapsA @145 148 | waveInGetDevCapsW @146 149 | waveInGetErrorTextA @147 150 | waveInGetErrorTextW @148 151 | waveInGetID @149 152 | waveInGetNumDevs @150 153 | waveInGetPosition @151 154 | waveInMessage @152 155 | waveInOpen @153 156 | waveInPrepareHeader @154 157 | waveInReset @155 158 | waveInStart @156 159 | waveInStop @157 160 | waveInUnprepareHeader @158 161 | waveOutBreakLoop @159 162 | waveOutClose @160 163 | waveOutGetDevCapsA @161 164 | waveOutGetDevCapsW @162 165 | waveOutGetErrorTextA @163 166 | waveOutGetErrorTextW @164 167 | waveOutGetID @165 168 | waveOutGetNumDevs @166 169 | waveOutGetPitch @167 170 | waveOutGetPlaybackRate @168 171 | waveOutGetPosition @169 172 | waveOutGetVolume @170 173 | waveOutMessage @171 174 | waveOutOpen @172 175 | waveOutPause @173 176 | waveOutPrepareHeader @174 177 | waveOutReset @175 178 | waveOutRestart @176 179 | waveOutSetPitch @177 180 | waveOutSetPlaybackRate @178 181 | waveOutSetVolume @179 182 | waveOutUnprepareHeader @180 183 | waveOutWrite @181 184 | -------------------------------------------------------------------------------- /Nukem Detours/Detours.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Detours 6 | { 7 | static_assert(sizeof(uintptr_t) == sizeof(void *)); 8 | 9 | const static uint32_t DISASM_MAX_INSTRUCTIONS = 50; // Maximum number of instructions to decode at once 10 | 11 | const static uint32_t OPT_MASK = 0xFFF; // Mask for all options 12 | const static uint32_t OPT_NONE = 0x000; // No options 13 | const static uint32_t OPT_BREAK_ON_FAIL = 0x001; // Throw INT3 on failure 14 | const static uint32_t OPT_DO_NOT_PAD_NOPS = 0x002; // Don't pad replaced instructions with NOPs 15 | 16 | struct JumpTrampolineHeader 17 | { 18 | uint32_t Magic; // Used to verify the header 19 | uint32_t Random; // Variable to change the code/data hash 20 | 21 | uintptr_t CodeOffset; // Offset, in code, that was hooked: "target" 22 | uintptr_t DetourOffset; // User function that is called: "destination" 23 | 24 | uintptr_t InstructionLength;// Length of the instructions that were replaced 25 | uintptr_t InstructionOffset;// Where the backed-up instructions are 26 | 27 | uintptr_t TrampolineLength; // Length of the trampoline 28 | uintptr_t TrampolineOffset; // Code offset where 'jmp (q/d)word ptr ' occurs 29 | 30 | // Anything after this struct is null data or pure code (instructions/trampoline) 31 | }; 32 | 33 | void SetGlobalOptions(uint32_t Options); 34 | uint32_t GetGlobalOptions(); 35 | 36 | uint64_t DetourAlignAddress(uint64_t Address, uint8_t Align); 37 | 38 | bool DetourCopyMemory(uintptr_t Target, uintptr_t Memory, size_t Length); 39 | bool DetourFlushCache(uintptr_t Target, size_t Length); 40 | uintptr_t IATHook(uintptr_t Module, const char *ImportModule, const char *API, uintptr_t Detour); 41 | uintptr_t IATDelayedHook(uintptr_t Module, const char *ImportModule, const char *API, uintptr_t Detour); 42 | 43 | #ifdef _M_IX86 44 | enum class X86Option 45 | { 46 | USE_JUMP, // jmp
; 47 | USE_CALL, // call
; 48 | USE_PUSH_RET, // push
; retn; 49 | }; 50 | 51 | namespace X86 52 | { 53 | // Redirects a single static function to another 54 | uintptr_t DetourFunction(uintptr_t Target, uintptr_t Detour, X86Option Options = X86Option::USE_JUMP); 55 | 56 | // Redirects a class member function (__thiscall) to another 57 | template 58 | uintptr_t DetourFunctionClass(uintptr_t Target, T Detour, X86Option Options = X86Option::USE_JUMP) 59 | { 60 | return DetourFunction(Target, *(uintptr_t *)&Detour, Options); 61 | } 62 | 63 | // Removes a detoured function (Static or class member) 64 | bool DetourRemove(uintptr_t Trampoline); 65 | 66 | // Redirects an index in a virtual table 67 | uintptr_t DetourVTable(uintptr_t Target, uintptr_t Detour, uint32_t TableIndex); 68 | 69 | // Redirects a class member virtual function (__thiscall) to another 70 | template 71 | uintptr_t DetourClassVTable(uintptr_t Target, T Detour, uint32_t TableIndex) 72 | { 73 | return DetourVTable(Target, *(uintptr_t *)&Detour, TableIndex); 74 | } 75 | 76 | // Removes a detoured virtual table index 77 | bool VTableRemove(uintptr_t Target, uintptr_t Function, uint32_t TableIndex); 78 | 79 | void DetourWriteStub(JumpTrampolineHeader *Header); 80 | bool DetourWriteJump(JumpTrampolineHeader *Header); 81 | bool DetourWriteCall(JumpTrampolineHeader *Header); 82 | bool DetourWritePushRet(JumpTrampolineHeader *Header); 83 | 84 | uint32_t DetourGetHookLength(X86Option Options); 85 | } 86 | #endif // _M_IX86 87 | 88 | #ifdef _M_AMD64 89 | enum class X64Option 90 | { 91 | USE_PUSH_RET, // push ; [rsp+4h] = ; retn; 92 | USE_RAX_JUMP, // mov rax,
; jmp rax; 93 | USE_REL32_JUMP, // jmp
94 | USE_REL32_CALL, // call
95 | }; 96 | 97 | namespace X64 98 | { 99 | // Redirects a single static function to another 100 | uintptr_t DetourFunction(uintptr_t Target, uintptr_t Detour, X64Option Options = X64Option::USE_REL32_JUMP); 101 | 102 | // Redirects a class member function (__thiscall) to another 103 | template 104 | uintptr_t DetourFunctionClass(uintptr_t Target, T Detour, X64Option Options = X64Option::USE_REL32_JUMP) 105 | { 106 | return DetourFunction(Target, *(uintptr_t *)&Detour, Options); 107 | } 108 | 109 | // Removes a detoured function (Static or class member) 110 | bool DetourRemove(uintptr_t Trampoline); 111 | 112 | // Redirects an index in a virtual table 113 | uintptr_t DetourVTable(uintptr_t Target, uintptr_t Detour, uint32_t TableIndex); 114 | 115 | // Redirects a class member virtual function (__thiscall) to another 116 | template 117 | uintptr_t DetourClassVTable(uintptr_t Target, T Detour, uint32_t TableIndex) 118 | { 119 | return DetourVTable(Target, *(uintptr_t *)&Detour, TableIndex); 120 | } 121 | 122 | // Removes a detoured virtual table index 123 | bool VTableRemove(uintptr_t Target, uintptr_t Function, uint32_t TableIndex); 124 | 125 | void DetourWriteStub(JumpTrampolineHeader *Header); 126 | bool DetourWritePushRet(JumpTrampolineHeader *Header); 127 | bool DetourWriteRaxJump(JumpTrampolineHeader *Header); 128 | bool DetourWriteRel32Jump(JumpTrampolineHeader *Header); 129 | bool DetourWriteRel32Call(JumpTrampolineHeader *Header); 130 | 131 | uint32_t DetourGetHookLength(X64Option Options); 132 | } 133 | #endif // _M_AMD64 134 | } -------------------------------------------------------------------------------- /Source/ScriptExtenderDefinesBase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.hpp" 3 | 4 | ////////////////////////////////////////////////////////////////////////// 5 | // Main defines 6 | ////////////////////////////////////////////////////////////////////////// 7 | enum xSE_PlatfromGeneration: int 8 | { 9 | xSE_PLATFORM_GENERATION_NONE, 10 | xSE_PLATFORM_GENERATION_MWSE, 11 | xSE_PLATFORM_GENERATION_OBSE, 12 | xSE_PLATFORM_GENERATION_FOSE, 13 | xSE_PLATFORM_GENERATION_NVSE, 14 | xSE_PLATFORM_GENERATION_SKSE, 15 | xSE_PLATFORM_GENERATION_SKSE64, 16 | xSE_PLATFORM_GENERATION_SKSE64AE, 17 | xSE_PLATFORM_GENERATION_SKSEVR, 18 | xSE_PLATFORM_GENERATION_F4SE, 19 | xSE_PLATFORM_GENERATION_F4SEVR, 20 | xSE_PLATFORM_GENERATION_SFSE 21 | }; 22 | 23 | #if xSE_PLATFORM_MWSE 24 | 25 | #define xSE_NAME MWSE 26 | #define xSE_GAME_NAME Morrowind 27 | #define xSE_FOLDER_NAME MWSE 28 | #define xSE_CONFIG_FOLDER_NAME Morrowind 29 | #define xSE_PACKED_VERSION PACKED_MWSE_VERSION 30 | #define xSE_PLATFORM_GENERATION xSE_PLATFORM_GENERATION_MWSE 31 | 32 | #define xSE_PRELOADFUNCTION MWSEPlugin_Preload 33 | #define xSE_QUERYFUNCTION MWSEPlugin_Query 34 | #define xSE_LOADFUNCTION MWSEPlugin_Load 35 | 36 | #elif xSE_PLATFORM_OBSE 37 | 38 | #define xSE_NAME OBSE 39 | #define xSE_GAME_NAME Oblivion 40 | #define xSE_FOLDER_NAME OBSE 41 | #define xSE_CONFIG_FOLDER_NAME Oblivion 42 | #define xSE_PACKED_VERSION OBSE_VERSION_INTEGER 43 | #define xSE_PLATFORM_GENERATION xSE_PLATFORM_GENERATION_OBSE 44 | 45 | #define xSE_PRELOADFUNCTION OBSEPlugin_Preload 46 | #define xSE_QUERYFUNCTION OBSEPlugin_Query 47 | #define xSE_LOADFUNCTION OBSEPlugin_Load 48 | 49 | #elif xSE_PLATFORM_FOSE 50 | 51 | #define xSE_NAME FOSE 52 | #define xSE_GAME_NAME Fallout 3 53 | #define xSE_FOLDER_NAME FOSE 54 | #define xSE_CONFIG_FOLDER_NAME Fallout3 55 | #define xSE_PACKED_VERSION FOSE_VERSION_INTEGER 56 | #define xSE_PLATFORM_GENERATION xSE_PLATFORM_GENERATION_FOSE 57 | 58 | #define xSE_PRELOADFUNCTION FOSEPlugin_Preload 59 | #define xSE_QUERYFUNCTION FOSEPlugin_Query 60 | #define xSE_LOADFUNCTION FOSEPlugin_Load 61 | 62 | #elif xSE_PLATFORM_NVSE 63 | 64 | #define xSE_NAME NVSE 65 | #define xSE_GAME_NAME Fallout: New Vegas 66 | #define xSE_FOLDER_NAME NVSE 67 | #define xSE_CONFIG_FOLDER_NAME FalloutNV 68 | #define xSE_PACKED_VERSION NVSE_VERSION_INTEGER 69 | #define xSE_PLATFORM_GENERATION xSE_PLATFORM_GENERATION_NVSE 70 | 71 | #define xSE_PRELOADFUNCTION NVSEPlugin_Preload 72 | #define xSE_QUERYFUNCTION NVSEPlugin_Query 73 | #define xSE_LOADFUNCTION NVSEPlugin_Load 74 | 75 | #elif xSE_PLATFORM_SKSE 76 | 77 | #define xSE_NAME SKSE 78 | #define xSE_GAME_NAME Skyrim 79 | #define xSE_FOLDER_NAME SKSE 80 | #define xSE_CONFIG_FOLDER_NAME Skyrim 81 | #define xSE_PACKED_VERSION PACKED_SKSE_VERSION 82 | #define xSE_PLATFORM_GENERATION xSE_PLATFORM_GENERATION_SKSE 83 | 84 | #define xSE_PRELOADFUNCTION SKSEPlugin_Preload 85 | #define xSE_QUERYFUNCTION SKSEPlugin_Query 86 | #define xSE_LOADFUNCTION SKSEPlugin_Load 87 | 88 | #elif xSE_PLATFORM_SKSE64 89 | 90 | #define xSE_NAME SKSE64 91 | #define xSE_GAME_NAME Skyrim Special Edition 92 | #define xSE_FOLDER_NAME SKSE 93 | #define xSE_CONFIG_FOLDER_NAME Skyrim Special Edition 94 | #define xSE_PACKED_VERSION PACKED_SKSE_VERSION 95 | #define xSE_PLATFORM_GENERATION xSE_PLATFORM_GENERATION_SKSE64 96 | 97 | #define xSE_PRELOADFUNCTION SKSEPlugin_Preload 98 | #define xSE_QUERYFUNCTION SKSEPlugin_Query 99 | #define xSE_LOADFUNCTION SKSEPlugin_Load 100 | 101 | #elif xSE_PLATFORM_SKSE64AE 102 | 103 | #define xSE_NAME SKSE64AE 104 | #define xSE_GAME_NAME Skyrim Anniversary Edition 105 | #define xSE_FOLDER_NAME SKSE 106 | #define xSE_CONFIG_FOLDER_NAME Skyrim Special Edition 107 | #define xSE_PACKED_VERSION PACKED_SKSE_VERSION 108 | #define xSE_PLATFORM_GENERATION xSE_PLATFORM_GENERATION_SKSE64AE 109 | 110 | #define xSE_PRELOADFUNCTION SKSEPlugin_Preload 111 | #define xSE_QUERYFUNCTION SKSEPlugin_Query 112 | #define xSE_LOADFUNCTION SKSEPlugin_Load 113 | 114 | #elif xSE_PLATFORM_SKSEVR 115 | 116 | #define xSE_NAME SKSEVR 117 | #define xSE_GAME_NAME Skyrim VR 118 | #define xSE_FOLDER_NAME SKSE 119 | #define xSE_CONFIG_FOLDER_NAME Skyrim VR 120 | #define xSE_PACKED_VERSION PACKED_SKSE_VERSION 121 | #define xSE_PLATFORM_GENERATION xSE_PLATFORM_GENERATION_SKSEVR 122 | 123 | #define xSE_PRELOADFUNCTION SKSEPlugin_Preload 124 | #define xSE_QUERYFUNCTION SKSEPlugin_Query 125 | #define xSE_LOADFUNCTION SKSEPlugin_Load 126 | 127 | #elif xSE_PLATFORM_F4SE 128 | 129 | #define xSE_NAME F4SE 130 | #define xSE_GAME_NAME Fallout 4 131 | #define xSE_FOLDER_NAME F4SE 132 | #define xSE_CONFIG_FOLDER_NAME Fallout4 133 | #define xSE_PACKED_VERSION PACKED_F4SE_VERSION 134 | #define xSE_PLATFORM_GENERATION xSE_PLATFORM_GENERATION_F4SE 135 | 136 | #define xSE_PRELOADFUNCTION F4SEPlugin_Preload 137 | #define xSE_QUERYFUNCTION F4SEPlugin_Query 138 | #define xSE_LOADFUNCTION F4SEPlugin_Load 139 | 140 | #elif xSE_PLATFORM_F4SEVR 141 | 142 | #define xSE_NAME F4SEVR 143 | #define xSE_GAME_NAME Fallout 4 VR 144 | #define xSE_FOLDER_NAME F4SE 145 | #define xSE_CONFIG_FOLDER_NAME Fallout4VR 146 | #define xSE_PACKED_VERSION PACKED_F4SE_VERSION 147 | #define xSE_PLATFORM_GENERATION xSE_PLATFORM_GENERATION_F4SEVR 148 | 149 | #define xSE_PRELOADFUNCTION F4SEPlugin_Preload 150 | #define xSE_QUERYFUNCTION F4SEPlugin_Query 151 | #define xSE_LOADFUNCTION F4SEPlugin_Load 152 | 153 | #elif xSE_PLATFORM_SFSE 154 | 155 | #define xSE_NAME SFSE 156 | #define xSE_GAME_NAME Starfield 157 | #define xSE_FOLDER_NAME SFSE 158 | #define xSE_CONFIG_FOLDER_NAME Starfield 159 | #define xSE_PACKED_VERSION PACKED_SFSE_VERSION 160 | #define xSE_PLATFORM_GENERATION xSE_PLATFORM_GENERATION_SFSE 161 | 162 | #define xSE_PRELOADFUNCTION SFSEPlugin_Preload 163 | #define xSE_QUERYFUNCTION SFSEPlugin_Query 164 | #define xSE_LOADFUNCTION SFSEPlugin_Load 165 | 166 | #else 167 | 168 | #define xSE_NAME None 169 | #define xSE_GAME_NAME None 170 | #define xSE_FOLDER_NAME None 171 | #define xSE_CONFIG_FOLDER_NAME None 172 | #define xSE_PACKED_VERSION 0 173 | #define xSE_PLATFORM_GENERATION xSE_PLATFORM_GENERATION_NONE 174 | 175 | #endif 176 | 177 | #define xSE_NAME_A _CRT_STRINGIZE(xSE_NAME) 178 | #define xSE_NAME_W _CRT_WIDE(xSE_NAME_A) 179 | 180 | #define xSE_GAME_NAME_A _CRT_STRINGIZE(xSE_GAME_NAME) 181 | #define xSE_GAME_NAME_W _CRT_WIDE(xSE_GAME_NAME_A) 182 | 183 | #define xSE_FOLDER_NAME_A _CRT_STRINGIZE(xSE_FOLDER_NAME) 184 | #define xSE_FOLDER_NAME_W _CRT_WIDE(xSE_FOLDER_NAME_A) 185 | 186 | #define xSE_CONFIG_FOLDER_NAME_A _CRT_STRINGIZE(xSE_CONFIG_FOLDER_NAME) 187 | #define xSE_CONFIG_FOLDER_NAME_W _CRT_WIDE(xSE_CONFIG_FOLDER_NAME_A) 188 | 189 | ////////////////////////////////////////////////////////////////////////// 190 | // Call conventions 191 | ////////////////////////////////////////////////////////////////////////// 192 | #define xSE_API(retType) extern "C" __declspec(dllexport) retType __cdecl 193 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | [Aa][Rr][Mm]/ 24 | [Aa][Rr][Mm]64/ 25 | bld/ 26 | [Bb]in/ 27 | [Oo]bj/ 28 | [Ll]og/ 29 | 30 | [Jj]unk/ 31 | [Bb]uild/F4SE* 32 | [Bb]uild/NVSE* 33 | [Bb]uild/SKSE* 34 | [Bb]uild/SKSE64* 35 | 36 | Nukem Detours/Solution/* 37 | 38 | # Visual Studio 2015/2017 cache/options directory 39 | .vs/ 40 | # Uncomment if you have tasks that create the project's static files in wwwroot 41 | #wwwroot/ 42 | 43 | # Visual Studio 2017 auto generated files 44 | Generated\ Files/ 45 | 46 | # MSTest test Results 47 | [Tt]est[Rr]esult*/ 48 | [Bb]uild[Ll]og.* 49 | 50 | # NUNIT 51 | *.VisualState.xml 52 | TestResult.xml 53 | 54 | # Build Results of an ATL Project 55 | [Dd]ebugPS/ 56 | [Rr]eleasePS/ 57 | dlldata.c 58 | 59 | # Benchmark Results 60 | BenchmarkDotNet.Artifacts/ 61 | 62 | # .NET Core 63 | project.lock.json 64 | project.fragment.lock.json 65 | artifacts/ 66 | 67 | # StyleCop 68 | StyleCopReport.xml 69 | 70 | # Files built by Visual Studio 71 | *_i.c 72 | *_p.c 73 | *_h.h 74 | *.ilk 75 | *.meta 76 | *.obj 77 | *.iobj 78 | *.pch 79 | *.pdb 80 | *.ipdb 81 | *.pgc 82 | *.pgd 83 | *.rsp 84 | *.sbr 85 | *.tlb 86 | *.tli 87 | *.tlh 88 | *.tmp 89 | *.tmp_proj 90 | *_wpftmp.csproj 91 | *.log 92 | *.vspscc 93 | *.vssscc 94 | .builds 95 | *.pidb 96 | *.svclog 97 | *.scc 98 | 99 | # Chutzpah Test files 100 | _Chutzpah* 101 | 102 | # Visual C++ cache files 103 | ipch/ 104 | *.aps 105 | *.ncb 106 | *.opendb 107 | *.opensdf 108 | *.sdf 109 | *.cachefile 110 | *.VC.db 111 | *.VC.VC.opendb 112 | 113 | # Visual Studio profiler 114 | *.psess 115 | *.vsp 116 | *.vspx 117 | *.sap 118 | 119 | # Visual Studio Trace Files 120 | *.e2e 121 | 122 | # TFS 2012 Local Workspace 123 | $tf/ 124 | 125 | # Guidance Automation Toolkit 126 | *.gpState 127 | 128 | # ReSharper is a .NET coding add-in 129 | _ReSharper*/ 130 | *.[Rr]e[Ss]harper 131 | *.DotSettings.user 132 | 133 | # JustCode is a .NET coding add-in 134 | .JustCode 135 | 136 | # TeamCity is a build add-in 137 | _TeamCity* 138 | 139 | # DotCover is a Code Coverage Tool 140 | *.dotCover 141 | 142 | # AxoCover is a Code Coverage Tool 143 | .axoCover/* 144 | !.axoCover/settings.json 145 | 146 | # Visual Studio code coverage results 147 | *.coverage 148 | *.coveragexml 149 | 150 | # NCrunch 151 | _NCrunch_* 152 | .*crunch*.local.xml 153 | nCrunchTemp_* 154 | 155 | # MightyMoose 156 | *.mm.* 157 | AutoTest.Net/ 158 | 159 | # Web workbench (sass) 160 | .sass-cache/ 161 | 162 | # Installshield output folder 163 | [Ee]xpress/ 164 | 165 | # DocProject is a documentation generator add-in 166 | DocProject/buildhelp/ 167 | DocProject/Help/*.HxT 168 | DocProject/Help/*.HxC 169 | DocProject/Help/*.hhc 170 | DocProject/Help/*.hhk 171 | DocProject/Help/*.hhp 172 | DocProject/Help/Html2 173 | DocProject/Help/html 174 | 175 | # Click-Once directory 176 | publish/ 177 | 178 | # Publish Web Output 179 | *.[Pp]ublish.xml 180 | *.azurePubxml 181 | # Note: Comment the next line if you want to checkin your web deploy settings, 182 | # but database connection strings (with potential passwords) will be unencrypted 183 | *.pubxml 184 | *.publishproj 185 | 186 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 187 | # checkin your Azure Web App publish settings, but sensitive information contained 188 | # in these scripts will be unencrypted 189 | PublishScripts/ 190 | 191 | # NuGet Packages 192 | *.nupkg 193 | # The packages folder can be ignored because of Package Restore 194 | **/[Pp]ackages/* 195 | # except build/, which is used as an MSBuild target. 196 | !**/[Pp]ackages/build/ 197 | # Uncomment if necessary however generally it will be regenerated when needed 198 | #!**/[Pp]ackages/repositories.config 199 | # NuGet v3's project.json files produces more ignorable files 200 | *.nuget.props 201 | *.nuget.targets 202 | 203 | # Microsoft Azure Build Output 204 | csx/ 205 | *.build.csdef 206 | 207 | # Microsoft Azure Emulator 208 | ecf/ 209 | rcf/ 210 | 211 | # Windows Store app package directories and files 212 | AppPackages/ 213 | BundleArtifacts/ 214 | Package.StoreAssociation.xml 215 | _pkginfo.txt 216 | *.appx 217 | 218 | # Visual Studio cache files 219 | # files ending in .cache can be ignored 220 | *.[Cc]ache 221 | # but keep track of directories ending in .cache 222 | !?*.[Cc]ache/ 223 | 224 | # Others 225 | ClientBin/ 226 | ~$* 227 | *~ 228 | *.dbmdl 229 | *.dbproj.schemaview 230 | *.jfm 231 | *.pfx 232 | *.publishsettings 233 | orleans.codegen.cs 234 | 235 | # Including strong name files can present a security risk 236 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 237 | #*.snk 238 | 239 | # Since there are multiple workflows, uncomment next line to ignore bower_components 240 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 241 | #bower_components/ 242 | 243 | # RIA/Silverlight projects 244 | Generated_Code/ 245 | 246 | # Backup & report files from converting an old project file 247 | # to a newer Visual Studio version. Backup files are not needed, 248 | # because we have git ;-) 249 | _UpgradeReport_Files/ 250 | Backup*/ 251 | UpgradeLog*.XML 252 | UpgradeLog*.htm 253 | ServiceFabricBackup/ 254 | *.rptproj.bak 255 | 256 | # SQL Server files 257 | *.mdf 258 | *.ldf 259 | *.ndf 260 | 261 | # Business Intelligence projects 262 | *.rdl.data 263 | *.bim.layout 264 | *.bim_*.settings 265 | *.rptproj.rsuser 266 | *- Backup*.rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # JetBrains Rider 303 | .idea/ 304 | *.sln.iml 305 | 306 | # CodeRush personal settings 307 | .cr/personal 308 | 309 | # Python Tools for Visual Studio (PTVS) 310 | __pycache__/ 311 | *.pyc 312 | 313 | # Cake - Uncomment if you are using it 314 | # tools/** 315 | # !tools/packages.config 316 | 317 | # Tabs Studio 318 | *.tss 319 | 320 | # Telerik's JustMock configuration file 321 | *.jmconfig 322 | 323 | # BizTalk build output 324 | *.btp.cs 325 | *.btm.cs 326 | *.odx.cs 327 | *.xsd.cs 328 | 329 | # OpenCover UI analysis results 330 | OpenCover/ 331 | 332 | # Azure Stream Analytics local run output 333 | ASALocalRun/ 334 | 335 | # MSBuild Binary and Structured Log 336 | *.binlog 337 | 338 | # NVidia Nsight GPU debugger configuration file 339 | *.nvuser 340 | 341 | # MFractors (Xamarin productivity tool) working folder 342 | .mfractor/ 343 | 344 | # Local History for Visual Studio 345 | .localhistory/ 346 | 347 | # BeatPulse healthcheck temp database 348 | healthchecksdb -------------------------------------------------------------------------------- /Source/xSEPluginPreloader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Common.h" 3 | #include "VectoredExceptionHandler.h" 4 | #include "Utility.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | BOOL APIENTRY DllMain(HMODULE, DWORD, LPVOID); 13 | 14 | namespace kxf 15 | { 16 | class ExecutableVersionResource; 17 | } 18 | 19 | namespace xSE 20 | { 21 | class Application; 22 | 23 | enum class PluginStatus: uint32_t 24 | { 25 | Loaded, 26 | Initialized, 27 | 28 | FailedLoad, 29 | FailedInitialize 30 | }; 31 | 32 | enum class LoadMethod 33 | { 34 | OnProcessAttach, 35 | OnThreadAttach, 36 | ImportAddressHook 37 | }; 38 | enum class InitializationMethod 39 | { 40 | None, 41 | Standard, 42 | xSEPluginPreload 43 | }; 44 | } 45 | 46 | namespace xSE::PluginPreloader 47 | { 48 | class OnProcessAttach final 49 | { 50 | }; 51 | 52 | class OnThreadAttach final 53 | { 54 | public: 55 | size_t ThreadNumber = 0; 56 | }; 57 | 58 | template 59 | class ImportAddressHook final 60 | { 61 | private: 62 | TSignature* m_OriginalFunction = nullptr; 63 | 64 | public: 65 | kxf::String LibraryName; 66 | kxf::String FunctionName; 67 | 68 | public: 69 | bool IsNull() const 70 | { 71 | return LibraryName.IsEmpty() || FunctionName.IsEmpty(); 72 | } 73 | 74 | template> 75 | R CallOriginal(kxf::NtStatus& status, Args&&... arg) 76 | { 77 | KX_SCOPEDLOG_FUNC; 78 | KX_SCOPEDLOG.Info() 79 | KX_SCOPEDLOG_VALUE_AS(m_OriginalFunction, reinterpret_cast(m_OriginalFunction)) 80 | KX_SCOPEDLOG_VALUE(LibraryName) 81 | KX_SCOPEDLOG_VALUE(FunctionName); 82 | 83 | if constexpr(std::is_void_v) 84 | { 85 | status = Utility::SEHTryExcept([&]() 86 | { 87 | std::invoke(m_OriginalFunction, std::forward(arg)...); 88 | }); 89 | KX_SCOPEDLOG.SetSuccess(status); 90 | } 91 | else 92 | { 93 | R result; 94 | status = Utility::SEHTryExcept([&]() 95 | { 96 | result = std::invoke(m_OriginalFunction, std::forward(arg)...); 97 | }); 98 | 99 | KX_SCOPEDLOG.LogReturn(result, status.IsSuccess()); 100 | return result; 101 | } 102 | } 103 | 104 | TSignature* GetOriginal() const noexcept 105 | { 106 | return m_OriginalFunction; 107 | } 108 | void SaveOriginal(TSignature* func) noexcept 109 | { 110 | m_OriginalFunction = func; 111 | } 112 | bool IsHooked() const noexcept 113 | { 114 | return m_OriginalFunction != nullptr; 115 | } 116 | }; 117 | class ImportAddressHookHandler; 118 | } 119 | 120 | namespace xSE 121 | { 122 | class PreloadHandler final 123 | { 124 | friend BOOL APIENTRY ::DllMain(HMODULE, DWORD, LPVOID); 125 | friend class PluginPreloader::ImportAddressHookHandler; 126 | 127 | private: 128 | static PreloadHandler& CreateInstance(); 129 | static void DestroyInstance(); 130 | 131 | public: 132 | static kxf::String GetLibraryName(); 133 | static kxf::Version GetLibraryVersion(); 134 | static PreloadHandler* GetInstance() noexcept; 135 | 136 | static void** GetFunctions() noexcept; 137 | static size_t GetFunctionsCount() noexcept; 138 | static size_t GetFunctionsEffectiveCount() noexcept; 139 | 140 | private: 141 | // General 142 | std::shared_ptr m_Application; 143 | kxf::NativeFileSystem m_InstallFS; 144 | kxf::NativeFileSystem m_ConfigFS; 145 | kxf::DynamicLibrary m_OriginalLibrary; 146 | std::vector m_LoadedLibraries; 147 | VectoredExceptionHandler m_VectoredExceptionHandler; 148 | 149 | kxf::FSPath m_ExecutablePath; 150 | bool m_PluginsLoaded = false; 151 | bool m_PluginsLoadAllowed = false; 152 | std::atomic m_ThreadAttachCount = 0; 153 | bool m_WatchThreadAttach = false; 154 | 155 | // Config 156 | kxf::XMLDocument m_Config; 157 | kxf::FSPath m_OriginalLibraryPath; 158 | kxf::TimeSpan m_HookDelay; 159 | kxf::TimeSpan m_LoadDelay; 160 | bool m_InstallExceptionHandler = true; 161 | bool m_KeepExceptionHandler = false; 162 | std::vector m_AllowedProcessNames; 163 | 164 | std::optional m_LoadMethod; 165 | PluginPreloader::OnProcessAttach m_OnProcessAttach; 166 | PluginPreloader::OnThreadAttach m_OnThreadAttach; 167 | #if xSE_PLATFORM_SKSE64 || xSE_PLATFORM_F4SE 168 | PluginPreloader::ImportAddressHook m_ImportAddressHook; 169 | #elif xSE_PLATFORM_SKSE || xSE_PLATFORM_NVSE 170 | PluginPreloader::ImportAddressHook m_ImportAddressHook; 171 | #endif 172 | 173 | std::optional m_InitializationMethod; 174 | 175 | private: 176 | kxf::FSPath GetOriginalLibraryPath() const; 177 | kxf::FSPath GetOriginalLibraryDefaultPath() const; 178 | 179 | void DoLoadPlugins(); 180 | void DoUnloadPlugins(); 181 | PluginStatus DoLoadSinglePlugin(const kxf::FSPath& path); 182 | void OnPluginLoadFailed(const kxf::FSPath& path); 183 | 184 | bool CheckAllowedProcesses() const; 185 | void LoadOriginalLibrary(); 186 | void LoadOriginalLibraryFunctions(); 187 | void UnloadOriginalLibrary(); 188 | void ClearOriginalFunctions(); 189 | 190 | bool InstallVectoredExceptionHandler(); 191 | void RemoveVectoredExceptionHandler(); 192 | uint32_t OnVectoredContinue(const _EXCEPTION_POINTERS& exceptionInfo); 193 | uint32_t OnVectoredException(const _EXCEPTION_POINTERS& exceptionInfo); 194 | kxf::String DumpExceptionInformation(const _EXCEPTION_POINTERS& exceptionInfo) const; 195 | 196 | bool InitializeFramework(); 197 | void LogEnvironmentInfo() const; 198 | void LogCurrentModuleInfo() const; 199 | kxf::ExecutableVersionResource LogHostProcessInfo() const; 200 | kxf::ExecutableVersionResource LogScriptExtenderInfo(const kxf::ExecutableVersionResource& hostResourceInfo) const; 201 | 202 | bool OnDLLMain(HMODULE handle, uint32_t event); 203 | bool DisableThreadLibraryCalls(HMODULE handle); 204 | 205 | bool HookImportTable(); 206 | bool LoadPlugins(); 207 | 208 | public: 209 | PreloadHandler(); 210 | ~PreloadHandler(); 211 | 212 | public: 213 | bool IsNull() const 214 | { 215 | return m_OriginalLibrary.IsNull() || !m_LoadMethod.has_value() || !m_InitializationMethod.has_value(); 216 | } 217 | LoadMethod GetLoadMethod() const 218 | { 219 | return *m_LoadMethod; 220 | } 221 | 222 | bool IsPluginsLoaded() const noexcept 223 | { 224 | return m_PluginsLoaded; 225 | } 226 | bool IsPluginsLoadAllowed() const noexcept 227 | { 228 | return m_PluginsLoadAllowed; 229 | } 230 | 231 | template 232 | const auto& GetLoadMethodOptions() const noexcept 233 | { 234 | if constexpr(method == LoadMethod::OnProcessAttach) 235 | { 236 | return m_OnProcessAttach; 237 | } 238 | else if constexpr(method == LoadMethod::OnThreadAttach) 239 | { 240 | return m_OnThreadAttach; 241 | } 242 | else if constexpr(method == LoadMethod::ImportAddressHook) 243 | { 244 | return m_ImportAddressHook; 245 | } 246 | else 247 | { 248 | static_assert(sizeof(LoadMethod*) == nullptr); 249 | } 250 | } 251 | }; 252 | } 253 | -------------------------------------------------------------------------------- /Source/ProxyFunctions/IpHlpAPI.h: -------------------------------------------------------------------------------- 1 | namespace xSE::PluginPreloader::Library::IpHlpAPI 2 | { 3 | enum Enum 4 | { 5 | AddIPAddress, 6 | AllocateAndGetInterfaceInfoFromStack, 7 | AllocateAndGetIpAddrTableFromStack, 8 | CPNatfwtCreateProviderInstance, 9 | CPNatfwtDeregisterProviderInstance, 10 | CPNatfwtDestroyProviderInstance, 11 | CPNatfwtIndicateReceivedBuffers, 12 | CPNatfwtRegisterProviderInstance, 13 | CancelIPChangeNotify, 14 | CancelMibChangeNotify2, 15 | ConvertGuidToStringA, 16 | ConvertGuidToStringW, 17 | ConvertInterfaceAliasToLuid, 18 | ConvertInterfaceGuidToLuid, 19 | ConvertInterfaceIndexToLuid, 20 | ConvertInterfaceLuidToAlias, 21 | ConvertInterfaceLuidToGuid, 22 | ConvertInterfaceLuidToIndex, 23 | ConvertInterfaceLuidToNameA, 24 | ConvertInterfaceLuidToNameW, 25 | ConvertInterfaceNameToLuidA, 26 | ConvertInterfaceNameToLuidW, 27 | ConvertInterfacePhysicalAddressToLuid, 28 | ConvertIpv4MaskToLength, 29 | ConvertLengthToIpv4Mask, 30 | ConvertRemoteInterfaceAliasToLuid, 31 | ConvertRemoteInterfaceGuidToLuid, 32 | ConvertRemoteInterfaceIndexToLuid, 33 | ConvertRemoteInterfaceLuidToAlias, 34 | ConvertRemoteInterfaceLuidToGuid, 35 | ConvertRemoteInterfaceLuidToIndex, 36 | ConvertStringToGuidA, 37 | ConvertStringToGuidW, 38 | ConvertStringToInterfacePhysicalAddress, 39 | CreateAnycastIpAddressEntry, 40 | CreateIpForwardEntry, 41 | CreateIpForwardEntry2, 42 | CreateIpNetEntry, 43 | CreateIpNetEntry2, 44 | CreatePersistentTcpPortReservation, 45 | CreatePersistentUdpPortReservation, 46 | CreateProxyArpEntry, 47 | CreateSortedAddressPairs, 48 | CreateUnicastIpAddressEntry, 49 | DeleteAnycastIpAddressEntry, 50 | DeleteIPAddress, 51 | DeleteIpForwardEntry, 52 | DeleteIpForwardEntry2, 53 | DeleteIpNetEntry, 54 | DeleteIpNetEntry2, 55 | DeletePersistentTcpPortReservation, 56 | DeletePersistentUdpPortReservation, 57 | DeleteProxyArpEntry, 58 | DeleteUnicastIpAddressEntry, 59 | DisableMediaSense, 60 | EnableRouter, 61 | FlushIpNetTable, 62 | FlushIpNetTable2, 63 | FlushIpPathTable, 64 | FreeMibTable, 65 | GetAdapterIndex, 66 | GetAdapterOrderMap, 67 | GetAdaptersAddresses, 68 | GetAdaptersInfo, 69 | GetAnycastIpAddressEntry, 70 | GetAnycastIpAddressTable, 71 | GetBestInterface, 72 | GetBestInterfaceEx, 73 | GetBestRoute, 74 | GetBestRoute2, 75 | GetCurrentThreadCompartmentId, 76 | GetExtendedTcpTable, 77 | GetExtendedUdpTable, 78 | GetFriendlyIfIndex, 79 | GetIcmpStatistics, 80 | GetIcmpStatisticsEx, 81 | GetIfEntry, 82 | GetIfEntry2, 83 | GetIfStackTable, 84 | GetIfTable, 85 | GetIfTable2, 86 | GetIfTable2Ex, 87 | GetInterfaceInfo, 88 | GetInvertedIfStackTable, 89 | GetIpAddrTable, 90 | GetIpErrorString, 91 | GetIpForwardEntry2, 92 | GetIpForwardTable, 93 | GetIpForwardTable2, 94 | GetIpInterfaceEntry, 95 | GetIpInterfaceTable, 96 | GetIpNetEntry2, 97 | GetIpNetTable, 98 | GetIpNetTable2, 99 | GetIpPathEntry, 100 | GetIpPathTable, 101 | GetIpStatistics, 102 | GetIpStatisticsEx, 103 | GetMulticastIpAddressEntry, 104 | GetMulticastIpAddressTable, 105 | GetNetworkInformation, 106 | GetNetworkParams, 107 | GetNumberOfInterfaces, 108 | GetOwnerModuleFromPidAndInfo, 109 | GetOwnerModuleFromTcp6Entry, 110 | GetOwnerModuleFromTcpEntry, 111 | GetOwnerModuleFromUdp6Entry, 112 | GetOwnerModuleFromUdpEntry, 113 | GetPerAdapterInfo, 114 | GetPerTcp6ConnectionEStats, 115 | GetPerTcp6ConnectionStats, 116 | GetPerTcpConnectionEStats, 117 | GetPerTcpConnectionStats, 118 | GetRTTAndHopCount, 119 | GetSessionCompartmentId, 120 | GetTcp6Table, 121 | GetTcp6Table2, 122 | GetTcpStatistics, 123 | GetTcpStatisticsEx, 124 | GetTcpTable, 125 | GetTcpTable2, 126 | GetTeredoPort, 127 | GetUdp6Table, 128 | GetUdpStatistics, 129 | GetUdpStatisticsEx, 130 | GetUdpTable, 131 | GetUniDirectionalAdapterInfo, 132 | GetUnicastIpAddressEntry, 133 | GetUnicastIpAddressTable, 134 | Icmp6CreateFile, 135 | Icmp6ParseReplies, 136 | Icmp6SendEcho2, 137 | IcmpCloseHandle, 138 | IcmpCreateFile, 139 | IcmpParseReplies, 140 | IcmpSendEcho, 141 | IcmpSendEcho2, 142 | IcmpSendEcho2Ex, 143 | InitializeIpForwardEntry, 144 | InitializeIpInterfaceEntry, 145 | InitializeUnicastIpAddressEntry, 146 | InternalCleanupPersistentStore, 147 | InternalCreateAnycastIpAddressEntry, 148 | InternalCreateIpForwardEntry, 149 | InternalCreateIpForwardEntry2, 150 | InternalCreateIpNetEntry, 151 | InternalCreateIpNetEntry2, 152 | InternalCreateUnicastIpAddressEntry, 153 | InternalDeleteAnycastIpAddressEntry, 154 | InternalDeleteIpForwardEntry, 155 | InternalDeleteIpForwardEntry2, 156 | InternalDeleteIpNetEntry, 157 | InternalDeleteIpNetEntry2, 158 | InternalDeleteUnicastIpAddressEntry, 159 | InternalFindInterfaceByAddress, 160 | InternalGetAnycastIpAddressEntry, 161 | InternalGetAnycastIpAddressTable, 162 | InternalGetForwardIpTable2, 163 | InternalGetIfEntry2, 164 | InternalGetIfTable, 165 | InternalGetIfTable2, 166 | InternalGetIpAddrTable, 167 | InternalGetIpForwardEntry2, 168 | InternalGetIpForwardTable, 169 | InternalGetIpInterfaceEntry, 170 | InternalGetIpInterfaceTable, 171 | InternalGetIpNetEntry2, 172 | InternalGetIpNetTable, 173 | InternalGetIpNetTable2, 174 | InternalGetMulticastIpAddressEntry, 175 | InternalGetMulticastIpAddressTable, 176 | InternalGetTcp6Table2, 177 | InternalGetTcp6TableWithOwnerModule, 178 | InternalGetTcp6TableWithOwnerPid, 179 | InternalGetTcpTable, 180 | InternalGetTcpTable2, 181 | InternalGetTcpTableEx, 182 | InternalGetTcpTableWithOwnerModule, 183 | InternalGetTcpTableWithOwnerPid, 184 | InternalGetTunnelPhysicalAdapter, 185 | InternalGetUdp6TableWithOwnerModule, 186 | InternalGetUdp6TableWithOwnerPid, 187 | InternalGetUdpTable, 188 | InternalGetUdpTableEx, 189 | InternalGetUdpTableWithOwnerModule, 190 | InternalGetUdpTableWithOwnerPid, 191 | InternalGetUnicastIpAddressEntry, 192 | InternalGetUnicastIpAddressTable, 193 | InternalSetIfEntry, 194 | InternalSetIpForwardEntry, 195 | InternalSetIpForwardEntry2, 196 | InternalSetIpInterfaceEntry, 197 | InternalSetIpNetEntry, 198 | InternalSetIpNetEntry2, 199 | InternalSetIpStats, 200 | InternalSetTcpEntry, 201 | InternalSetTeredoPort, 202 | InternalSetUnicastIpAddressEntry, 203 | IpReleaseAddress, 204 | IpRenewAddress, 205 | LookupPersistentTcpPortReservation, 206 | LookupPersistentUdpPortReservation, 207 | NTPTimeToNTFileTime, 208 | NTTimeToNTPTime, 209 | NhGetGuidFromInterfaceName, 210 | NhGetInterfaceDescriptionFromGuid, 211 | NhGetInterfaceNameFromDeviceGuid, 212 | NhGetInterfaceNameFromGuid, 213 | NhpAllocateAndGetInterfaceInfoFromStack, 214 | NotifyAddrChange, 215 | NotifyIpInterfaceChange, 216 | NotifyRouteChange, 217 | NotifyRouteChange2, 218 | NotifyStableUnicastIpAddressTable, 219 | NotifyTeredoPortChange, 220 | NotifyUnicastIpAddressChange, 221 | ParseNetworkString, 222 | PfAddFiltersToInterface, 223 | PfAddGlobalFilterToInterface, 224 | PfBindInterfaceToIPAddress, 225 | PfBindInterfaceToIndex, 226 | PfCreateInterface, 227 | PfDeleteInterface, 228 | PfDeleteLog, 229 | PfGetInterfaceStatistics, 230 | PfMakeLog, 231 | PfRebindFilters, 232 | PfRemoveFilterHandles, 233 | PfRemoveFiltersFromInterface, 234 | PfRemoveGlobalFilterFromInterface, 235 | PfSetLogBuffer, 236 | PfTestPacket, 237 | PfUnBindInterface, 238 | ResolveIpNetEntry2, 239 | ResolveNeighbor, 240 | RestoreMediaSense, 241 | SendARP, 242 | SetAdapterIpAddress, 243 | SetCurrentThreadCompartmentId, 244 | SetIfEntry, 245 | SetIpForwardEntry, 246 | SetIpForwardEntry2, 247 | SetIpInterfaceEntry, 248 | SetIpNetEntry, 249 | SetIpNetEntry2, 250 | SetIpStatistics, 251 | SetIpStatisticsEx, 252 | SetIpTTL, 253 | SetNetworkInformation, 254 | SetPerTcp6ConnectionEStats, 255 | SetPerTcp6ConnectionStats, 256 | SetPerTcpConnectionEStats, 257 | SetPerTcpConnectionStats, 258 | SetSessionCompartmentId, 259 | SetTcpEntry, 260 | SetUnicastIpAddressEntry, 261 | UnenableRouter, 262 | do_echo_rep, 263 | do_echo_req, 264 | if_indextoname, 265 | if_nametoindex, 266 | register_icmp 267 | }; 268 | }; 269 | -------------------------------------------------------------------------------- /Build/xSE PluginPreloader.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 15 | 16 | 45 | 46 | 47 | 48 | 49 | 50 | 65 | 66 | 67 | 86 | 87 | 2 88 | 89 | 90 | 91 | 92 | 93 | 102 | 103 | 104 | 117 | 118 | 119 | 136 | 137 | 138 | 139 | 146 | true 147 | false 148 | 149 | 157 | 0 158 | 0 159 | 160 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | -------------------------------------------------------------------------------- /Source/xSEPluginPreloaderFunctions.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.hpp" 2 | #include "xSEPluginPreloader.h" 3 | #include "ProxyFunctions/IpHlpAPI.h" 4 | #include "ProxyFunctions/WinHTTP.h" 5 | #include "ProxyFunctions/WinMM.h" 6 | 7 | namespace 8 | { 9 | void* g_OriginalFunctions[1024]; 10 | } 11 | 12 | #if _WIN64 13 | #define ProxyAPI __declspec(dllexport, noinline) void 14 | #else 15 | #define ProxyAPI __declspec(dllexport, noinline, naked) void 16 | #endif 17 | 18 | ////////////////////////////////////////////////////////////////////////// 19 | // Call procedures 20 | ////////////////////////////////////////////////////////////////////////// 21 | #if _WIN64 22 | 23 | extern "C" 24 | { 25 | void* UnconditionalJumpAddress = nullptr; 26 | void UnconditionalJump(); 27 | } 28 | 29 | #define CallOriginalFunc(enumName, name) \ 30 | UnconditionalJumpAddress = g_OriginalFunctions[enumName::name]; \ 31 | UnconditionalJump(); 32 | 33 | #else 34 | 35 | #define CallOriginalFunc(enumName, name) \ 36 | { \ 37 | void* func = g_OriginalFunctions[enumName::name]; \ 38 | __asm \ 39 | { \ 40 | jmp dword ptr [func] \ 41 | } \ 42 | } \ 43 | 44 | #endif 45 | 46 | #define DefineProxyFunc(API, enumName, name) \ 47 | API name() \ 48 | { \ 49 | CallOriginalFunc(xSE::PluginPreloader::Library::enumName, name); \ 50 | } \ 51 | 52 | ////////////////////////////////////////////////////////////////////////// 53 | // IpHlpAPI 54 | ////////////////////////////////////////////////////////////////////////// 55 | #define LoadFunc_IpHlpAPI(name) LoadOriginalFunc(IpHlpAPI, name) 56 | #define CallFunc_IpHlpAPI(name) CallOriginalFunc(IpHlpAPI, name) 57 | #define DefineFunc_IpHlpAPI(name) DefineProxyFunc(ProxyAPI, IpHlpAPI, name) 58 | 59 | ////////////////////////////////////////////////////////////////////////// 60 | // WinHTTP 61 | ////////////////////////////////////////////////////////////////////////// 62 | #define LoadFunc_WinHTTP(name) LoadOriginalFunc(WinHTTP, name) 63 | #define CallFunc_WinHTTP(name) CallOriginalFunc(WinHTTP, name) 64 | #define DefineFunc_WinHTTP(name) DefineProxyFunc(ProxyAPI, WinHTTP, name) 65 | 66 | ////////////////////////////////////////////////////////////////////////// 67 | // WinMM 68 | ////////////////////////////////////////////////////////////////////////// 69 | #define LoadFunc_WinMM(name) LoadOriginalFunc(WinMM, name) 70 | #define CallFunc_WinMM(name) CallOriginalFunc(WinMM, name) 71 | #define DefineFunc_WinMM(name) DefineProxyFunc(ProxyAPI, WinMM, name) 72 | 73 | ////////////////////////////////////////////////////////////////////////// 74 | // Loading and stubs 75 | ////////////////////////////////////////////////////////////////////////// 76 | #define LoadOriginalFunc(enumName, name) g_OriginalFunctions[xSE::PluginPreloader::Library::enumName::name] = m_OriginalLibrary.GetExportedFunctionAddress(#name) 77 | 78 | namespace xSE 79 | { 80 | void** PreloadHandler::GetFunctions() noexcept 81 | { 82 | return g_OriginalFunctions; 83 | } 84 | size_t PreloadHandler::GetFunctionsCount() noexcept 85 | { 86 | return std::size(g_OriginalFunctions); 87 | } 88 | size_t PreloadHandler::GetFunctionsEffectiveCount() noexcept 89 | { 90 | return std::ranges::count_if(g_OriginalFunctions, [](void* ptr) 91 | { 92 | return ptr != nullptr; 93 | }); 94 | } 95 | void PreloadHandler::LoadOriginalLibraryFunctions() 96 | { 97 | std::ranges::fill(g_OriginalFunctions, nullptr); 98 | 99 | #if xSE_PLATFORM_SKSE64 || xSE_PLATFORM_F4SE 100 | 101 | LoadFunc_WinHTTP(WinHttpSetSecureLegacyServersAppCompat); 102 | LoadFunc_WinHTTP(DllCanUnloadNow); 103 | LoadFunc_WinHTTP(DllGetClassObject); 104 | LoadFunc_WinHTTP(Private1); 105 | LoadFunc_WinHTTP(SvchostPushServiceGlobals); 106 | LoadFunc_WinHTTP(WinHttpAddRequestHeaders); 107 | LoadFunc_WinHTTP(WinHttpAddRequestHeadersEx); 108 | LoadFunc_WinHTTP(WinHttpAutoProxySvcMain); 109 | LoadFunc_WinHTTP(WinHttpCheckPlatform); 110 | LoadFunc_WinHTTP(WinHttpCloseHandle); 111 | LoadFunc_WinHTTP(WinHttpConnect); 112 | LoadFunc_WinHTTP(WinHttpConnectionDeletePolicyEntries); 113 | LoadFunc_WinHTTP(WinHttpConnectionDeleteProxyInfo); 114 | LoadFunc_WinHTTP(WinHttpConnectionFreeNameList); 115 | LoadFunc_WinHTTP(WinHttpConnectionFreeProxyInfo); 116 | LoadFunc_WinHTTP(WinHttpConnectionFreeProxyList); 117 | LoadFunc_WinHTTP(WinHttpConnectionGetNameList); 118 | LoadFunc_WinHTTP(WinHttpConnectionGetProxyInfo); 119 | LoadFunc_WinHTTP(WinHttpConnectionGetProxyList); 120 | LoadFunc_WinHTTP(WinHttpConnectionOnlyConvert); 121 | LoadFunc_WinHTTP(WinHttpConnectionOnlyReceive); 122 | LoadFunc_WinHTTP(WinHttpConnectionOnlySend); 123 | LoadFunc_WinHTTP(WinHttpConnectionSetPolicyEntries); 124 | LoadFunc_WinHTTP(WinHttpConnectionSetProxyInfo); 125 | LoadFunc_WinHTTP(WinHttpConnectionUpdateIfIndexTable); 126 | LoadFunc_WinHTTP(WinHttpCrackUrl); 127 | LoadFunc_WinHTTP(WinHttpCreateProxyResolver); 128 | LoadFunc_WinHTTP(WinHttpCreateUrl); 129 | LoadFunc_WinHTTP(WinHttpDetectAutoProxyConfigUrl); 130 | LoadFunc_WinHTTP(WinHttpFreeProxyResult); 131 | LoadFunc_WinHTTP(WinHttpFreeProxyResultEx); 132 | LoadFunc_WinHTTP(WinHttpFreeProxySettings); 133 | LoadFunc_WinHTTP(WinHttpFreeProxySettingsEx); 134 | LoadFunc_WinHTTP(WinHttpFreeQueryConnectionGroupResult); 135 | LoadFunc_WinHTTP(WinHttpGetDefaultProxyConfiguration); 136 | LoadFunc_WinHTTP(WinHttpGetIEProxyConfigForCurrentUser); 137 | LoadFunc_WinHTTP(WinHttpGetProxyForUrl); 138 | LoadFunc_WinHTTP(WinHttpGetProxyForUrlEx); 139 | LoadFunc_WinHTTP(WinHttpGetProxyForUrlEx2); 140 | LoadFunc_WinHTTP(WinHttpGetProxyForUrlHvsi); 141 | LoadFunc_WinHTTP(WinHttpGetProxyResult); 142 | LoadFunc_WinHTTP(WinHttpGetProxyResultEx); 143 | LoadFunc_WinHTTP(WinHttpGetProxySettingsEx); 144 | LoadFunc_WinHTTP(WinHttpGetProxySettingsResultEx); 145 | LoadFunc_WinHTTP(WinHttpGetProxySettingsVersion); 146 | LoadFunc_WinHTTP(WinHttpGetTunnelSocket); 147 | LoadFunc_WinHTTP(WinHttpOpen); 148 | LoadFunc_WinHTTP(WinHttpOpenRequest); 149 | LoadFunc_WinHTTP(WinHttpPacJsWorkerMain); 150 | LoadFunc_WinHTTP(WinHttpProbeConnectivity); 151 | LoadFunc_WinHTTP(WinHttpQueryAuthSchemes); 152 | LoadFunc_WinHTTP(WinHttpQueryConnectionGroup); 153 | LoadFunc_WinHTTP(WinHttpQueryDataAvailable); 154 | LoadFunc_WinHTTP(WinHttpQueryHeaders); 155 | LoadFunc_WinHTTP(WinHttpQueryHeadersEx); 156 | LoadFunc_WinHTTP(WinHttpQueryOption); 157 | LoadFunc_WinHTTP(WinHttpReadData); 158 | LoadFunc_WinHTTP(WinHttpReadDataEx); 159 | LoadFunc_WinHTTP(WinHttpReadProxySettings); 160 | LoadFunc_WinHTTP(WinHttpReadProxySettingsHvsi); 161 | LoadFunc_WinHTTP(WinHttpReceiveResponse); 162 | LoadFunc_WinHTTP(WinHttpRegisterProxyChangeNotification); 163 | LoadFunc_WinHTTP(WinHttpResetAutoProxy); 164 | LoadFunc_WinHTTP(WinHttpSaveProxyCredentials); 165 | LoadFunc_WinHTTP(WinHttpSendRequest); 166 | LoadFunc_WinHTTP(WinHttpSetCredentials); 167 | LoadFunc_WinHTTP(WinHttpSetDefaultProxyConfiguration); 168 | LoadFunc_WinHTTP(WinHttpSetOption); 169 | LoadFunc_WinHTTP(WinHttpSetProxySettingsPerUser); 170 | LoadFunc_WinHTTP(WinHttpSetStatusCallback); 171 | LoadFunc_WinHTTP(WinHttpSetTimeouts); 172 | LoadFunc_WinHTTP(WinHttpTimeFromSystemTime); 173 | LoadFunc_WinHTTP(WinHttpTimeToSystemTime); 174 | LoadFunc_WinHTTP(WinHttpUnregisterProxyChangeNotification); 175 | LoadFunc_WinHTTP(WinHttpWebSocketClose); 176 | LoadFunc_WinHTTP(WinHttpWebSocketCompleteUpgrade); 177 | LoadFunc_WinHTTP(WinHttpWebSocketQueryCloseStatus); 178 | LoadFunc_WinHTTP(WinHttpWebSocketReceive); 179 | LoadFunc_WinHTTP(WinHttpWebSocketSend); 180 | LoadFunc_WinHTTP(WinHttpWebSocketShutdown); 181 | LoadFunc_WinHTTP(WinHttpWriteData); 182 | LoadFunc_WinHTTP(WinHttpWriteProxySettings); 183 | 184 | #elif xSE_PLATFORM_SKSE || xSE_PLATFORM_NVSE 185 | 186 | LoadFunc_WinMM(Ordinal2); 187 | LoadFunc_WinMM(CloseDriver); 188 | LoadFunc_WinMM(DefDriverProc); 189 | LoadFunc_WinMM(DriverCallback); 190 | LoadFunc_WinMM(DrvGetModuleHandle); 191 | LoadFunc_WinMM(GetDriverModuleHandle); 192 | LoadFunc_WinMM(OpenDriver); 193 | LoadFunc_WinMM(PlaySound); 194 | LoadFunc_WinMM(PlaySoundA); 195 | LoadFunc_WinMM(PlaySoundW); 196 | LoadFunc_WinMM(SendDriverMessage); 197 | LoadFunc_WinMM(WOWAppExit); 198 | LoadFunc_WinMM(auxGetDevCapsA); 199 | LoadFunc_WinMM(auxGetDevCapsW); 200 | LoadFunc_WinMM(auxGetNumDevs); 201 | LoadFunc_WinMM(auxGetVolume); 202 | LoadFunc_WinMM(auxOutMessage); 203 | LoadFunc_WinMM(auxSetVolume); 204 | LoadFunc_WinMM(joyConfigChanged); 205 | LoadFunc_WinMM(joyGetDevCapsA); 206 | LoadFunc_WinMM(joyGetDevCapsW); 207 | LoadFunc_WinMM(joyGetNumDevs); 208 | LoadFunc_WinMM(joyGetPos); 209 | LoadFunc_WinMM(joyGetPosEx); 210 | LoadFunc_WinMM(joyGetThreshold); 211 | LoadFunc_WinMM(joyReleaseCapture); 212 | LoadFunc_WinMM(joySetCapture); 213 | LoadFunc_WinMM(joySetThreshold); 214 | LoadFunc_WinMM(mciDriverNotify); 215 | LoadFunc_WinMM(mciDriverYield); 216 | LoadFunc_WinMM(mciExecute); 217 | LoadFunc_WinMM(mciFreeCommandResource); 218 | LoadFunc_WinMM(mciGetCreatorTask); 219 | LoadFunc_WinMM(mciGetDeviceIDA); 220 | LoadFunc_WinMM(mciGetDeviceIDFromElementIDA); 221 | LoadFunc_WinMM(mciGetDeviceIDFromElementIDW); 222 | LoadFunc_WinMM(mciGetDeviceIDW); 223 | LoadFunc_WinMM(mciGetDriverData); 224 | LoadFunc_WinMM(mciGetErrorStringA); 225 | LoadFunc_WinMM(mciGetErrorStringW); 226 | LoadFunc_WinMM(mciGetYieldProc); 227 | LoadFunc_WinMM(mciLoadCommandResource); 228 | LoadFunc_WinMM(mciSendCommandA); 229 | LoadFunc_WinMM(mciSendCommandW); 230 | LoadFunc_WinMM(mciSendStringA); 231 | LoadFunc_WinMM(mciSendStringW); 232 | LoadFunc_WinMM(mciSetDriverData); 233 | LoadFunc_WinMM(mciSetYieldProc); 234 | LoadFunc_WinMM(midiConnect); 235 | LoadFunc_WinMM(midiDisconnect); 236 | LoadFunc_WinMM(midiInAddBuffer); 237 | LoadFunc_WinMM(midiInClose); 238 | LoadFunc_WinMM(midiInGetDevCapsA); 239 | LoadFunc_WinMM(midiInGetDevCapsW); 240 | LoadFunc_WinMM(midiInGetErrorTextA); 241 | LoadFunc_WinMM(midiInGetErrorTextW); 242 | LoadFunc_WinMM(midiInGetID); 243 | LoadFunc_WinMM(midiInGetNumDevs); 244 | LoadFunc_WinMM(midiInMessage); 245 | LoadFunc_WinMM(midiInOpen); 246 | LoadFunc_WinMM(midiInPrepareHeader); 247 | LoadFunc_WinMM(midiInReset); 248 | LoadFunc_WinMM(midiInStart); 249 | LoadFunc_WinMM(midiInStop); 250 | LoadFunc_WinMM(midiInUnprepareHeader); 251 | LoadFunc_WinMM(midiOutCacheDrumPatches); 252 | LoadFunc_WinMM(midiOutCachePatches); 253 | LoadFunc_WinMM(midiOutClose); 254 | LoadFunc_WinMM(midiOutGetDevCapsA); 255 | LoadFunc_WinMM(midiOutGetDevCapsW); 256 | LoadFunc_WinMM(midiOutGetErrorTextA); 257 | LoadFunc_WinMM(midiOutGetErrorTextW); 258 | LoadFunc_WinMM(midiOutGetID); 259 | LoadFunc_WinMM(midiOutGetNumDevs); 260 | LoadFunc_WinMM(midiOutGetVolume); 261 | LoadFunc_WinMM(midiOutLongMsg); 262 | LoadFunc_WinMM(midiOutMessage); 263 | LoadFunc_WinMM(midiOutOpen); 264 | LoadFunc_WinMM(midiOutPrepareHeader); 265 | LoadFunc_WinMM(midiOutReset); 266 | LoadFunc_WinMM(midiOutSetVolume); 267 | LoadFunc_WinMM(midiOutShortMsg); 268 | LoadFunc_WinMM(midiOutUnprepareHeader); 269 | LoadFunc_WinMM(midiStreamClose); 270 | LoadFunc_WinMM(midiStreamOpen); 271 | LoadFunc_WinMM(midiStreamOut); 272 | LoadFunc_WinMM(midiStreamPause); 273 | LoadFunc_WinMM(midiStreamPosition); 274 | LoadFunc_WinMM(midiStreamProperty); 275 | LoadFunc_WinMM(midiStreamRestart); 276 | LoadFunc_WinMM(midiStreamStop); 277 | LoadFunc_WinMM(mixerClose); 278 | LoadFunc_WinMM(mixerGetControlDetailsA); 279 | LoadFunc_WinMM(mixerGetControlDetailsW); 280 | LoadFunc_WinMM(mixerGetDevCapsA); 281 | LoadFunc_WinMM(mixerGetDevCapsW); 282 | LoadFunc_WinMM(mixerGetID); 283 | LoadFunc_WinMM(mixerGetLineControlsA); 284 | LoadFunc_WinMM(mixerGetLineControlsW); 285 | LoadFunc_WinMM(mixerGetLineInfoA); 286 | LoadFunc_WinMM(mixerGetLineInfoW); 287 | LoadFunc_WinMM(mixerGetNumDevs); 288 | LoadFunc_WinMM(mixerMessage); 289 | LoadFunc_WinMM(mixerOpen); 290 | LoadFunc_WinMM(mixerSetControlDetails); 291 | LoadFunc_WinMM(mmDrvInstall); 292 | LoadFunc_WinMM(mmGetCurrentTask); 293 | LoadFunc_WinMM(mmTaskBlock); 294 | LoadFunc_WinMM(mmTaskCreate); 295 | LoadFunc_WinMM(mmTaskSignal); 296 | LoadFunc_WinMM(mmTaskYield); 297 | LoadFunc_WinMM(mmioAdvance); 298 | LoadFunc_WinMM(mmioAscend); 299 | LoadFunc_WinMM(mmioClose); 300 | LoadFunc_WinMM(mmioCreateChunk); 301 | LoadFunc_WinMM(mmioDescend); 302 | LoadFunc_WinMM(mmioFlush); 303 | LoadFunc_WinMM(mmioGetInfo); 304 | LoadFunc_WinMM(mmioInstallIOProcA); 305 | LoadFunc_WinMM(mmioInstallIOProcW); 306 | LoadFunc_WinMM(mmioOpenA); 307 | LoadFunc_WinMM(mmioOpenW); 308 | LoadFunc_WinMM(mmioRead); 309 | LoadFunc_WinMM(mmioRenameA); 310 | LoadFunc_WinMM(mmioRenameW); 311 | LoadFunc_WinMM(mmioSeek); 312 | LoadFunc_WinMM(mmioSendMessage); 313 | LoadFunc_WinMM(mmioSetBuffer); 314 | LoadFunc_WinMM(mmioSetInfo); 315 | LoadFunc_WinMM(mmioStringToFOURCCA); 316 | LoadFunc_WinMM(mmioStringToFOURCCW); 317 | LoadFunc_WinMM(mmioWrite); 318 | LoadFunc_WinMM(mmsystemGetVersion); 319 | LoadFunc_WinMM(sndPlaySoundA); 320 | LoadFunc_WinMM(sndPlaySoundW); 321 | LoadFunc_WinMM(timeBeginPeriod); 322 | LoadFunc_WinMM(timeEndPeriod); 323 | LoadFunc_WinMM(timeGetDevCaps); 324 | LoadFunc_WinMM(timeGetSystemTime); 325 | LoadFunc_WinMM(timeGetTime); 326 | LoadFunc_WinMM(timeKillEvent); 327 | LoadFunc_WinMM(timeSetEvent); 328 | LoadFunc_WinMM(waveInAddBuffer); 329 | LoadFunc_WinMM(waveInClose); 330 | LoadFunc_WinMM(waveInGetDevCapsA); 331 | LoadFunc_WinMM(waveInGetDevCapsW); 332 | LoadFunc_WinMM(waveInGetErrorTextA); 333 | LoadFunc_WinMM(waveInGetErrorTextW); 334 | LoadFunc_WinMM(waveInGetID); 335 | LoadFunc_WinMM(waveInGetNumDevs); 336 | LoadFunc_WinMM(waveInGetPosition); 337 | LoadFunc_WinMM(waveInMessage); 338 | LoadFunc_WinMM(waveInOpen); 339 | LoadFunc_WinMM(waveInPrepareHeader); 340 | LoadFunc_WinMM(waveInReset); 341 | LoadFunc_WinMM(waveInStart); 342 | LoadFunc_WinMM(waveInStop); 343 | LoadFunc_WinMM(waveInUnprepareHeader); 344 | LoadFunc_WinMM(waveOutBreakLoop); 345 | LoadFunc_WinMM(waveOutClose); 346 | LoadFunc_WinMM(waveOutGetDevCapsA); 347 | LoadFunc_WinMM(waveOutGetDevCapsW); 348 | LoadFunc_WinMM(waveOutGetErrorTextA); 349 | LoadFunc_WinMM(waveOutGetErrorTextW); 350 | LoadFunc_WinMM(waveOutGetID); 351 | LoadFunc_WinMM(waveOutGetNumDevs); 352 | LoadFunc_WinMM(waveOutGetPitch); 353 | LoadFunc_WinMM(waveOutGetPlaybackRate); 354 | LoadFunc_WinMM(waveOutGetPosition); 355 | LoadFunc_WinMM(waveOutGetVolume); 356 | LoadFunc_WinMM(waveOutMessage); 357 | LoadFunc_WinMM(waveOutOpen); 358 | LoadFunc_WinMM(waveOutPause); 359 | LoadFunc_WinMM(waveOutPrepareHeader); 360 | LoadFunc_WinMM(waveOutReset); 361 | LoadFunc_WinMM(waveOutRestart); 362 | LoadFunc_WinMM(waveOutSetPitch); 363 | LoadFunc_WinMM(waveOutSetPlaybackRate); 364 | LoadFunc_WinMM(waveOutSetVolume); 365 | LoadFunc_WinMM(waveOutUnprepareHeader); 366 | LoadFunc_WinMM(waveOutWrite); 367 | 368 | #else 369 | 370 | #error "Unsupported configuration" 371 | 372 | #endif 373 | } 374 | } 375 | 376 | extern "C" 377 | { 378 | #if xSE_PLATFORM_F4SE || xSE_PLATFORM_SKSE64 379 | 380 | DefineFunc_WinHTTP(WinHttpSetSecureLegacyServersAppCompat); 381 | DefineFunc_WinHTTP(DllCanUnloadNow); 382 | DefineFunc_WinHTTP(DllGetClassObject); 383 | DefineFunc_WinHTTP(Private1); 384 | DefineFunc_WinHTTP(SvchostPushServiceGlobals); 385 | DefineFunc_WinHTTP(WinHttpAddRequestHeaders); 386 | DefineFunc_WinHTTP(WinHttpAddRequestHeadersEx); 387 | DefineFunc_WinHTTP(WinHttpAutoProxySvcMain); 388 | DefineFunc_WinHTTP(WinHttpCheckPlatform); 389 | DefineFunc_WinHTTP(WinHttpCloseHandle); 390 | DefineFunc_WinHTTP(WinHttpConnect); 391 | DefineFunc_WinHTTP(WinHttpConnectionDeletePolicyEntries); 392 | DefineFunc_WinHTTP(WinHttpConnectionDeleteProxyInfo); 393 | DefineFunc_WinHTTP(WinHttpConnectionFreeNameList); 394 | DefineFunc_WinHTTP(WinHttpConnectionFreeProxyInfo); 395 | DefineFunc_WinHTTP(WinHttpConnectionFreeProxyList); 396 | DefineFunc_WinHTTP(WinHttpConnectionGetNameList); 397 | DefineFunc_WinHTTP(WinHttpConnectionGetProxyInfo); 398 | DefineFunc_WinHTTP(WinHttpConnectionGetProxyList); 399 | DefineFunc_WinHTTP(WinHttpConnectionOnlyConvert); 400 | DefineFunc_WinHTTP(WinHttpConnectionOnlyReceive); 401 | DefineFunc_WinHTTP(WinHttpConnectionOnlySend); 402 | DefineFunc_WinHTTP(WinHttpConnectionSetPolicyEntries); 403 | DefineFunc_WinHTTP(WinHttpConnectionSetProxyInfo); 404 | DefineFunc_WinHTTP(WinHttpConnectionUpdateIfIndexTable); 405 | DefineFunc_WinHTTP(WinHttpCrackUrl); 406 | DefineFunc_WinHTTP(WinHttpCreateProxyResolver); 407 | DefineFunc_WinHTTP(WinHttpCreateUrl); 408 | DefineFunc_WinHTTP(WinHttpDetectAutoProxyConfigUrl); 409 | DefineFunc_WinHTTP(WinHttpFreeProxyResult); 410 | DefineFunc_WinHTTP(WinHttpFreeProxyResultEx); 411 | DefineFunc_WinHTTP(WinHttpFreeProxySettings); 412 | DefineFunc_WinHTTP(WinHttpFreeProxySettingsEx); 413 | DefineFunc_WinHTTP(WinHttpFreeQueryConnectionGroupResult); 414 | DefineFunc_WinHTTP(WinHttpGetDefaultProxyConfiguration); 415 | DefineFunc_WinHTTP(WinHttpGetIEProxyConfigForCurrentUser); 416 | DefineFunc_WinHTTP(WinHttpGetProxyForUrl); 417 | DefineFunc_WinHTTP(WinHttpGetProxyForUrlEx); 418 | DefineFunc_WinHTTP(WinHttpGetProxyForUrlEx2); 419 | DefineFunc_WinHTTP(WinHttpGetProxyForUrlHvsi); 420 | DefineFunc_WinHTTP(WinHttpGetProxyResult); 421 | DefineFunc_WinHTTP(WinHttpGetProxyResultEx); 422 | DefineFunc_WinHTTP(WinHttpGetProxySettingsEx); 423 | DefineFunc_WinHTTP(WinHttpGetProxySettingsResultEx); 424 | DefineFunc_WinHTTP(WinHttpGetProxySettingsVersion); 425 | DefineFunc_WinHTTP(WinHttpGetTunnelSocket); 426 | DefineFunc_WinHTTP(WinHttpOpen); 427 | DefineFunc_WinHTTP(WinHttpOpenRequest); 428 | DefineFunc_WinHTTP(WinHttpPacJsWorkerMain); 429 | DefineFunc_WinHTTP(WinHttpProbeConnectivity); 430 | DefineFunc_WinHTTP(WinHttpQueryAuthSchemes); 431 | DefineFunc_WinHTTP(WinHttpQueryConnectionGroup); 432 | DefineFunc_WinHTTP(WinHttpQueryDataAvailable); 433 | DefineFunc_WinHTTP(WinHttpQueryHeaders); 434 | DefineFunc_WinHTTP(WinHttpQueryHeadersEx); 435 | DefineFunc_WinHTTP(WinHttpQueryOption); 436 | DefineFunc_WinHTTP(WinHttpReadData); 437 | DefineFunc_WinHTTP(WinHttpReadDataEx); 438 | DefineFunc_WinHTTP(WinHttpReadProxySettings); 439 | DefineFunc_WinHTTP(WinHttpReadProxySettingsHvsi); 440 | DefineFunc_WinHTTP(WinHttpReceiveResponse); 441 | DefineFunc_WinHTTP(WinHttpRegisterProxyChangeNotification); 442 | DefineFunc_WinHTTP(WinHttpResetAutoProxy); 443 | DefineFunc_WinHTTP(WinHttpSaveProxyCredentials); 444 | DefineFunc_WinHTTP(WinHttpSendRequest); 445 | DefineFunc_WinHTTP(WinHttpSetCredentials); 446 | DefineFunc_WinHTTP(WinHttpSetDefaultProxyConfiguration); 447 | DefineFunc_WinHTTP(WinHttpSetOption); 448 | DefineFunc_WinHTTP(WinHttpSetProxySettingsPerUser); 449 | DefineFunc_WinHTTP(WinHttpSetStatusCallback); 450 | DefineFunc_WinHTTP(WinHttpSetTimeouts); 451 | DefineFunc_WinHTTP(WinHttpTimeFromSystemTime); 452 | DefineFunc_WinHTTP(WinHttpTimeToSystemTime); 453 | DefineFunc_WinHTTP(WinHttpUnregisterProxyChangeNotification); 454 | DefineFunc_WinHTTP(WinHttpWebSocketClose); 455 | DefineFunc_WinHTTP(WinHttpWebSocketCompleteUpgrade); 456 | DefineFunc_WinHTTP(WinHttpWebSocketQueryCloseStatus); 457 | DefineFunc_WinHTTP(WinHttpWebSocketReceive); 458 | DefineFunc_WinHTTP(WinHttpWebSocketSend); 459 | DefineFunc_WinHTTP(WinHttpWebSocketShutdown); 460 | DefineFunc_WinHTTP(WinHttpWriteData); 461 | DefineFunc_WinHTTP(WinHttpWriteProxySettings); 462 | 463 | #elif xSE_PLATFORM_SKSE || xSE_PLATFORM_NVSE 464 | 465 | DefineFunc_WinMM(Ordinal2); 466 | DefineFunc_WinMM(CloseDriver); 467 | DefineFunc_WinMM(DefDriverProc); 468 | DefineFunc_WinMM(DriverCallback); 469 | DefineFunc_WinMM(DrvGetModuleHandle); 470 | DefineFunc_WinMM(GetDriverModuleHandle); 471 | DefineFunc_WinMM(OpenDriver); 472 | DefineFunc_WinMM(PlaySound); 473 | DefineFunc_WinMM(PlaySoundA); 474 | DefineFunc_WinMM(PlaySoundW); 475 | DefineFunc_WinMM(SendDriverMessage); 476 | DefineFunc_WinMM(WOWAppExit); 477 | DefineFunc_WinMM(auxGetDevCapsA); 478 | DefineFunc_WinMM(auxGetDevCapsW); 479 | DefineFunc_WinMM(auxGetNumDevs); 480 | DefineFunc_WinMM(auxGetVolume); 481 | DefineFunc_WinMM(auxOutMessage); 482 | DefineFunc_WinMM(auxSetVolume); 483 | DefineFunc_WinMM(joyConfigChanged); 484 | DefineFunc_WinMM(joyGetDevCapsA); 485 | DefineFunc_WinMM(joyGetDevCapsW); 486 | DefineFunc_WinMM(joyGetNumDevs); 487 | DefineFunc_WinMM(joyGetPos); 488 | DefineFunc_WinMM(joyGetPosEx); 489 | DefineFunc_WinMM(joyGetThreshold); 490 | DefineFunc_WinMM(joyReleaseCapture); 491 | DefineFunc_WinMM(joySetCapture); 492 | DefineFunc_WinMM(joySetThreshold); 493 | DefineFunc_WinMM(mciDriverNotify); 494 | DefineFunc_WinMM(mciDriverYield); 495 | DefineFunc_WinMM(mciExecute); 496 | DefineFunc_WinMM(mciFreeCommandResource); 497 | DefineFunc_WinMM(mciGetCreatorTask); 498 | DefineFunc_WinMM(mciGetDeviceIDA); 499 | DefineFunc_WinMM(mciGetDeviceIDFromElementIDA); 500 | DefineFunc_WinMM(mciGetDeviceIDFromElementIDW); 501 | DefineFunc_WinMM(mciGetDeviceIDW); 502 | DefineFunc_WinMM(mciGetDriverData); 503 | DefineFunc_WinMM(mciGetErrorStringA); 504 | DefineFunc_WinMM(mciGetErrorStringW); 505 | DefineFunc_WinMM(mciGetYieldProc); 506 | DefineFunc_WinMM(mciLoadCommandResource); 507 | DefineFunc_WinMM(mciSendCommandA); 508 | DefineFunc_WinMM(mciSendCommandW); 509 | DefineFunc_WinMM(mciSendStringA); 510 | DefineFunc_WinMM(mciSendStringW); 511 | DefineFunc_WinMM(mciSetDriverData); 512 | DefineFunc_WinMM(mciSetYieldProc); 513 | DefineFunc_WinMM(midiConnect); 514 | DefineFunc_WinMM(midiDisconnect); 515 | DefineFunc_WinMM(midiInAddBuffer); 516 | DefineFunc_WinMM(midiInClose); 517 | DefineFunc_WinMM(midiInGetDevCapsA); 518 | DefineFunc_WinMM(midiInGetDevCapsW); 519 | DefineFunc_WinMM(midiInGetErrorTextA); 520 | DefineFunc_WinMM(midiInGetErrorTextW); 521 | DefineFunc_WinMM(midiInGetID); 522 | DefineFunc_WinMM(midiInGetNumDevs); 523 | DefineFunc_WinMM(midiInMessage); 524 | DefineFunc_WinMM(midiInOpen); 525 | DefineFunc_WinMM(midiInPrepareHeader); 526 | DefineFunc_WinMM(midiInReset); 527 | DefineFunc_WinMM(midiInStart); 528 | DefineFunc_WinMM(midiInStop); 529 | DefineFunc_WinMM(midiInUnprepareHeader); 530 | DefineFunc_WinMM(midiOutCacheDrumPatches); 531 | DefineFunc_WinMM(midiOutCachePatches); 532 | DefineFunc_WinMM(midiOutClose); 533 | DefineFunc_WinMM(midiOutGetDevCapsA); 534 | DefineFunc_WinMM(midiOutGetDevCapsW); 535 | DefineFunc_WinMM(midiOutGetErrorTextA); 536 | DefineFunc_WinMM(midiOutGetErrorTextW); 537 | DefineFunc_WinMM(midiOutGetID); 538 | DefineFunc_WinMM(midiOutGetNumDevs); 539 | DefineFunc_WinMM(midiOutGetVolume); 540 | DefineFunc_WinMM(midiOutLongMsg); 541 | DefineFunc_WinMM(midiOutMessage); 542 | DefineFunc_WinMM(midiOutOpen); 543 | DefineFunc_WinMM(midiOutPrepareHeader); 544 | DefineFunc_WinMM(midiOutReset); 545 | DefineFunc_WinMM(midiOutSetVolume); 546 | DefineFunc_WinMM(midiOutShortMsg); 547 | DefineFunc_WinMM(midiOutUnprepareHeader); 548 | DefineFunc_WinMM(midiStreamClose); 549 | DefineFunc_WinMM(midiStreamOpen); 550 | DefineFunc_WinMM(midiStreamOut); 551 | DefineFunc_WinMM(midiStreamPause); 552 | DefineFunc_WinMM(midiStreamPosition); 553 | DefineFunc_WinMM(midiStreamProperty); 554 | DefineFunc_WinMM(midiStreamRestart); 555 | DefineFunc_WinMM(midiStreamStop); 556 | DefineFunc_WinMM(mixerClose); 557 | DefineFunc_WinMM(mixerGetControlDetailsA); 558 | DefineFunc_WinMM(mixerGetControlDetailsW); 559 | DefineFunc_WinMM(mixerGetDevCapsA); 560 | DefineFunc_WinMM(mixerGetDevCapsW); 561 | DefineFunc_WinMM(mixerGetID); 562 | DefineFunc_WinMM(mixerGetLineControlsA); 563 | DefineFunc_WinMM(mixerGetLineControlsW); 564 | DefineFunc_WinMM(mixerGetLineInfoA); 565 | DefineFunc_WinMM(mixerGetLineInfoW); 566 | DefineFunc_WinMM(mixerGetNumDevs); 567 | DefineFunc_WinMM(mixerMessage); 568 | DefineFunc_WinMM(mixerOpen); 569 | DefineFunc_WinMM(mixerSetControlDetails); 570 | DefineFunc_WinMM(mmDrvInstall); 571 | DefineFunc_WinMM(mmGetCurrentTask); 572 | DefineFunc_WinMM(mmTaskBlock); 573 | DefineFunc_WinMM(mmTaskCreate); 574 | DefineFunc_WinMM(mmTaskSignal); 575 | DefineFunc_WinMM(mmTaskYield); 576 | DefineFunc_WinMM(mmioAdvance); 577 | DefineFunc_WinMM(mmioAscend); 578 | DefineFunc_WinMM(mmioClose); 579 | DefineFunc_WinMM(mmioCreateChunk); 580 | DefineFunc_WinMM(mmioDescend); 581 | DefineFunc_WinMM(mmioFlush); 582 | DefineFunc_WinMM(mmioGetInfo); 583 | DefineFunc_WinMM(mmioInstallIOProcA); 584 | DefineFunc_WinMM(mmioInstallIOProcW); 585 | DefineFunc_WinMM(mmioOpenA); 586 | DefineFunc_WinMM(mmioOpenW); 587 | DefineFunc_WinMM(mmioRead); 588 | DefineFunc_WinMM(mmioRenameA); 589 | DefineFunc_WinMM(mmioRenameW); 590 | DefineFunc_WinMM(mmioSeek); 591 | DefineFunc_WinMM(mmioSendMessage); 592 | DefineFunc_WinMM(mmioSetBuffer); 593 | DefineFunc_WinMM(mmioSetInfo); 594 | DefineFunc_WinMM(mmioStringToFOURCCA); 595 | DefineFunc_WinMM(mmioStringToFOURCCW); 596 | DefineFunc_WinMM(mmioWrite); 597 | DefineFunc_WinMM(mmsystemGetVersion); 598 | DefineFunc_WinMM(sndPlaySoundA); 599 | DefineFunc_WinMM(sndPlaySoundW); 600 | DefineFunc_WinMM(timeBeginPeriod); 601 | DefineFunc_WinMM(timeEndPeriod); 602 | DefineFunc_WinMM(timeGetDevCaps); 603 | DefineFunc_WinMM(timeGetSystemTime); 604 | DefineFunc_WinMM(timeGetTime); 605 | DefineFunc_WinMM(timeKillEvent); 606 | DefineFunc_WinMM(timeSetEvent); 607 | DefineFunc_WinMM(waveInAddBuffer); 608 | DefineFunc_WinMM(waveInClose); 609 | DefineFunc_WinMM(waveInGetDevCapsA); 610 | DefineFunc_WinMM(waveInGetDevCapsW); 611 | DefineFunc_WinMM(waveInGetErrorTextA); 612 | DefineFunc_WinMM(waveInGetErrorTextW); 613 | DefineFunc_WinMM(waveInGetID); 614 | DefineFunc_WinMM(waveInGetNumDevs); 615 | DefineFunc_WinMM(waveInGetPosition); 616 | DefineFunc_WinMM(waveInMessage); 617 | DefineFunc_WinMM(waveInOpen); 618 | DefineFunc_WinMM(waveInPrepareHeader); 619 | DefineFunc_WinMM(waveInReset); 620 | DefineFunc_WinMM(waveInStart); 621 | DefineFunc_WinMM(waveInStop); 622 | DefineFunc_WinMM(waveInUnprepareHeader); 623 | DefineFunc_WinMM(waveOutBreakLoop); 624 | DefineFunc_WinMM(waveOutClose); 625 | DefineFunc_WinMM(waveOutGetDevCapsA); 626 | DefineFunc_WinMM(waveOutGetDevCapsW); 627 | DefineFunc_WinMM(waveOutGetErrorTextA); 628 | DefineFunc_WinMM(waveOutGetErrorTextW); 629 | DefineFunc_WinMM(waveOutGetID); 630 | DefineFunc_WinMM(waveOutGetNumDevs); 631 | DefineFunc_WinMM(waveOutGetPitch); 632 | DefineFunc_WinMM(waveOutGetPlaybackRate); 633 | DefineFunc_WinMM(waveOutGetPosition); 634 | DefineFunc_WinMM(waveOutGetVolume); 635 | DefineFunc_WinMM(waveOutMessage); 636 | DefineFunc_WinMM(waveOutOpen); 637 | DefineFunc_WinMM(waveOutPause); 638 | DefineFunc_WinMM(waveOutPrepareHeader); 639 | DefineFunc_WinMM(waveOutReset); 640 | DefineFunc_WinMM(waveOutRestart); 641 | DefineFunc_WinMM(waveOutSetPitch); 642 | DefineFunc_WinMM(waveOutSetPlaybackRate); 643 | DefineFunc_WinMM(waveOutSetVolume); 644 | DefineFunc_WinMM(waveOutUnprepareHeader); 645 | DefineFunc_WinMM(waveOutWrite); 646 | 647 | #else 648 | 649 | #error "Unsupported configuration" 650 | 651 | #endif 652 | }; 653 | -------------------------------------------------------------------------------- /xSE PluginPreloader.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | F4SE 6 | Win32 7 | 8 | 9 | F4SE 10 | x64 11 | 12 | 13 | NVSE 14 | Win32 15 | 16 | 17 | NVSE 18 | x64 19 | 20 | 21 | SKSE64 22 | Win32 23 | 24 | 25 | SKSE64 26 | x64 27 | 28 | 29 | SKSE 30 | Win32 31 | 32 | 33 | SKSE 34 | x64 35 | 36 | 37 | 38 | 15.0 39 | {D8462034-E42F-47A3-863E-E6BC7252C178} 40 | Win32Proj 41 | GenericDLLPreloader 42 | 10.0 43 | 44 | 45 | 46 | DynamicLibrary 47 | false 48 | v143 49 | true 50 | Unicode 51 | 52 | 53 | DynamicLibrary 54 | false 55 | v143 56 | true 57 | Unicode 58 | 59 | 60 | DynamicLibrary 61 | false 62 | v143 63 | true 64 | Unicode 65 | 66 | 67 | DynamicLibrary 68 | false 69 | v143 70 | true 71 | Unicode 72 | 73 | 74 | DynamicLibrary 75 | false 76 | v143 77 | true 78 | Unicode 79 | 80 | 81 | DynamicLibrary 82 | false 83 | v143 84 | true 85 | Unicode 86 | 87 | 88 | DynamicLibrary 89 | false 90 | v143 91 | true 92 | Unicode 93 | 94 | 95 | DynamicLibrary 96 | false 97 | v143 98 | true 99 | Unicode 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | false 134 | $(ProjectDir)Junk\$(Configuration) $(Platform)\ 135 | $(ProjectDir)Build\$(Configuration) $(Platform)\ 136 | WinHTTP 137 | 138 | 139 | false 140 | $(ProjectDir)Junk\$(Configuration) $(Platform)\ 141 | $(ProjectDir)Build\$(Configuration) $(Platform)\ 142 | WinHTTP 143 | 144 | 145 | false 146 | $(ProjectDir)Junk\$(Configuration) $(Platform)\ 147 | $(ProjectDir)Build\$(Configuration) $(Platform)\ 148 | WinMM 149 | 150 | 151 | false 152 | $(ProjectDir)Junk\$(Configuration) $(Platform)\ 153 | $(ProjectDir)Build\$(Configuration) $(Platform)\ 154 | WinMM 155 | 156 | 157 | false 158 | $(ProjectDir)Junk\$(Configuration) $(Platform)\ 159 | $(ProjectDir)Build\$(Configuration) $(Platform)\ 160 | WinHTTP 161 | 162 | 163 | false 164 | $(ProjectDir)Junk\$(Configuration) $(Platform)\ 165 | $(ProjectDir)Build\$(Configuration) $(Platform)\ 166 | WinHTTP 167 | 168 | 169 | false 170 | $(ProjectDir)Junk\$(Configuration) $(Platform)\ 171 | $(ProjectDir)Build\$(Configuration) $(Platform)\ 172 | WinMM 173 | 174 | 175 | false 176 | $(ProjectDir)Junk\$(Configuration) $(Platform)\ 177 | $(ProjectDir)Build\$(Configuration) $(Platform)\ 178 | WinMM 179 | 180 | 181 | Release 182 | 183 | 184 | Release 185 | 186 | 187 | Release 188 | 189 | 190 | Release 191 | 192 | 193 | Release 194 | 195 | 196 | Release 197 | 198 | 199 | Release 200 | 201 | 202 | Release 203 | 204 | 205 | 206 | KXF_STATIC_LIBRARY;%(PreprocessorDefinitions) 207 | 208 | 209 | 210 | 211 | Use 212 | Level3 213 | MaxSpeed 214 | true 215 | true 216 | true 217 | xSE_PLATFORM_$(Configuration);_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;KXF_STATIC_LIBRARY;WIN32;NDEBUG;GENERICDLLPRELOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 218 | true 219 | $(ProjectDir);$(ProjectDir)Source;%(AdditionalIncludeDirectories) 220 | stdcpplatest 221 | MultiThreaded 222 | NoListing 223 | true 224 | $(IntDir)%(RelativeDir) 225 | pch.hpp 226 | Sync 227 | 228 | 229 | Windows 230 | true 231 | true 232 | true 233 | $(ProjectDir) 234 | Exports\$(Configuration).def 235 | true 236 | 237 | 238 | mkdir "$(ProjectDir)Bin\$(Configuration)" 239 | copy "$(TargetPath)" "$(ProjectDir)Bin\$(Configuration)\$(TargetName)$(TargetExt)" 240 | copy "$(ProjectDir)Build\$(SolutionName).xml" "$(ProjectDir)Bin\$(Configuration)\$(SolutionName).xml" 241 | 242 | 243 | 244 | 245 | Use 246 | Level3 247 | MaxSpeed 248 | true 249 | true 250 | true 251 | xSE_PLATFORM_$(Configuration);_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;KXF_STATIC_LIBRARY;WIN32;NDEBUG;GENERICDLLPRELOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 252 | true 253 | $(ProjectDir);$(ProjectDir)Source;%(AdditionalIncludeDirectories) 254 | stdcpplatest 255 | MultiThreaded 256 | NoListing 257 | true 258 | $(IntDir)%(RelativeDir) 259 | pch.hpp 260 | Sync 261 | 262 | 263 | Windows 264 | true 265 | true 266 | true 267 | $(ProjectDir) 268 | Exports\$(Configuration).def 269 | true 270 | 271 | 272 | mkdir "$(ProjectDir)Bin\$(Configuration)" 273 | copy "$(TargetPath)" "$(ProjectDir)Bin\$(Configuration)\$(TargetName)$(TargetExt)" 274 | copy "$(ProjectDir)Build\$(SolutionName).xml" "$(ProjectDir)Bin\$(Configuration)\$(SolutionName).xml" 275 | 276 | 277 | 278 | 279 | Use 280 | Level3 281 | MaxSpeed 282 | true 283 | true 284 | true 285 | xSE_PLATFORM_$(Configuration);_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;KXF_STATIC_LIBRARY;WIN32;NDEBUG;GENERICDLLPRELOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 286 | true 287 | $(ProjectDir);$(ProjectDir)Source;%(AdditionalIncludeDirectories) 288 | stdcpplatest 289 | MultiThreaded 290 | NoListing 291 | true 292 | $(IntDir)%(RelativeDir) 293 | pch.hpp 294 | Sync 295 | 296 | 297 | Windows 298 | true 299 | true 300 | true 301 | $(ProjectDir) 302 | Exports\$(Configuration).def 303 | true 304 | 305 | 306 | mkdir "$(ProjectDir)Bin\$(Configuration)" 307 | copy "$(TargetPath)" "$(ProjectDir)Bin\$(Configuration)\$(TargetName)$(TargetExt)" 308 | copy "$(ProjectDir)Build\$(SolutionName).xml" "$(ProjectDir)Bin\$(Configuration)\$(SolutionName).xml" 309 | 310 | 311 | 312 | 313 | Use 314 | Level3 315 | MaxSpeed 316 | true 317 | true 318 | true 319 | xSE_PLATFORM_$(Configuration);_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;KXF_STATIC_LIBRARY;WIN32;NDEBUG;GENERICDLLPRELOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 320 | true 321 | $(ProjectDir);$(ProjectDir)Source;%(AdditionalIncludeDirectories) 322 | stdcpplatest 323 | MultiThreaded 324 | NoListing 325 | true 326 | $(IntDir)%(RelativeDir) 327 | pch.hpp 328 | Sync 329 | 330 | 331 | Windows 332 | true 333 | true 334 | true 335 | $(ProjectDir) 336 | Exports\$(Configuration).def 337 | true 338 | 339 | 340 | mkdir "$(ProjectDir)Bin\$(Configuration)" 341 | copy "$(TargetPath)" "$(ProjectDir)Bin\$(Configuration)\$(TargetName)$(TargetExt)" 342 | copy "$(ProjectDir)Build\$(SolutionName).xml" "$(ProjectDir)Bin\$(Configuration)\$(SolutionName).xml" 343 | 344 | 345 | 346 | 347 | Use 348 | Level3 349 | MaxSpeed 350 | true 351 | true 352 | true 353 | xSE_PLATFORM_$(Configuration);_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;KXF_STATIC_LIBRARY;NDEBUG;GENERICDLLPRELOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 354 | true 355 | $(ProjectDir);$(ProjectDir)Source;%(AdditionalIncludeDirectories) 356 | stdcpplatest 357 | MultiThreaded 358 | NoListing 359 | true 360 | $(IntDir)%(RelativeDir) 361 | pch.hpp 362 | Sync 363 | 364 | 365 | Windows 366 | true 367 | true 368 | true 369 | $(ProjectDir) 370 | Exports\$(Configuration).def 371 | true 372 | 373 | 374 | mkdir "$(ProjectDir)Bin\$(Configuration)" 375 | copy "$(TargetPath)" "$(ProjectDir)Bin\$(Configuration)\$(TargetName)$(TargetExt)" 376 | copy "$(ProjectDir)Build\$(SolutionName).xml" "$(ProjectDir)Bin\$(Configuration)\$(SolutionName).xml" 377 | 378 | 379 | 380 | 381 | Use 382 | Level3 383 | MaxSpeed 384 | true 385 | true 386 | true 387 | xSE_PLATFORM_$(Configuration);_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;KXF_STATIC_LIBRARY;NDEBUG;GENERICDLLPRELOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 388 | true 389 | $(ProjectDir);$(ProjectDir)Source;%(AdditionalIncludeDirectories) 390 | stdcpplatest 391 | MultiThreaded 392 | NoListing 393 | true 394 | $(IntDir)%(RelativeDir) 395 | pch.hpp 396 | Sync 397 | 398 | 399 | Windows 400 | true 401 | true 402 | true 403 | $(ProjectDir) 404 | Exports\$(Configuration).def 405 | true 406 | 407 | 408 | mkdir "$(ProjectDir)Bin\$(Configuration)" 409 | copy "$(TargetPath)" "$(ProjectDir)Bin\$(Configuration)\$(TargetName)$(TargetExt)" 410 | copy "$(ProjectDir)Build\$(SolutionName).xml" "$(ProjectDir)Bin\$(Configuration)\$(SolutionName).xml" 411 | 412 | 413 | 414 | 415 | Use 416 | Level3 417 | MaxSpeed 418 | true 419 | true 420 | true 421 | xSE_PLATFORM_$(Configuration);_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;KXF_STATIC_LIBRARY;NDEBUG;GENERICDLLPRELOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 422 | true 423 | $(ProjectDir);$(ProjectDir)Source;%(AdditionalIncludeDirectories) 424 | stdcpplatest 425 | MultiThreaded 426 | NoListing 427 | true 428 | $(IntDir)%(RelativeDir) 429 | pch.hpp 430 | Sync 431 | 432 | 433 | Windows 434 | true 435 | true 436 | true 437 | $(ProjectDir) 438 | Exports\$(Configuration).def 439 | true 440 | 441 | 442 | mkdir "$(ProjectDir)Bin\$(Configuration)" 443 | copy "$(TargetPath)" "$(ProjectDir)Bin\$(Configuration)\$(TargetName)$(TargetExt)" 444 | copy "$(ProjectDir)Build\$(SolutionName).xml" "$(ProjectDir)Bin\$(Configuration)\$(SolutionName).xml" 445 | 446 | 447 | 448 | 449 | Use 450 | Level3 451 | MaxSpeed 452 | true 453 | true 454 | true 455 | xSE_PLATFORM_$(Configuration);_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;KXF_STATIC_LIBRARY;NDEBUG;GENERICDLLPRELOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 456 | true 457 | $(ProjectDir);$(ProjectDir)Source;%(AdditionalIncludeDirectories) 458 | stdcpplatest 459 | MultiThreaded 460 | NoListing 461 | true 462 | $(IntDir)%(RelativeDir) 463 | pch.hpp 464 | Sync 465 | 466 | 467 | Windows 468 | true 469 | true 470 | true 471 | $(ProjectDir) 472 | Exports\$(Configuration).def 473 | true 474 | 475 | 476 | mkdir "$(ProjectDir)Bin\$(Configuration)" 477 | copy "$(TargetPath)" "$(ProjectDir)Bin\$(Configuration)\$(TargetName)$(TargetExt)" 478 | copy "$(ProjectDir)Build\$(SolutionName).xml" "$(ProjectDir)Bin\$(Configuration)\$(SolutionName).xml" 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | Create 505 | Create 506 | pch.hpp 507 | pch.hpp 508 | Create 509 | Create 510 | pch.hpp 511 | pch.hpp 512 | Create 513 | Create 514 | pch.hpp 515 | pch.hpp 516 | Create 517 | Create 518 | pch.hpp 519 | pch.hpp 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | Document 528 | true 529 | true 530 | true 531 | true 532 | false 533 | false 534 | false 535 | false 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------