├── .gitignore ├── SafeDiscShim.sdb ├── src ├── pch.cpp ├── logging.h ├── version.h.in ├── secdrv_ioctl.h ├── process.h ├── pch.h ├── vcpkg.json ├── CMakeLists.txt ├── logging.cpp ├── hooks.h ├── process.cpp ├── secdrv_ioctl.cpp ├── hooks.cpp └── dllmain.cpp ├── README.md ├── SafeDiscShim.sdb.xml ├── installer ├── installer.iss └── license.rtf └── LICENSE.md /.gitignore: -------------------------------------------------------------------------------- 1 | /src/build/ 2 | /.idea/ 3 | -------------------------------------------------------------------------------- /SafeDiscShim.sdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RibShark/SafeDiscShim/HEAD/SafeDiscShim.sdb -------------------------------------------------------------------------------- /src/pch.cpp: -------------------------------------------------------------------------------- 1 | // pch.cpp: source file corresponding to the pre-compiled header 2 | 3 | #include "pch.h" 4 | 5 | // When you are using pre-compiled headers, this source file is necessary for compilation to succeed. 6 | -------------------------------------------------------------------------------- /src/logging.h: -------------------------------------------------------------------------------- 1 | #ifndef LOGGER_H 2 | #define LOGGER_H 3 | #include 4 | 5 | namespace logging { 6 | typedef spdlog::level::level_enum level; 7 | 8 | void SetupLogger(); 9 | void SetLoggerFileName(const std::string&); 10 | } 11 | 12 | #endif //LOGGER_H 13 | -------------------------------------------------------------------------------- /src/version.h.in: -------------------------------------------------------------------------------- 1 | #ifndef VERSION_H 2 | #define VERSION_H 3 | 4 | #define SAFEDISCSHIM_VERSION_MAJOR @SafeDiscShim_VERSION_MAJOR@ 5 | #define SAFEDISCSHIM_VERSION_MINOR @SafeDiscShim_VERSION_MINOR@ 6 | #define SAFEDISCSHIM_VERSION_PATCH @SafeDiscShim_VERSION_PATCH@ 7 | 8 | #endif //VERSION_H 9 | -------------------------------------------------------------------------------- /src/secdrv_ioctl.h: -------------------------------------------------------------------------------- 1 | #ifndef SAFEDISCSHIM_SECDRV_IOCTL_H 2 | #define SAFEDISCSHIM_SECDRV_IOCTL_H 3 | 4 | #include 5 | 6 | namespace secdrvIoctl 7 | { 8 | constexpr ULONG ioctlCodeMain = 0xef002407; 9 | 10 | BOOL ProcessMainIoctl(LPVOID lpInBuffer, 11 | DWORD nInBufferSize, 12 | LPVOID lpOutBuffer, 13 | DWORD nOutBufferSize); 14 | } 15 | 16 | #endif // SAFEDISCSHIM_SECDRV_IOCTL_H 17 | -------------------------------------------------------------------------------- /src/process.h: -------------------------------------------------------------------------------- 1 | #ifndef RELAUNCH_H 2 | #define RELAUNCH_H 3 | 4 | class Process { 5 | HANDLE hProcess; 6 | PEB peb {}; 7 | RTL_USER_PROCESS_PARAMETERS processParameters {}; 8 | std::wstring commandLine; 9 | std::wstring currentDirectory; 10 | 11 | bool GetPEB(); 12 | bool GetProcessParameters(); 13 | bool GetCommandLine_(); 14 | bool GetCurrentDirectory_(); 15 | 16 | public: 17 | explicit Process(HANDLE hProcess); 18 | void InjectIntoExecutable(HANDLE, bool); 19 | void Relaunch(); 20 | }; 21 | 22 | #endif //RELAUNCH_H 23 | -------------------------------------------------------------------------------- /src/pch.h: -------------------------------------------------------------------------------- 1 | // pch.h: This is a precompiled header file. 2 | // Files listed below are compiled only once, improving build performance for future builds. 3 | // This also affects IntelliSense performance, including code completion and many code browsing features. 4 | // However, files listed here are ALL re-compiled if any one of them is updated between builds. 5 | // Do not add files here that you will be updating frequently as this negates the performance advantage. 6 | 7 | #ifndef PCH_H 8 | #define PCH_H 9 | 10 | // add headers that you want to pre-compile here 11 | #define WIN32_LEAN_AND_MEAN 12 | #define NOMINMAX 13 | #include 14 | 15 | #endif //PCH_H 16 | -------------------------------------------------------------------------------- /src/vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema" : "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", 3 | "builtin-baseline" : "4334d8b4c8916018600212ab4dd4bbdc343065d1", 4 | "dependencies" : [ { 5 | "name" : "fmt", 6 | "version>=" : "10.2.1" 7 | }, { 8 | "name" : "minhook", 9 | "version>=" : "1.3.3#4" 10 | }, { 11 | "name" : "spdlog", 12 | "version>=" : "1.13.0", 13 | "features" : [ "wchar" ] 14 | }, { 15 | "name" : "vcpkg-cmake-config", 16 | "version>=" : "2022-02-06#1" 17 | }, { 18 | "name" : "vcpkg-cmake", 19 | "version>=" : "2023-05-04" 20 | }, { 21 | "name" : "phnt", 22 | "version>=" : "2025-02-05" 23 | } ] 24 | } -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.26) 2 | 3 | set(VCPKG_TARGET_TRIPLET "x86-windows-static") 4 | project(SafeDiscShim VERSION 0.9.0 5 | DESCRIPTION "" 6 | LANGUAGES CXX) 7 | 8 | set(CMAKE_CXX_STANDARD 20) 9 | 10 | add_library(${PROJECT_NAME} SHARED 11 | dllmain.cpp 12 | pch.cpp 13 | pch.h 14 | hooks.cpp 15 | hooks.h 16 | secdrv_ioctl.h 17 | secdrv_ioctl.cpp 18 | logging.cpp 19 | logging.h 20 | process.cpp 21 | process.h 22 | ) 23 | target_precompile_headers(${PROJECT_NAME} PRIVATE pch.h) 24 | set_property(TARGET ${PROJECT_NAME} PROPERTY 25 | MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") 26 | configure_file(version.h.in version.h) 27 | target_include_directories(${PROJECT_NAME} PUBLIC "${PROJECT_BINARY_DIR}") 28 | 29 | find_path(PHNT_INCLUDE_DIRS "ntbcd.h") 30 | target_include_directories(${PROJECT_NAME} PRIVATE ${PHNT_INCLUDE_DIRS}) 31 | 32 | set_target_properties(${PROJECT_NAME} PROPERTIES 33 | OUTPUT_NAME "drvmgt") 34 | 35 | find_package(spdlog CONFIG REQUIRED) 36 | find_package(minhook CONFIG REQUIRED) 37 | 38 | target_link_libraries(${PROJECT_NAME} PRIVATE ntdll spdlog::spdlog minhook::minhook ) 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SafeDiscShim 2 | ## Disclaimer 3 | SafeDiscShim is purely designed as a compatibility tool: no security mechanisms are bypassed in the operation of this 4 | tool and SafeDisc protected games still require their original discs in order to function, even when using this tool. 5 | Certain games may have additional compatibility issues outside of the SafeDisc protection; this tool makes no attempt to 6 | fix such issues. Due to the techniques used, certain anti-malware programs may wrongly detect this software as being 7 | malicious. 8 | 9 | ## Introduction 10 | SafeDiscShim is a compatibility tool that allows for SafeDisc protected games which utilize the insecure Macrovision 11 | Security Driver ("secdrv.sys") to run on modern versions of Windows which have said driver blacklisted. Previous methods 12 | to restore functionality to these games relied on forcefully installing the driver, potentially opening security risks. 13 | 14 | In contrast, this tool does not rely on any drivers to function. Instead, it automatically loads alongside SafeDisc 15 | protected games and intercepts any communication requests that would have been sent to the driver, instead sending the 16 | expected response itself and allowing the game to boot. 17 | 18 | ## Installation Instructions 19 | Simply download the [latest release](https://github.com/RibShark/SafeDiscShim/releases/latest) and run the installer. 20 | Once installed, SafeDiscShim should automatically insert itself into most SafeDisc protected games. 21 | 22 | ## Logging 23 | To aid with debugging, beta versions of SafeDiscShim will automatically create log files in the same folder as the 24 | executable. If you wish to disable this, set the environment variable "SAFEDISCSHIM_LOGLEVEL" with a value of "none". 25 | -------------------------------------------------------------------------------- /src/logging.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include "logging.h" 7 | #include "version.h" 8 | 9 | namespace { 10 | auto ringbufferSink = std::make_shared(32); 11 | } 12 | 13 | void logging::SetupLogger() { 14 | /* Set log level */ 15 | TCHAR envLogLevel[32767]; 16 | GetEnvironmentVariable("SAFEDISCSHIM_LOGLEVEL", envLogLevel, sizeof(envLogLevel)); 17 | if ( GetLastError() == ERROR_ENVVAR_NOT_FOUND ) { 18 | #ifdef _DEBUG 19 | spdlog::set_level(spdlog::level::trace); 20 | #else 21 | // don't output logs if envvar is not defined 22 | return; 23 | #endif 24 | } 25 | else spdlog::cfg::helpers::load_levels(envLogLevel); 26 | 27 | /* Return early if logs are off, so files are not created */ 28 | if ( spdlog::get_level() == spdlog::level::off ) 29 | return; 30 | 31 | /* Log to ringbuffer until we can determine log file name later */ 32 | auto logger = std::make_shared("ringbuffer", ringbufferSink); 33 | spdlog::set_default_logger(logger); 34 | 35 | spdlog::set_pattern("[%Y-%m-%d %H:%M:%S.%e] [%l] %v"); 36 | spdlog::flush_on(spdlog::level::trace); 37 | 38 | spdlog::info("SafeDiscShim version {}.{}.{}", SAFEDISCSHIM_VERSION_MAJOR, 39 | SAFEDISCSHIM_VERSION_MINOR, SAFEDISCSHIM_VERSION_PATCH); 40 | } 41 | 42 | void logging::SetLoggerFileName(const std::string& fileName) { 43 | try { 44 | const auto logger = spdlog::basic_logger_mt("file", 45 | fileName, true); 46 | spdlog::set_default_logger(logger); 47 | } 48 | catch (const spdlog::spdlog_ex &ex) { 49 | spdlog::info("Error logging to file ({}), logging to stdout instead.", 50 | ex.what()); 51 | } 52 | 53 | // temporarily remove formatting since ringbuffer logs are already formatted 54 | spdlog::set_pattern("%v"); 55 | 56 | std::vector logMessages = ringbufferSink->last_formatted(); 57 | 58 | // output all logs in buffer to file 59 | for (const auto& message : logMessages) { 60 | spdlog::info(message); 61 | } 62 | // restore formatting 63 | spdlog::set_pattern("[%Y-%m-%d %H:%M:%S.%e] [%l] %v"); 64 | } 65 | -------------------------------------------------------------------------------- /SafeDiscShim.sdb.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /installer/installer.iss: -------------------------------------------------------------------------------- 1 | #define SDB_GUID "{001827e2-fa73-4907-81de-5596bc8e3d37}" 2 | #define DEBUG 3 | 4 | [Setup] 5 | WizardStyle=modern 6 | AppName=SafeDiscShim 7 | AppVersion=0.9.0 8 | AppId={{97FE301F-3933-4406-97C0-480C21D61118} 9 | RestartIfNeededByRun=False 10 | AllowCancelDuringInstall=False 11 | CreateAppDir=False 12 | ShowLanguageDialog=no 13 | DisableProgramGroupPage=yes 14 | AppendDefaultGroupName=False 15 | AllowNoIcons=True 16 | UninstallFilesDir={autocf}\SafeDiscShim 17 | OutputBaseFilename=SafeDiscShim_Setup_{#SetupSetting("AppVersion")} 18 | #ifdef DEBUG 19 | OutputDir=..\src\build\debug 20 | #else 21 | OutputDir=..\src\build\release 22 | #endif 23 | ArchitecturesInstallIn64BitMode=x64compatible 24 | UninstallDisplayName=SafeDiscShim 25 | UninstallDisplayIcon={uninstallexe} 26 | InfoBeforeFile=X:\SafeDiscShim\installer\license.rtf 27 | ChangesEnvironment=yes 28 | 29 | [Registry] 30 | Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: string; ValueName: "__COMPAT_LAYER"; ValueData: "RedirectDrvMgt" 31 | 32 | [Messages] 33 | ReadyLabel1= 34 | ReadyLabel2b=This tool will install a compatibility fix onto your computer, allowing for SafeDisc protected games and programs to run without the Macrovision Security Driver ("secdrv.sys"), which is blocked on updated versions of Windows.%n%nClick Install to continue with the installation. 35 | FinishedHeadingLabel=SafeDiscShim was installed successfully 36 | FinishedLabelNoIcons=SafeDiscShim has been successfully installed onto your computer. 37 | UninstallAppFullTitle=%1 - Uninstaller 38 | ConfirmUninstall=Are you sure you want to remove %1? Games protected with SafeDisc that utilize the Macrovision Security Driver ("secdrv.sys") may stop working. 39 | 40 | [Code] 41 | procedure RemoveUninstallEntry(); 42 | begin 43 | RegDeleteKeyIncludingSubkeys(HKEY_LOCAL_MACHINE, 44 | 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#SDB_GUID}.sdb'); 45 | end; 46 | 47 | [Files] 48 | #ifdef DEBUG 49 | Source: "..\src\build\debug\drvmgt.dll"; DestDir: "{syswow64}"; DestName: "drvmgt.dll"; Flags: ignoreversion 50 | #else 51 | Source: "..\src\build\release\drvmgt.dll"; DestDir: "{syswow64}"; DestName: "drvmgt.dll"; Flags: ignoreversion 52 | #endif 53 | Source: "..\SafeDiscShim.sdb"; DestDir: "{tmp}"; DestName: "SafeDiscShim.sdb"; Flags: ignoreversion deleteafterinstall 54 | 55 | [Run] 56 | Filename: "sdbinst.exe"; Parameters: "-q SafeDiscShim.sdb"; WorkingDir: "{tmp}"; Flags: runhidden waituntilterminated; Description: "Install SDB database"; AfterInstall: RemoveUninstallEntry 57 | 58 | [UninstallRun] 59 | Filename: "sdbinst.exe"; Parameters: "-q -u -g {{#SDB_GUID}"; Flags: runhidden; RunOnceId: "SafeDiscShim_Uninstall" 60 | -------------------------------------------------------------------------------- /src/hooks.h: -------------------------------------------------------------------------------- 1 | #ifndef SAFEDISCSHIM_HOOKS_H 2 | #define SAFEDISCSHIM_HOOKS_H 3 | #include 4 | #include 5 | 6 | namespace hooks { 7 | inline decltype(NtDeviceIoControlFile)* NtDeviceIoControlFile_Orig; 8 | NTSTATUS NTAPI NtDeviceIoControlFile_Hook(HANDLE FileHandle, 9 | HANDLE Event, 10 | PIO_APC_ROUTINE ApcRoutine, 11 | PVOID ApcContext, 12 | PIO_STATUS_BLOCK IoStatusBlock, 13 | ULONG IoControlCode, 14 | PVOID InputBuffer, 15 | ULONG InputBufferLength, 16 | PVOID OutputBuffer, 17 | ULONG OutputBufferLength); 18 | 19 | inline decltype(CreateFileA)* CreateFileA_Orig; 20 | HANDLE WINAPI CreateFileA_Hook(LPCSTR lpFileName, 21 | DWORD dwDesiredAccess, 22 | DWORD dwShareMode, 23 | LPSECURITY_ATTRIBUTES lpSecurityAttributes, 24 | DWORD dwCreationDisposition, 25 | DWORD dwFlagsAndAttributes, 26 | HANDLE hTemplateFile); 27 | 28 | inline decltype(CreateProcessA)* CreateProcessA_Orig; 29 | BOOL WINAPI CreateProcessA_Hook(LPCSTR lpApplicationName, 30 | LPSTR lpCommandLine, 31 | LPSECURITY_ATTRIBUTES lpProcessAttributes, 32 | LPSECURITY_ATTRIBUTES lpThreadAttributes, 33 | BOOL bInheritHandles, 34 | DWORD dwCreationFlags, 35 | LPVOID lpEnvironment, 36 | LPCSTR lpCurrentDirectory, 37 | LPSTARTUPINFOA lpStartupInfo, 38 | LPPROCESS_INFORMATION lpProcessInformation); 39 | 40 | inline decltype(CreateProcessW)* CreateProcessW_Orig; 41 | BOOL WINAPI CreateProcessW_Hook(LPCWSTR lpApplicationName, 42 | LPWSTR lpCommandLine, 43 | LPSECURITY_ATTRIBUTES lpProcessAttributes, 44 | LPSECURITY_ATTRIBUTES lpThreadAttributes, 45 | BOOL bInheritHandles, 46 | DWORD dwCreationFlags, 47 | LPVOID lpEnvironment, 48 | LPCWSTR lpCurrentDirectory, 49 | LPSTARTUPINFOW lpStartupInfo, 50 | LPPROCESS_INFORMATION lpProcessInformation); 51 | } 52 | 53 | #endif // SAFEDISCSHIM_HOOKS_H 54 | -------------------------------------------------------------------------------- /src/process.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | #include "process.h" 8 | #include "logging.h" 9 | 10 | namespace 11 | { 12 | struct InjectStruct { 13 | decltype(LoadLibraryA)* pLoadLibraryA; 14 | decltype(GetProcAddress)* pGetProcAddress; 15 | char dllName[MAX_PATH]; 16 | char dllFunc[MAX_PATH]; 17 | }; 18 | } 19 | 20 | Process::Process(HANDLE hProcess) { 21 | this->hProcess = hProcess; 22 | if ( !GetPEB() ) return; 23 | if ( !GetProcessParameters() ) return; 24 | if ( !GetCommandLine_() ) return; 25 | if ( !GetCurrentDirectory_() ) return; 26 | } 27 | 28 | bool Process::GetPEB() { 29 | PROCESS_BASIC_INFORMATION pbi; 30 | NTSTATUS status = NtQueryInformationProcess(hProcess, ProcessBasicInformation, 31 | &pbi, sizeof(pbi), nullptr); 32 | if ( !NT_SUCCESS(status) || !pbi.PebBaseAddress ) { 33 | spdlog::critical("Unable to get PEB address"); 34 | return false; 35 | } 36 | 37 | if ( !ReadProcessMemory(hProcess, pbi.PebBaseAddress, 38 | &peb, sizeof(peb), nullptr) ) { 39 | spdlog::critical("Unable to read PEB"); 40 | return false; 41 | } 42 | return true; 43 | } 44 | 45 | bool Process::GetProcessParameters() { 46 | if ( !ReadProcessMemory(hProcess, peb.ProcessParameters, 47 | &processParameters, sizeof(processParameters), nullptr) ) { 48 | spdlog::critical("Unable to read ProcessParameters"); 49 | return false; 50 | } 51 | return true; 52 | } 53 | 54 | bool Process::GetCommandLine_() { 55 | UNICODE_STRING &cmdLine = processParameters.CommandLine; 56 | std::vector cmdLineBuf(cmdLine.Length / sizeof(wchar_t)); 57 | if ( !ReadProcessMemory(hProcess, cmdLine.Buffer, cmdLineBuf.data(), 58 | cmdLine.Length, nullptr) ) { 59 | spdlog::critical("Unable to read process command line"); 60 | return false; 61 | } 62 | commandLine.assign(cmdLineBuf.data(), cmdLineBuf.size()); 63 | return true; 64 | } 65 | 66 | bool Process::GetCurrentDirectory_() { 67 | UNICODE_STRING &curDir = processParameters.CurrentDirectory.DosPath; 68 | std::vector curDirBuf(curDir.Length / sizeof(wchar_t)); 69 | if ( !ReadProcessMemory(hProcess, curDir.Buffer, curDirBuf.data(), 70 | curDir.Length, nullptr) ) { 71 | spdlog::critical("Unable to read process current directory"); 72 | return false; 73 | } 74 | currentDirectory.assign(curDirBuf.data(), curDirBuf.size()); 75 | 76 | return true; 77 | } 78 | 79 | /* PUBLIC */ 80 | void Process::InjectIntoExecutable(HANDLE hThread, bool resumeThread) { 81 | spdlog::trace("starting injection into executable"); 82 | 83 | // allocate memory in process for the struct used by the shellcode and fill it 84 | LPVOID pInjectStruct = VirtualAllocEx(hProcess, nullptr, sizeof(InjectStruct), 85 | MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); 86 | InjectStruct injectStruct = { 87 | .pLoadLibraryA = reinterpret_cast(GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "LoadLibraryA")), 88 | .pGetProcAddress = reinterpret_cast(GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "GetProcAddress")), 89 | .dllFunc = "Setup" 90 | }; 91 | char dllName[MAX_PATH]; 92 | GetSystemDirectoryA(dllName, MAX_PATH); 93 | strcat_s(dllName, "\\drvmgt.dll"); 94 | strcpy_s(injectStruct.dllName, dllName); 95 | WriteProcessMemory(hProcess, pInjectStruct, &injectStruct, sizeof(injectStruct), nullptr); 96 | 97 | // allocate memory in process for the shellcode and fill it 98 | char shellcode[] = "\x55\x89\xE5\x83\xEC\x08\x8B\x45\x08\x83\xC0\x08\x50\x8B\x4D\x08\x8B\x11\xFF\xD2\x89\x45\xFC\x8B" 99 | "\x45\x08\x05\x0C\x01\x00\x00\x50\x8B\x4D\xFC\x51\x8B\x55\x08\x8B\x42\x04\xFF\xD0\x89\x45\xF8\xFF" 100 | "\x55\xF8\x90\x89\xEC\x5D\xC2\x04\x00"; 101 | LPVOID pShellcode = VirtualAllocEx(hProcess, nullptr, sizeof(shellcode), MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READ); 102 | WriteProcessMemory(hProcess, pShellcode, &shellcode, sizeof(shellcode), nullptr); 103 | 104 | /* MSDN: "If an application queues an APC before the thread begins running, 105 | * the thread begins by calling the APC function" */ 106 | QueueUserAPC(reinterpret_cast(pShellcode), hThread, reinterpret_cast(pInjectStruct)); 107 | 108 | // now we can resume main thread if necessary 109 | if ( resumeThread ) 110 | ResumeThread(hThread); 111 | } 112 | 113 | void Process::Relaunch() { 114 | spdlog::info("Relaunching main game process"); 115 | 116 | SetEnvironmentVariableW(L"SAFEDISCSHIM_INJECTED", L"1"); 117 | 118 | TerminateProcess(hProcess, 0); 119 | WaitForSingleObject(hProcess, INFINITE); 120 | 121 | STARTUPINFOW si {}; 122 | si.cb = sizeof(si); 123 | PROCESS_INFORMATION pi {}; 124 | // we hooked CreateProcessW earlier, so it isn't necessary to inject here 125 | CreateProcessW(nullptr, const_cast(commandLine.c_str()), 126 | nullptr, nullptr, false, 0,nullptr, 127 | currentDirectory.c_str(), &si, &pi); 128 | } 129 | -------------------------------------------------------------------------------- /src/secdrv_ioctl.cpp: -------------------------------------------------------------------------------- 1 | #include "logging.h" 2 | #include "secdrv_ioctl.h" 3 | 4 | using namespace secdrvIoctl; 5 | 6 | enum SafeDiscCommand : DWORD { 7 | GetDebugRegisterInfo = 0x3c, 8 | GetIdtInfo = 0x3d, 9 | SetupVerification = 0x3e, 10 | /* commands below this point are implemented in driver versions with function 11 | * names stripped */ 12 | Command3Fh = 0x3f, 13 | Command40h = 0x40, 14 | Command41h = 0x41, 15 | Command42h = 0x42, 16 | Command43h = 0x43 17 | }; 18 | 19 | typedef struct MainIoctlInBuffer { 20 | DWORD VersionMajor; 21 | DWORD VersionMinor; 22 | DWORD VersionPatch; 23 | 24 | SafeDiscCommand Command; 25 | DWORD VerificationData[0x100]; 26 | 27 | DWORD ExtraDataSize; 28 | DWORD ExtraData[0x40]; 29 | } MainIoctlInBuffer; 30 | 31 | typedef struct MainIoctlOutBuffer { 32 | DWORD VersionMajor; 33 | DWORD VersionMinor; 34 | DWORD VersionPatch; 35 | 36 | DWORD VerificationData[0x100]; 37 | 38 | DWORD ExtraDataSize; 39 | DWORD ExtraData[0x80]; 40 | } MainIoctlOutBuffer; 41 | 42 | bool hasLoggedVersion = false; 43 | 44 | void BuildVerificationData(DWORD verificationData[0x100]) { 45 | DWORD curValue = 0xf367ac7f; 46 | 47 | /* TODO: this is hacky, see if there are any better ways to get the kernel 48 | * tick count */ 49 | verificationData[0] = *reinterpret_cast(0x7ffe0320); 50 | 51 | for ( int i = 3; i > 0; --i ) { 52 | curValue = 0x361962e9 - 0xd5acb1b * curValue; 53 | verificationData[i] = curValue; 54 | verificationData[0] ^= curValue; 55 | } 56 | } 57 | 58 | BOOL secdrvIoctl::ProcessMainIoctl(LPVOID lpInBuffer, 59 | DWORD nInBufferSize, 60 | LPVOID lpOutBuffer, 61 | DWORD nOutBufferSize) { 62 | // make sure buffers are actually pointing to memory 63 | if ( !lpInBuffer || !lpOutBuffer ) { 64 | spdlog::error("invalid ioctl buffers: lpInBuffer {:#x}, lpOutBuffer {:#x}", 65 | reinterpret_cast(lpInBuffer), reinterpret_cast(lpOutBuffer)); 66 | return FALSE; 67 | } 68 | 69 | if ( nInBufferSize != sizeof(MainIoctlInBuffer) ) { 70 | spdlog::error("invalid ioctl in-buffer size: {:#x}", nInBufferSize); 71 | return FALSE; 72 | } 73 | spdlog::trace("ioctl in-buffer size: {:#x}", nInBufferSize); 74 | 75 | /* later versions report a buffer size of 0xC18 for some reason, though it is 76 | * never read from or written to outside of the normal size */ 77 | if ( nOutBufferSize != sizeof(MainIoctlOutBuffer) 78 | && nOutBufferSize != 0xC18 ) { 79 | spdlog::error("invalid ioctl out-buffer size: {:#x}", nOutBufferSize); 80 | return FALSE; 81 | } 82 | spdlog::trace("ioctl out-buffer size: {:#x}", nOutBufferSize); 83 | 84 | auto* inBuffer = static_cast(lpInBuffer); 85 | auto* outBuffer = static_cast(lpOutBuffer); 86 | 87 | if (!hasLoggedVersion) { 88 | spdlog::info("SafeDisc ioctl version {:0}.{:02}.{:03} detected.", 89 | inBuffer->VersionMajor, 90 | inBuffer->VersionMinor, 91 | inBuffer->VersionPatch); 92 | hasLoggedVersion = true; 93 | } 94 | 95 | // match latest secdrv version 96 | outBuffer->VersionMajor = 4; 97 | outBuffer->VersionMinor = 3; 98 | outBuffer->VersionPatch = 86; 99 | 100 | /* return expected values for each command. note that the latest driver 101 | * version is hardcoded to return these values; earlier driver versions would 102 | * perform more checks */ 103 | switch ( inBuffer->Command ) { 104 | case GetDebugRegisterInfo: 105 | spdlog::trace("command GetDebugRegisterInfo called"); 106 | outBuffer->ExtraDataSize = 4; 107 | outBuffer->ExtraData[0] = 0x400; 108 | break; 109 | case GetIdtInfo: 110 | spdlog::trace("command GetIdtInfo called"); 111 | outBuffer->ExtraDataSize = 4; 112 | outBuffer->ExtraData[0] = 0x2C8; 113 | break; 114 | case SetupVerification: 115 | spdlog::trace("command SetupVerification called"); 116 | outBuffer->ExtraDataSize = 4; 117 | outBuffer->ExtraData[0] = 0x5278d11b; 118 | break; 119 | case Command3Fh: 120 | spdlog::trace("command 3Fh called"); 121 | if ( nOutBufferSize != 0xC18 || 122 | inBuffer->ExtraData[0] > 0x60 ) return FALSE; 123 | outBuffer->ExtraDataSize = 4; 124 | outBuffer->ExtraData[0] = 0; 125 | break; 126 | case Command40h: 127 | spdlog::trace("command 40h called"); 128 | if ( nOutBufferSize != 0xC18 || 129 | !inBuffer->ExtraData[0] || 130 | !inBuffer->ExtraData[1] ) return FALSE; 131 | outBuffer->ExtraDataSize = 4; 132 | if ( inBuffer->ExtraData[1] <= 0x80 ) 133 | outBuffer->ExtraData[0] = 0x56791283; 134 | else 135 | outBuffer->ExtraData[0] = 0x587C1284; 136 | break; 137 | case Command41h: 138 | spdlog::trace("command 41h called"); 139 | if ( nOutBufferSize != 0xC18 || 140 | !LOBYTE(inBuffer->ExtraData[0]) ) return FALSE; 141 | outBuffer->ExtraDataSize = 4; 142 | break; 143 | case Command42h: 144 | spdlog::trace("command 42h called"); 145 | return FALSE; 146 | case Command43h: 147 | if ( inBuffer->ExtraData[0] != 0x98A64100 || 148 | inBuffer->ExtraData[1] > 7 || 149 | inBuffer->ExtraData[1] == 4 ) return FALSE; 150 | outBuffer->ExtraDataSize = 4; 151 | outBuffer->ExtraData[0] = 0; 152 | break; 153 | default: 154 | spdlog::error("unhandled ioctl command: {:#x}", 155 | static_cast(inBuffer->Command)); 156 | return FALSE; 157 | } 158 | 159 | BuildVerificationData(outBuffer->VerificationData); 160 | return TRUE; 161 | } 162 | -------------------------------------------------------------------------------- /src/hooks.cpp: -------------------------------------------------------------------------------- 1 | #include "hooks.h" 2 | #include "logging.h" 3 | #include "process.h" 4 | #include "secdrv_ioctl.h" 5 | 6 | NTSTATUS NTAPI hooks::NtDeviceIoControlFile_Hook(HANDLE FileHandle, 7 | HANDLE Event, 8 | PIO_APC_ROUTINE ApcRoutine, 9 | PVOID ApcContext, 10 | PIO_STATUS_BLOCK IoStatusBlock, 11 | ULONG IoControlCode, 12 | PVOID InputBuffer, 13 | ULONG InputBufferLength, 14 | PVOID OutputBuffer, 15 | ULONG OutputBufferLength) { 16 | spdlog::trace("hooked NtDeviceIoControlFile called"); 17 | 18 | /* all IOCTLs will pass through this function, but it's probably fine since 19 | * secdrv uses unique control codes */ 20 | if ( IoControlCode == secdrvIoctl::ioctlCodeMain ) { 21 | if ( secdrvIoctl::ProcessMainIoctl(InputBuffer, 22 | InputBufferLength, 23 | OutputBuffer, 24 | OutputBufferLength) ) { 25 | IoStatusBlock->Information = OutputBufferLength; 26 | IoStatusBlock->Status = STATUS_SUCCESS; 27 | } 28 | else IoStatusBlock->Status = STATUS_UNSUCCESSFUL; 29 | } 30 | else if ( IoControlCode == 0xCA002813 ) { 31 | spdlog::error("IOCTL 0xCA002813 unhandled (please report!)"); 32 | IoStatusBlock->Status = STATUS_UNSUCCESSFUL; 33 | } 34 | else { 35 | // not a secdrv request, pass to original function 36 | return NtDeviceIoControlFile_Orig(FileHandle, Event, ApcRoutine, ApcContext, 37 | IoStatusBlock, IoControlCode, InputBuffer, 38 | InputBufferLength, OutputBuffer, 39 | OutputBufferLength); 40 | } 41 | return IoStatusBlock->Status; 42 | } 43 | 44 | HANDLE WINAPI hooks::CreateFileA_Hook(LPCSTR lpFileName, 45 | DWORD dwDesiredAccess, 46 | DWORD dwShareMode, 47 | LPSECURITY_ATTRIBUTES lpSecurityAttributes, 48 | DWORD dwCreationDisposition, 49 | DWORD dwFlagsAndAttributes, 50 | HANDLE hTemplateFile) { 51 | spdlog::trace("hooked CreateFileA called"); 52 | 53 | if ( !lstrcmpiA(lpFileName, R"(\\.\Secdrv)") || 54 | !lstrcmpiA(lpFileName, R"(\\.\Global\SecDrv)") ) { 55 | spdlog::trace("CreateFileA: SecDrv opened!"); 56 | /* we need to return a handle when secdrv is opened, so we just open the 57 | * null device to get an unused handle */ 58 | auto dummyHandle = CreateFileA_Orig( 59 | "NUL", 60 | GENERIC_READ, 61 | FILE_SHARE_READ, 62 | nullptr, 63 | CREATE_ALWAYS, 64 | FILE_ATTRIBUTE_NORMAL, 65 | nullptr 66 | ); 67 | if ( dummyHandle == INVALID_HANDLE_VALUE ) 68 | spdlog::critical("unable to obtain a dummy handle for secdrv"); 69 | return dummyHandle; 70 | } 71 | return CreateFileA_Orig(lpFileName, dwDesiredAccess, dwShareMode, 72 | lpSecurityAttributes, dwCreationDisposition, 73 | dwFlagsAndAttributes, hTemplateFile); 74 | } 75 | 76 | BOOL WINAPI hooks::CreateProcessA_Hook(LPCSTR lpApplicationName, 77 | LPSTR lpCommandLine, 78 | LPSECURITY_ATTRIBUTES lpProcessAttributes, 79 | LPSECURITY_ATTRIBUTES lpThreadAttributes, 80 | BOOL bInheritHandles, 81 | DWORD dwCreationFlags, 82 | LPVOID lpEnvironment, 83 | LPCSTR lpCurrentDirectory, 84 | LPSTARTUPINFOA lpStartupInfo, 85 | LPPROCESS_INFORMATION lpProcessInformation) { 86 | spdlog::trace("hooked CreateProcessA called"); 87 | 88 | // if the process isn't created suspended, set the flag so we can inject hooks 89 | const DWORD isCreateSuspended = dwCreationFlags & CREATE_SUSPENDED; 90 | if ( !isCreateSuspended ) dwCreationFlags |= CREATE_SUSPENDED; 91 | 92 | if ( !CreateProcessA_Orig(lpApplicationName, lpCommandLine, 93 | lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, 94 | lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation) ) 95 | return FALSE; 96 | 97 | Process process {lpProcessInformation->hProcess}; 98 | 99 | spdlog::info("injecting into executable {}", lpApplicationName); 100 | process.InjectIntoExecutable(lpProcessInformation->hThread, !isCreateSuspended); 101 | 102 | return TRUE; 103 | } 104 | 105 | BOOL WINAPI hooks::CreateProcessW_Hook(LPCWSTR lpApplicationName, 106 | LPWSTR lpCommandLine, 107 | LPSECURITY_ATTRIBUTES lpProcessAttributes, 108 | LPSECURITY_ATTRIBUTES lpThreadAttributes, 109 | BOOL bInheritHandles, 110 | DWORD dwCreationFlags, 111 | LPVOID lpEnvironment, 112 | LPCWSTR lpCurrentDirectory, 113 | LPSTARTUPINFOW lpStartupInfo, 114 | LPPROCESS_INFORMATION lpProcessInformation) { 115 | spdlog::trace("hooked CreateProcessW called"); 116 | 117 | // if the process isn't created suspended, set the flag so we can inject hooks 118 | const DWORD isCreateSuspended = dwCreationFlags & CREATE_SUSPENDED; 119 | if ( !isCreateSuspended ) dwCreationFlags |= CREATE_SUSPENDED; 120 | 121 | if ( !CreateProcessW_Orig(lpApplicationName, lpCommandLine, 122 | lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, 123 | lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation) ) 124 | return FALSE; 125 | 126 | Process process {lpProcessInformation->hProcess}; 127 | 128 | spdlog::info(L"injecting into executable {}", lpApplicationName); 129 | process.InjectIntoExecutable(lpProcessInformation->hThread, !isCreateSuspended); 130 | return TRUE; 131 | } 132 | -------------------------------------------------------------------------------- /src/dllmain.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "hooks.h" 9 | #include "logging.h" 10 | #include "process.h" 11 | 12 | namespace 13 | { 14 | bool(*entryPointHook)(); 15 | PVOID exceptionHandler; 16 | PVOID baseAddress; 17 | SIZE_T regionSize; 18 | DWORD prevPageProtection; 19 | } 20 | 21 | bool IsCleanupExeFirstInject() 22 | { 23 | wchar_t exeName[MAX_PATH]; 24 | GetModuleFileNameW(nullptr, exeName, MAX_PATH); 25 | 26 | /* HOOKS FOR CLEANUP EXECUTABLE - USED TO RELAUNCH/INJECT GAME EXECUTABLE */ 27 | if ( wcsstr(exeName, L"~ef7194.tmp") || 28 | wcsstr(exeName, L"~f51e43.tmp") || 29 | wcsstr(exeName, L"~f39a36.tmp") || 30 | wcsstr(exeName, L"~f1d055.tmp") || 31 | wcsstr(exeName, L"~e5d141.tmp") || 32 | wcsstr(exeName, L"~fad052.tmp") || 33 | wcsstr(exeName, L"~e5.0001") ) 34 | { 35 | if ( !GetEnvironmentVariableW(L"SAFEDISCSHIM_INJECTED", nullptr, 0) ) 36 | return true; 37 | } 38 | return false; 39 | } 40 | 41 | bool Initialize() { 42 | logging::SetupLogger(); 43 | 44 | if ( MH_Initialize() != MH_OK ) { 45 | spdlog::critical("Unable to initialize MinHook"); 46 | return false; 47 | } 48 | spdlog::debug("Initialized MinHook"); 49 | 50 | // CreateProcess needs to be hooked for both executables 51 | if ( MH_CreateHookApi(L"kernel32", "CreateProcessA", &hooks::CreateProcessA_Hook, 52 | reinterpret_cast(&hooks::CreateProcessA_Orig)) != MH_OK ) { 53 | spdlog::critical("Unable to hook CreateProcessA"); 54 | return false; 55 | } 56 | spdlog::debug("Hooked CreateProcessA"); 57 | 58 | if ( MH_CreateHookApi(L"kernel32", "CreateProcessW", &hooks::CreateProcessW_Hook, 59 | reinterpret_cast(&hooks::CreateProcessW_Orig)) != MH_OK ) { 60 | spdlog::critical("Unable to hook CreateProcessW"); 61 | return false; 62 | } 63 | spdlog::debug("Hooked CreateProcessW"); 64 | 65 | if ( MH_EnableHook(MH_ALL_HOOKS) != MH_OK ) { 66 | spdlog::critical("Unable to enable CreateProcess hooks"); 67 | } 68 | spdlog::debug("Enabled CreateProcess hooks"); 69 | 70 | char exeName[MAX_PATH]; 71 | GetModuleFileNameA(nullptr, exeName, MAX_PATH); 72 | 73 | /* HOOKS FOR CLEANUP EXECUTABLE - USED TO RELAUNCH/INJECT GAME EXECUTABLE */ 74 | if ( IsCleanupExeFirstInject() ) { 75 | /* DLL has been loaded into SafeDisc cleanup, need to relaunch main game 76 | * executable and inject into that instead */ 77 | spdlog::info("Cleanup.exe detected, relaunching game and injecting"); 78 | 79 | /* PID of game executable is in command line as argument 1 */ 80 | const wchar_t* cmdLine = GetCommandLineW(); 81 | unsigned long pid = 0; 82 | if ( swscanf_s(cmdLine, L"\"%*[^\"]\" %lu", &pid) != 1 || !pid ) { 83 | spdlog::error("Unable to get game PID"); 84 | return false; 85 | } 86 | 87 | HANDLE hGameProcess; 88 | if ( hGameProcess = OpenProcess( 89 | PROCESS_TERMINATE | PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, 90 | false, pid); !hGameProcess ) { 91 | spdlog::error("Unable to open game process"); 92 | return false; 93 | } 94 | 95 | // for cleanup executable, log to game folder rather than %temp% 96 | GetModuleFileNameExA(hGameProcess, nullptr, exeName, MAX_PATH); 97 | const std::string loggerFileName = std::string(exeName) + 98 | "_Cleanup_SafeDiscShim.log"; 99 | logging::SetLoggerFileName(loggerFileName); 100 | 101 | Process gameProcess {hGameProcess}; 102 | gameProcess.Relaunch(); 103 | 104 | spdlog::info("Main game process relaunched; exiting cleanup.exe"); 105 | ExitProcess(0); 106 | } 107 | 108 | /* HOOKS FOR GAME EXECUTABLE */ 109 | else { 110 | const std::string loggerFileName = std::string(exeName) + "_SafeDiscShim.log"; 111 | logging::SetLoggerFileName(loggerFileName); 112 | 113 | if ( MH_CreateHookApi(L"ntdll", "NtDeviceIoControlFile", 114 | &hooks::NtDeviceIoControlFile_Hook, 115 | reinterpret_cast(&hooks::NtDeviceIoControlFile_Orig)) != MH_OK ) { 116 | spdlog::critical("Unable to hook NtDeviceIoControlFile"); 117 | return false; 118 | } 119 | spdlog::trace("Hooked NtDeviceIoControlFile"); 120 | 121 | if ( MH_CreateHookApi(L"kernel32", "CreateFileA", &hooks::CreateFileA_Hook, 122 | reinterpret_cast(&hooks::CreateFileA_Orig)) != MH_OK ) { 123 | spdlog::critical("Unable to hook CreateFileA"); 124 | return false; 125 | } 126 | spdlog::trace("Hooked CreateFileA"); 127 | } 128 | 129 | if ( MH_EnableHook(MH_ALL_HOOKS) != MH_OK ) { 130 | spdlog::critical("Unable to enable IOCTL hooks"); 131 | return false; 132 | } 133 | spdlog::trace("Enabled IOCTL hooks"); 134 | 135 | return true; 136 | } 137 | 138 | LONG CALLBACK ExceptionHandler(PEXCEPTION_POINTERS exp) 139 | { 140 | if (exp->ExceptionRecord->ExceptionCode != EXCEPTION_ACCESS_VIOLATION) 141 | return EXCEPTION_CONTINUE_SEARCH; 142 | 143 | DWORD dummy; 144 | // restore page protection and remove handler 145 | VirtualProtect(baseAddress, regionSize, prevPageProtection, &dummy); 146 | RemoveVectoredExceptionHandler(exceptionHandler); 147 | 148 | entryPointHook(); 149 | 150 | return EXCEPTION_CONTINUE_EXECUTION; 151 | } 152 | 153 | void RunFromEntryPoint(bool(*funcToCall)()) 154 | { 155 | /* Runs code from the entry point by setting page protection on the code section so it triggers an exception 156 | * where our code will be executed, and page protection restored */ 157 | entryPointHook = funcToCall; 158 | 159 | HANDLE hModule = GetModuleHandle(nullptr); 160 | PIMAGE_NT_HEADERS header = RtlImageNtHeader(hModule); 161 | 162 | // get address of entry point so we know what section to 163 | DWORD entryPoint = header->OptionalHeader.AddressOfEntryPoint + header->OptionalHeader.ImageBase; 164 | 165 | MEMORY_BASIC_INFORMATION memInfo; 166 | VirtualQuery(reinterpret_cast(entryPoint), &memInfo, sizeof(MEMORY_BASIC_INFORMATION)); 167 | 168 | baseAddress = memInfo.BaseAddress; 169 | regionSize = memInfo.RegionSize; 170 | 171 | exceptionHandler = AddVectoredExceptionHandler(1, ExceptionHandler); 172 | 173 | // prevent execution on entry point so exception handler is called. 174 | VirtualProtect(baseAddress, regionSize, PAGE_NOACCESS, &prevPageProtection); 175 | } 176 | 177 | BOOL WINAPI DllMain(HINSTANCE /*hinstDLL*/, DWORD fdwReason, LPVOID /*lpvReserved*/) { 178 | switch( fdwReason ) { 179 | case DLL_PROCESS_ATTACH: 180 | /* Run initialization for for cleanup.exe on first inject. For SafeDisc 1.x EXE this is done though the game calling 181 | * Setup(), for SafeDisc 1.x ICD and SafeDisc 2+ main EXE/cleanup EXE (on second inject) this is done through the 182 | * injected shellcode. */ 183 | if (IsCleanupExeFirstInject()) 184 | RunFromEntryPoint(Initialize); 185 | case DLL_THREAD_ATTACH: 186 | case DLL_THREAD_DETACH: 187 | case DLL_PROCESS_DETACH: 188 | default: 189 | break; 190 | } 191 | return true; 192 | } 193 | 194 | // Exported functions from the original drvmgt.dll. 100 = success 195 | extern "C" __declspec(dllexport) int Setup(LPCSTR /*lpSubKey*/, char* /*FullPath*/) { 196 | /* will only be called from SafeDisc v1 or injection shellcode since the other versions import 197 | * drvmgt.dll from %temp% */ 198 | Initialize(); 199 | return 100; 200 | } 201 | 202 | extern "C" __declspec(dllexport) int Remove(LPCSTR /*lpSubKey*/) { 203 | return 100; 204 | } 205 | -------------------------------------------------------------------------------- /installer/license.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\deff0\nouicompat{\fonttbl{\f0\fnil\fcharset0 Segoe UI;}{\f1\fnil Segoe UI;}{\f2\fmodern Courier New;}} 2 | {\colortbl ;\red0\green0\blue255;} 3 | {\*\generator Riched20 10.0.22621}\viewkind4\uc1 4 | \pard\sa180\f0\fs16\lang9 Copyright \'a9 2024 RibShark\par 5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.\par 6 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\par 7 | You should have received a copy of the GNU General Public License along with this program; if not, see {{\field{\*\fldinst{HYPERLINK https://www.gnu.org/licenses }}{\fldrslt{https://www.gnu.org/licenses\ul0\cf0}}}}\f0\fs16 .\par 8 | Additional permission under GNU GPL version 3 section 7\par 9 | If you modify this Program, or any covered work, by linking or combining it with software containing any version of SafeDisc as originally authored by Macrovision Solutions Corporation, the licensors of this Program grant you additional permission to convey the resulting work.\par 10 | 11 | \pard\sa180\qc\emdash\emdash\emdash\emdash\emdash\par 12 | 13 | \pard\sa180\b\fs22 GNU GENERAL PUBLIC LICENSE\par 14 | \b0\fs16 Version 3, 29 June 2007\par 15 | Copyright (C) 2007 Free Software Foundation, Inc. {{\field{\*\fldinst{HYPERLINK https://fsf.org/ }}{\fldrslt{https://fsf.org/\ul0\cf0}}}}\f0\fs16\par 16 | Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\par 17 | \b\fs20 Preamble\par 18 | \b0\fs16 The GNU General Public License is a free, copyleft license for software and other kinds of works.\par 19 | The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program\f1\endash\f0 to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.\par 20 | When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.\par 21 | To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.\par 22 | For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.\par 23 | Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.\par 24 | For the developers\rquote and authors\rquote protection, the GPL clearly explains that there is no warranty for this free software. For both users\rquote and authors\rquote sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.\par 25 | Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users\rquote freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.\par 26 | Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.\par 27 | The precise terms and conditions for copying, distribution and modification follow.\par 28 | \b\fs20 TERMS AND CONDITIONS\par 29 | \fs18 0. Definitions.\par 30 | \b0\fs16\ldblquote This License\rdblquote refers to version 3 of the GNU General Public License.\par 31 | \ldblquote Copyright\rdblquote also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.\par 32 | \ldblquote The Program\rdblquote refers to any copyrightable work licensed under this License. Each licensee is addressed as \ldblquote you\rdblquote . \ldblquote Licensees\rdblquote and \ldblquote recipients\rdblquote may be individuals or organizations.\par 33 | To \ldblquote modify\rdblquote a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a \ldblquote modified version\rdblquote of the earlier work or a work \ldblquote based on\rdblquote the earlier work.\par 34 | A \ldblquote covered work\rdblquote means either the unmodified Program or a work based on the Program.\par 35 | To \ldblquote propagate\rdblquote a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.\par 36 | To \ldblquote convey\rdblquote a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.\par 37 | An interactive user interface displays \ldblquote Appropriate Legal Notices\rdblquote to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.\par 38 | \b\fs18 1. Source Code.\par 39 | \b0\fs16 The \ldblquote source code\rdblquote for a work means the preferred form of the work for making modifications to it. \ldblquote Object code\rdblquote means any non-source form of a work.\par 40 | A \ldblquote Standard Interface\rdblquote means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.\par 41 | The \ldblquote System Libraries\rdblquote of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A \ldblquote Major Component\rdblquote , in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.\par 42 | The \ldblquote Corresponding Source\rdblquote for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work\rquote s System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.\par 43 | The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.\par 44 | The Corresponding Source for a work in source code form is that same work.\par 45 | \b\fs18 2. Basic Permissions.\par 46 | \b0\fs16 All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.\par 47 | You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.\par 48 | Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.\par 49 | \b\fs18 3. Protecting Users\rquote Legal Rights From Anti-Circumvention Law.\par 50 | \b0\fs16 No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.\par 51 | When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work\rquote s users, your or third parties\rquote legal rights to forbid circumvention of technological measures.\par 52 | \b\fs18 4. Conveying Verbatim Copies.\par 53 | \b0\fs16 You may convey verbatim copies of the Program\rquote s source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.\par 54 | You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.\par 55 | \b\fs18 5. Conveying Modified Source Versions.\par 56 | \b0\fs16 You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:\par 57 | 58 | \pard\fi-360\li720\sa180\tx360\bullet\tab a)\tab The work must carry prominent notices stating that you modified it, and giving a relevant date.\par 59 | \bullet\tab b)\tab The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to \ldblquote keep intact all notices\rdblquote .\par 60 | \bullet\tab c)\tab You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.\par 61 | \bullet\tab d)\tab If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.\par 62 | 63 | \pard\sa180 A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an \ldblquote aggregate\rdblquote if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation\rquote s users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.\par 64 | \b\fs18 6. Conveying Non-Source Forms.\par 65 | \b0\fs16 You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:\par 66 | 67 | \pard\fi-360\li720\sa180\tx360\bullet\tab a)\tab Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.\par 68 | \bullet\tab b)\tab Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.\par 69 | \bullet\tab c)\tab Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.\par 70 | \bullet\tab d)\tab Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.\par 71 | \bullet\tab e)\tab Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.\par 72 | 73 | \pard\sa180 A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.\par 74 | A \ldblquote User Product\rdblquote is either (1) a \ldblquote consumer product\rdblquote , which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, \ldblquote normally used\rdblquote refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.\par 75 | \ldblquote Installation Information\rdblquote for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.\par 76 | If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).\par 77 | The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.\par 78 | Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.\par 79 | \b\fs18 7. Additional Terms.\par 80 | \b0\fs16\ldblquote Additional permissions\rdblquote are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.\par 81 | When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.\par 82 | Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:\par 83 | 84 | \pard\fi-360\li720\sa180\tx360\bullet\tab a)\tab Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or\par 85 | \bullet\tab b)\tab Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or\par 86 | \bullet\tab c)\tab Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or\par 87 | \bullet\tab d)\tab Limiting the use for publicity purposes of names of licensors or authors of the material; or\par 88 | \bullet\tab e)\tab Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or\par 89 | \bullet\tab f)\tab Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.\par 90 | 91 | \pard\sa180 All other non-permissive additional terms are considered \ldblquote further restrictions\rdblquote within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.\par 92 | If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.\par 93 | Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.\par 94 | \b\fs18 8. Termination.\par 95 | \b0\fs16 You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).\par 96 | However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.\par 97 | Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.\par 98 | Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.\par 99 | \b\fs18 9. Acceptance Not Required for Having Copies.\par 100 | \b0\fs16 You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.\par 101 | \b\fs18 10. Automatic Licensing of Downstream Recipients.\par 102 | \b0\fs16 Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.\par 103 | An \ldblquote entity transaction\rdblquote is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party\rquote s predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.\par 104 | You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.\par 105 | \b\fs18 11. Patents.\par 106 | \b0\fs16 A \ldblquote contributor\rdblquote is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor\rquote s \ldblquote contributor version\rdblquote .\par 107 | A contributor\rquote s \ldblquote essential patent claims\rdblquote are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, \ldblquote control\rdblquote includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.\par 108 | Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor\rquote s essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.\par 109 | In the following three paragraphs, a \ldblquote patent license\rdblquote is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To \ldblquote grant\rdblquote such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.\par 110 | If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. \ldblquote Knowingly relying\rdblquote means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient\rquote s use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.\par 111 | If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.\par 112 | A patent license is \ldblquote discriminatory\rdblquote if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.\par 113 | Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.\par 114 | \b\fs18 12. No Surrender of Others\rquote Freedom.\par 115 | \b0\fs16 If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.\par 116 | \b\fs18 13. Use with the GNU Affero General Public License.\par 117 | \b0\fs16 Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.\par 118 | \b\fs18 14. Revised Versions of this License.\par 119 | \b0\fs16 The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\par 120 | Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License \ldblquote or any later version\rdblquote applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.\par 121 | If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy\rquote s public statement of acceptance of a version permanently authorizes you to choose that version for the Program.\par 122 | Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.\par 123 | \b\fs18 15. Disclaimer of Warranty.\par 124 | \b0\fs16 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \ldblquote AS IS\rdblquote WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\par 125 | \b\fs18 16. Limitation of Liability.\par 126 | \b0\fs16 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\par 127 | \b\fs18 17. Interpretation of Sections 15 and 16.\par 128 | \b0\fs16 If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.\par 129 | END OF TERMS AND CONDITIONS\par 130 | \b\fs20 How to Apply These Terms to Your New Programs\par 131 | \b0\fs16 If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.\par 132 | To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the \ldblquote copyright\rdblquote line and a pointer to where the full notice is found.\par 133 | \f2 \line Copyright (C) \line\line This program is free software: you can redistribute it and/or modify\line it under the terms of the GNU General Public License as published by\line the Free Software Foundation, either version 3 of the License, or\line (at your option) any later version.\line\line This program is distributed in the hope that it will be useful,\line but WITHOUT ANY WARRANTY; without even the implied warranty of\line MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\line GNU General Public License for more details.\line\line You should have received a copy of the GNU General Public License\line along with this program. If not, see <{{\field{\*\fldinst{HYPERLINK "https://www.gnu.org/licenses/"}}{\fldrslt{https://www.gnu.org/licenses/\ul0\cf0}}}}\f2\fs16 >.\par 134 | \f0 Also add information on how to contact you by electronic and paper mail.\par 135 | If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:\par 136 | \f2 Copyright (C) \line This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\line This is free software, and you are welcome to redistribute it\line under certain conditions; type `show c' for details.\par 137 | \f0 The hypothetical commands `show w\rquote and `show c\rquote should show the appropriate parts of the General Public License. Of course, your program\rquote s commands might be different; for a GUI interface, you would use an \ldblquote about box\rdblquote .\par 138 | You should also get your employer (if you work as a programmer) or school, if any, to sign a \ldblquote copyright disclaimer\rdblquote for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see {{\field{\*\fldinst{HYPERLINK https://www.gnu.org/licenses/ }}{\fldrslt{https://www.gnu.org/licenses/\ul0\cf0}}}}\f0\fs16 .\par 139 | The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read {{\field{\*\fldinst{HYPERLINK https://www.gnu.org/licenses/why-not-lgpl.html }}{\fldrslt{https://www.gnu.org/licenses/why-not-lgpl.html\ul0\cf0}}}}\f0\fs16 .\par 140 | } 141 | 142 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright © 2024 RibShark 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 3 of the License, or (at 6 | your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, see . 15 | 16 | Additional permission under GNU GPL version 3 section 7 17 | 18 | If you modify this Program, or any covered work, by linking or 19 | combining it with software containing any version of SafeDisc as 20 | originally authored by Macrovision Solutions Corporation, the licensors 21 | of this Program grant you additional permission to convey the resulting 22 | work. 23 | 24 | --- 25 | 26 | # GNU GENERAL PUBLIC LICENSE 27 | 28 | Version 3, 29 June 2007 29 | 30 | Copyright (C) 2007 Free Software Foundation, Inc. 31 | 32 | 33 | Everyone is permitted to copy and distribute verbatim copies of this 34 | license document, but changing it is not allowed. 35 | 36 | ## Preamble 37 | 38 | The GNU General Public License is a free, copyleft license for 39 | software and other kinds of works. 40 | 41 | The licenses for most software and other practical works are designed 42 | to take away your freedom to share and change the works. By contrast, 43 | the GNU General Public License is intended to guarantee your freedom 44 | to share and change all versions of a program--to make sure it remains 45 | free software for all its users. We, the Free Software Foundation, use 46 | the GNU General Public License for most of our software; it applies 47 | also to any other work released this way by its authors. You can apply 48 | it to your programs, too. 49 | 50 | When we speak of free software, we are referring to freedom, not 51 | price. Our General Public Licenses are designed to make sure that you 52 | have the freedom to distribute copies of free software (and charge for 53 | them if you wish), that you receive source code or can get it if you 54 | want it, that you can change the software or use pieces of it in new 55 | free programs, and that you know you can do these things. 56 | 57 | To protect your rights, we need to prevent others from denying you 58 | these rights or asking you to surrender the rights. Therefore, you 59 | have certain responsibilities if you distribute copies of the 60 | software, or if you modify it: responsibilities to respect the freedom 61 | of others. 62 | 63 | For example, if you distribute copies of such a program, whether 64 | gratis or for a fee, you must pass on to the recipients the same 65 | freedoms that you received. You must make sure that they, too, receive 66 | or can get the source code. And you must show them these terms so they 67 | know their rights. 68 | 69 | Developers that use the GNU GPL protect your rights with two steps: 70 | (1) assert copyright on the software, and (2) offer you this License 71 | giving you legal permission to copy, distribute and/or modify it. 72 | 73 | For the developers' and authors' protection, the GPL clearly explains 74 | that there is no warranty for this free software. For both users' and 75 | authors' sake, the GPL requires that modified versions be marked as 76 | changed, so that their problems will not be attributed erroneously to 77 | authors of previous versions. 78 | 79 | Some devices are designed to deny users access to install or run 80 | modified versions of the software inside them, although the 81 | manufacturer can do so. This is fundamentally incompatible with the 82 | aim of protecting users' freedom to change the software. The 83 | systematic pattern of such abuse occurs in the area of products for 84 | individuals to use, which is precisely where it is most unacceptable. 85 | Therefore, we have designed this version of the GPL to prohibit the 86 | practice for those products. If such problems arise substantially in 87 | other domains, we stand ready to extend this provision to those 88 | domains in future versions of the GPL, as needed to protect the 89 | freedom of users. 90 | 91 | Finally, every program is threatened constantly by software patents. 92 | States should not allow patents to restrict development and use of 93 | software on general-purpose computers, but in those that do, we wish 94 | to avoid the special danger that patents applied to a free program 95 | could make it effectively proprietary. To prevent this, the GPL 96 | assures that patents cannot be used to render the program non-free. 97 | 98 | The precise terms and conditions for copying, distribution and 99 | modification follow. 100 | 101 | ## TERMS AND CONDITIONS 102 | 103 | ### 0. Definitions. 104 | 105 | "This License" refers to version 3 of the GNU General Public License. 106 | 107 | "Copyright" also means copyright-like laws that apply to other kinds 108 | of works, such as semiconductor masks. 109 | 110 | "The Program" refers to any copyrightable work licensed under this 111 | License. Each licensee is addressed as "you". "Licensees" and 112 | "recipients" may be individuals or organizations. 113 | 114 | To "modify" a work means to copy from or adapt all or part of the work 115 | in a fashion requiring copyright permission, other than the making of 116 | an exact copy. The resulting work is called a "modified version" of 117 | the earlier work or a work "based on" the earlier work. 118 | 119 | A "covered work" means either the unmodified Program or a work based 120 | on the Program. 121 | 122 | To "propagate" a work means to do anything with it that, without 123 | permission, would make you directly or secondarily liable for 124 | infringement under applicable copyright law, except executing it on a 125 | computer or modifying a private copy. Propagation includes copying, 126 | distribution (with or without modification), making available to the 127 | public, and in some countries other activities as well. 128 | 129 | To "convey" a work means any kind of propagation that enables other 130 | parties to make or receive copies. Mere interaction with a user 131 | through a computer network, with no transfer of a copy, is not 132 | conveying. 133 | 134 | An interactive user interface displays "Appropriate Legal Notices" to 135 | the extent that it includes a convenient and prominently visible 136 | feature that (1) displays an appropriate copyright notice, and (2) 137 | tells the user that there is no warranty for the work (except to the 138 | extent that warranties are provided), that licensees may convey the 139 | work under this License, and how to view a copy of this License. If 140 | the interface presents a list of user commands or options, such as a 141 | menu, a prominent item in the list meets this criterion. 142 | 143 | ### 1. Source Code. 144 | 145 | The "source code" for a work means the preferred form of the work for 146 | making modifications to it. "Object code" means any non-source form of 147 | a work. 148 | 149 | A "Standard Interface" means an interface that either is an official 150 | standard defined by a recognized standards body, or, in the case of 151 | interfaces specified for a particular programming language, one that 152 | is widely used among developers working in that language. 153 | 154 | The "System Libraries" of an executable work include anything, other 155 | than the work as a whole, that (a) is included in the normal form of 156 | packaging a Major Component, but which is not part of that Major 157 | Component, and (b) serves only to enable use of the work with that 158 | Major Component, or to implement a Standard Interface for which an 159 | implementation is available to the public in source code form. A 160 | "Major Component", in this context, means a major essential component 161 | (kernel, window system, and so on) of the specific operating system 162 | (if any) on which the executable work runs, or a compiler used to 163 | produce the work, or an object code interpreter used to run it. 164 | 165 | The "Corresponding Source" for a work in object code form means all 166 | the source code needed to generate, install, and (for an executable 167 | work) run the object code and to modify the work, including scripts to 168 | control those activities. However, it does not include the work's 169 | System Libraries, or general-purpose tools or generally available free 170 | programs which are used unmodified in performing those activities but 171 | which are not part of the work. For example, Corresponding Source 172 | includes interface definition files associated with source files for 173 | the work, and the source code for shared libraries and dynamically 174 | linked subprograms that the work is specifically designed to require, 175 | such as by intimate data communication or control flow between those 176 | subprograms and other parts of the work. 177 | 178 | The Corresponding Source need not include anything that users can 179 | regenerate automatically from other parts of the Corresponding Source. 180 | 181 | The Corresponding Source for a work in source code form is that same 182 | work. 183 | 184 | ### 2. Basic Permissions. 185 | 186 | All rights granted under this License are granted for the term of 187 | copyright on the Program, and are irrevocable provided the stated 188 | conditions are met. This License explicitly affirms your unlimited 189 | permission to run the unmodified Program. The output from running a 190 | covered work is covered by this License only if the output, given its 191 | content, constitutes a covered work. This License acknowledges your 192 | rights of fair use or other equivalent, as provided by copyright law. 193 | 194 | You may make, run and propagate covered works that you do not convey, 195 | without conditions so long as your license otherwise remains in force. 196 | You may convey covered works to others for the sole purpose of having 197 | them make modifications exclusively for you, or provide you with 198 | facilities for running those works, provided that you comply with the 199 | terms of this License in conveying all material for which you do not 200 | control copyright. Those thus making or running the covered works for 201 | you must do so exclusively on your behalf, under your direction and 202 | control, on terms that prohibit them from making any copies of your 203 | copyrighted material outside their relationship with you. 204 | 205 | Conveying under any other circumstances is permitted solely under the 206 | conditions stated below. Sublicensing is not allowed; section 10 makes 207 | it unnecessary. 208 | 209 | ### 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 210 | 211 | No covered work shall be deemed part of an effective technological 212 | measure under any applicable law fulfilling obligations under article 213 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 214 | similar laws prohibiting or restricting circumvention of such 215 | measures. 216 | 217 | When you convey a covered work, you waive any legal power to forbid 218 | circumvention of technological measures to the extent such 219 | circumvention is effected by exercising rights under this License with 220 | respect to the covered work, and you disclaim any intention to limit 221 | operation or modification of the work as a means of enforcing, against 222 | the work's users, your or third parties' legal rights to forbid 223 | circumvention of technological measures. 224 | 225 | ### 4. Conveying Verbatim Copies. 226 | 227 | You may convey verbatim copies of the Program's source code as you 228 | receive it, in any medium, provided that you conspicuously and 229 | appropriately publish on each copy an appropriate copyright notice; 230 | keep intact all notices stating that this License and any 231 | non-permissive terms added in accord with section 7 apply to the code; 232 | keep intact all notices of the absence of any warranty; and give all 233 | recipients a copy of this License along with the Program. 234 | 235 | You may charge any price or no price for each copy that you convey, 236 | and you may offer support or warranty protection for a fee. 237 | 238 | ### 5. Conveying Modified Source Versions. 239 | 240 | You may convey a work based on the Program, or the modifications to 241 | produce it from the Program, in the form of source code under the 242 | terms of section 4, provided that you also meet all of these 243 | conditions: 244 | 245 | - a) The work must carry prominent notices stating that you modified 246 | it, and giving a relevant date. 247 | - b) The work must carry prominent notices stating that it is 248 | released under this License and any conditions added under 249 | section 7. This requirement modifies the requirement in section 4 250 | to "keep intact all notices". 251 | - c) You must license the entire work, as a whole, under this 252 | License to anyone who comes into possession of a copy. This 253 | License will therefore apply, along with any applicable section 7 254 | additional terms, to the whole of the work, and all its parts, 255 | regardless of how they are packaged. This License gives no 256 | permission to license the work in any other way, but it does not 257 | invalidate such permission if you have separately received it. 258 | - d) If the work has interactive user interfaces, each must display 259 | Appropriate Legal Notices; however, if the Program has interactive 260 | interfaces that do not display Appropriate Legal Notices, your 261 | work need not make them do so. 262 | 263 | A compilation of a covered work with other separate and independent 264 | works, which are not by their nature extensions of the covered work, 265 | and which are not combined with it such as to form a larger program, 266 | in or on a volume of a storage or distribution medium, is called an 267 | "aggregate" if the compilation and its resulting copyright are not 268 | used to limit the access or legal rights of the compilation's users 269 | beyond what the individual works permit. Inclusion of a covered work 270 | in an aggregate does not cause this License to apply to the other 271 | parts of the aggregate. 272 | 273 | ### 6. Conveying Non-Source Forms. 274 | 275 | You may convey a covered work in object code form under the terms of 276 | sections 4 and 5, provided that you also convey the machine-readable 277 | Corresponding Source under the terms of this License, in one of these 278 | ways: 279 | 280 | - a) Convey the object code in, or embodied in, a physical product 281 | (including a physical distribution medium), accompanied by the 282 | Corresponding Source fixed on a durable physical medium 283 | customarily used for software interchange. 284 | - b) Convey the object code in, or embodied in, a physical product 285 | (including a physical distribution medium), accompanied by a 286 | written offer, valid for at least three years and valid for as 287 | long as you offer spare parts or customer support for that product 288 | model, to give anyone who possesses the object code either (1) a 289 | copy of the Corresponding Source for all the software in the 290 | product that is covered by this License, on a durable physical 291 | medium customarily used for software interchange, for a price no 292 | more than your reasonable cost of physically performing this 293 | conveying of source, or (2) access to copy the Corresponding 294 | Source from a network server at no charge. 295 | - c) Convey individual copies of the object code with a copy of the 296 | written offer to provide the Corresponding Source. This 297 | alternative is allowed only occasionally and noncommercially, and 298 | only if you received the object code with such an offer, in accord 299 | with subsection 6b. 300 | - d) Convey the object code by offering access from a designated 301 | place (gratis or for a charge), and offer equivalent access to the 302 | Corresponding Source in the same way through the same place at no 303 | further charge. You need not require recipients to copy the 304 | Corresponding Source along with the object code. If the place to 305 | copy the object code is a network server, the Corresponding Source 306 | may be on a different server (operated by you or a third party) 307 | that supports equivalent copying facilities, provided you maintain 308 | clear directions next to the object code saying where to find the 309 | Corresponding Source. Regardless of what server hosts the 310 | Corresponding Source, you remain obligated to ensure that it is 311 | available for as long as needed to satisfy these requirements. 312 | - e) Convey the object code using peer-to-peer transmission, 313 | provided you inform other peers where the object code and 314 | Corresponding Source of the work are being offered to the general 315 | public at no charge under subsection 6d. 316 | 317 | A separable portion of the object code, whose source code is excluded 318 | from the Corresponding Source as a System Library, need not be 319 | included in conveying the object code work. 320 | 321 | A "User Product" is either (1) a "consumer product", which means any 322 | tangible personal property which is normally used for personal, 323 | family, or household purposes, or (2) anything designed or sold for 324 | incorporation into a dwelling. In determining whether a product is a 325 | consumer product, doubtful cases shall be resolved in favor of 326 | coverage. For a particular product received by a particular user, 327 | "normally used" refers to a typical or common use of that class of 328 | product, regardless of the status of the particular user or of the way 329 | in which the particular user actually uses, or expects or is expected 330 | to use, the product. A product is a consumer product regardless of 331 | whether the product has substantial commercial, industrial or 332 | non-consumer uses, unless such uses represent the only significant 333 | mode of use of the product. 334 | 335 | "Installation Information" for a User Product means any methods, 336 | procedures, authorization keys, or other information required to 337 | install and execute modified versions of a covered work in that User 338 | Product from a modified version of its Corresponding Source. The 339 | information must suffice to ensure that the continued functioning of 340 | the modified object code is in no case prevented or interfered with 341 | solely because modification has been made. 342 | 343 | If you convey an object code work under this section in, or with, or 344 | specifically for use in, a User Product, and the conveying occurs as 345 | part of a transaction in which the right of possession and use of the 346 | User Product is transferred to the recipient in perpetuity or for a 347 | fixed term (regardless of how the transaction is characterized), the 348 | Corresponding Source conveyed under this section must be accompanied 349 | by the Installation Information. But this requirement does not apply 350 | if neither you nor any third party retains the ability to install 351 | modified object code on the User Product (for example, the work has 352 | been installed in ROM). 353 | 354 | The requirement to provide Installation Information does not include a 355 | requirement to continue to provide support service, warranty, or 356 | updates for a work that has been modified or installed by the 357 | recipient, or for the User Product in which it has been modified or 358 | installed. Access to a network may be denied when the modification 359 | itself materially and adversely affects the operation of the network 360 | or violates the rules and protocols for communication across the 361 | network. 362 | 363 | Corresponding Source conveyed, and Installation Information provided, 364 | in accord with this section must be in a format that is publicly 365 | documented (and with an implementation available to the public in 366 | source code form), and must require no special password or key for 367 | unpacking, reading or copying. 368 | 369 | ### 7. Additional Terms. 370 | 371 | "Additional permissions" are terms that supplement the terms of this 372 | License by making exceptions from one or more of its conditions. 373 | Additional permissions that are applicable to the entire Program shall 374 | be treated as though they were included in this License, to the extent 375 | that they are valid under applicable law. If additional permissions 376 | apply only to part of the Program, that part may be used separately 377 | under those permissions, but the entire Program remains governed by 378 | this License without regard to the additional permissions. 379 | 380 | When you convey a copy of a covered work, you may at your option 381 | remove any additional permissions from that copy, or from any part of 382 | it. (Additional permissions may be written to require their own 383 | removal in certain cases when you modify the work.) You may place 384 | additional permissions on material, added by you to a covered work, 385 | for which you have or can give appropriate copyright permission. 386 | 387 | Notwithstanding any other provision of this License, for material you 388 | add to a covered work, you may (if authorized by the copyright holders 389 | of that material) supplement the terms of this License with terms: 390 | 391 | - a) Disclaiming warranty or limiting liability differently from the 392 | terms of sections 15 and 16 of this License; or 393 | - b) Requiring preservation of specified reasonable legal notices or 394 | author attributions in that material or in the Appropriate Legal 395 | Notices displayed by works containing it; or 396 | - c) Prohibiting misrepresentation of the origin of that material, 397 | or requiring that modified versions of such material be marked in 398 | reasonable ways as different from the original version; or 399 | - d) Limiting the use for publicity purposes of names of licensors 400 | or authors of the material; or 401 | - e) Declining to grant rights under trademark law for use of some 402 | trade names, trademarks, or service marks; or 403 | - f) Requiring indemnification of licensors and authors of that 404 | material by anyone who conveys the material (or modified versions 405 | of it) with contractual assumptions of liability to the recipient, 406 | for any liability that these contractual assumptions directly 407 | impose on those licensors and authors. 408 | 409 | All other non-permissive additional terms are considered "further 410 | restrictions" within the meaning of section 10. If the Program as you 411 | received it, or any part of it, contains a notice stating that it is 412 | governed by this License along with a term that is a further 413 | restriction, you may remove that term. If a license document contains 414 | a further restriction but permits relicensing or conveying under this 415 | License, you may add to a covered work material governed by the terms 416 | of that license document, provided that the further restriction does 417 | not survive such relicensing or conveying. 418 | 419 | If you add terms to a covered work in accord with this section, you 420 | must place, in the relevant source files, a statement of the 421 | additional terms that apply to those files, or a notice indicating 422 | where to find the applicable terms. 423 | 424 | Additional terms, permissive or non-permissive, may be stated in the 425 | form of a separately written license, or stated as exceptions; the 426 | above requirements apply either way. 427 | 428 | ### 8. Termination. 429 | 430 | You may not propagate or modify a covered work except as expressly 431 | provided under this License. Any attempt otherwise to propagate or 432 | modify it is void, and will automatically terminate your rights under 433 | this License (including any patent licenses granted under the third 434 | paragraph of section 11). 435 | 436 | However, if you cease all violation of this License, then your license 437 | from a particular copyright holder is reinstated (a) provisionally, 438 | unless and until the copyright holder explicitly and finally 439 | terminates your license, and (b) permanently, if the copyright holder 440 | fails to notify you of the violation by some reasonable means prior to 441 | 60 days after the cessation. 442 | 443 | Moreover, your license from a particular copyright holder is 444 | reinstated permanently if the copyright holder notifies you of the 445 | violation by some reasonable means, this is the first time you have 446 | received notice of violation of this License (for any work) from that 447 | copyright holder, and you cure the violation prior to 30 days after 448 | your receipt of the notice. 449 | 450 | Termination of your rights under this section does not terminate the 451 | licenses of parties who have received copies or rights from you under 452 | this License. If your rights have been terminated and not permanently 453 | reinstated, you do not qualify to receive new licenses for the same 454 | material under section 10. 455 | 456 | ### 9. Acceptance Not Required for Having Copies. 457 | 458 | You are not required to accept this License in order to receive or run 459 | a copy of the Program. Ancillary propagation of a covered work 460 | occurring solely as a consequence of using peer-to-peer transmission 461 | to receive a copy likewise does not require acceptance. However, 462 | nothing other than this License grants you permission to propagate or 463 | modify any covered work. These actions infringe copyright if you do 464 | not accept this License. Therefore, by modifying or propagating a 465 | covered work, you indicate your acceptance of this License to do so. 466 | 467 | ### 10. Automatic Licensing of Downstream Recipients. 468 | 469 | Each time you convey a covered work, the recipient automatically 470 | receives a license from the original licensors, to run, modify and 471 | propagate that work, subject to this License. You are not responsible 472 | for enforcing compliance by third parties with this License. 473 | 474 | An "entity transaction" is a transaction transferring control of an 475 | organization, or substantially all assets of one, or subdividing an 476 | organization, or merging organizations. If propagation of a covered 477 | work results from an entity transaction, each party to that 478 | transaction who receives a copy of the work also receives whatever 479 | licenses to the work the party's predecessor in interest had or could 480 | give under the previous paragraph, plus a right to possession of the 481 | Corresponding Source of the work from the predecessor in interest, if 482 | the predecessor has it or can get it with reasonable efforts. 483 | 484 | You may not impose any further restrictions on the exercise of the 485 | rights granted or affirmed under this License. For example, you may 486 | not impose a license fee, royalty, or other charge for exercise of 487 | rights granted under this License, and you may not initiate litigation 488 | (including a cross-claim or counterclaim in a lawsuit) alleging that 489 | any patent claim is infringed by making, using, selling, offering for 490 | sale, or importing the Program or any portion of it. 491 | 492 | ### 11. Patents. 493 | 494 | A "contributor" is a copyright holder who authorizes use under this 495 | License of the Program or a work on which the Program is based. The 496 | work thus licensed is called the contributor's "contributor version". 497 | 498 | A contributor's "essential patent claims" are all patent claims owned 499 | or controlled by the contributor, whether already acquired or 500 | hereafter acquired, that would be infringed by some manner, permitted 501 | by this License, of making, using, or selling its contributor version, 502 | but do not include claims that would be infringed only as a 503 | consequence of further modification of the contributor version. For 504 | purposes of this definition, "control" includes the right to grant 505 | patent sublicenses in a manner consistent with the requirements of 506 | this License. 507 | 508 | Each contributor grants you a non-exclusive, worldwide, royalty-free 509 | patent license under the contributor's essential patent claims, to 510 | make, use, sell, offer for sale, import and otherwise run, modify and 511 | propagate the contents of its contributor version. 512 | 513 | In the following three paragraphs, a "patent license" is any express 514 | agreement or commitment, however denominated, not to enforce a patent 515 | (such as an express permission to practice a patent or covenant not to 516 | sue for patent infringement). To "grant" such a patent license to a 517 | party means to make such an agreement or commitment not to enforce a 518 | patent against the party. 519 | 520 | If you convey a covered work, knowingly relying on a patent license, 521 | and the Corresponding Source of the work is not available for anyone 522 | to copy, free of charge and under the terms of this License, through a 523 | publicly available network server or other readily accessible means, 524 | then you must either (1) cause the Corresponding Source to be so 525 | available, or (2) arrange to deprive yourself of the benefit of the 526 | patent license for this particular work, or (3) arrange, in a manner 527 | consistent with the requirements of this License, to extend the patent 528 | license to downstream recipients. "Knowingly relying" means you have 529 | actual knowledge that, but for the patent license, your conveying the 530 | covered work in a country, or your recipient's use of the covered work 531 | in a country, would infringe one or more identifiable patents in that 532 | country that you have reason to believe are valid. 533 | 534 | If, pursuant to or in connection with a single transaction or 535 | arrangement, you convey, or propagate by procuring conveyance of, a 536 | covered work, and grant a patent license to some of the parties 537 | receiving the covered work authorizing them to use, propagate, modify 538 | or convey a specific copy of the covered work, then the patent license 539 | you grant is automatically extended to all recipients of the covered 540 | work and works based on it. 541 | 542 | A patent license is "discriminatory" if it does not include within the 543 | scope of its coverage, prohibits the exercise of, or is conditioned on 544 | the non-exercise of one or more of the rights that are specifically 545 | granted under this License. You may not convey a covered work if you 546 | are a party to an arrangement with a third party that is in the 547 | business of distributing software, under which you make payment to the 548 | third party based on the extent of your activity of conveying the 549 | work, and under which the third party grants, to any of the parties 550 | who would receive the covered work from you, a discriminatory patent 551 | license (a) in connection with copies of the covered work conveyed by 552 | you (or copies made from those copies), or (b) primarily for and in 553 | connection with specific products or compilations that contain the 554 | covered work, unless you entered into that arrangement, or that patent 555 | license was granted, prior to 28 March 2007. 556 | 557 | Nothing in this License shall be construed as excluding or limiting 558 | any implied license or other defenses to infringement that may 559 | otherwise be available to you under applicable patent law. 560 | 561 | ### 12. No Surrender of Others' Freedom. 562 | 563 | If conditions are imposed on you (whether by court order, agreement or 564 | otherwise) that contradict the conditions of this License, they do not 565 | excuse you from the conditions of this License. If you cannot convey a 566 | covered work so as to satisfy simultaneously your obligations under 567 | this License and any other pertinent obligations, then as a 568 | consequence you may not convey it at all. For example, if you agree to 569 | terms that obligate you to collect a royalty for further conveying 570 | from those to whom you convey the Program, the only way you could 571 | satisfy both those terms and this License would be to refrain entirely 572 | from conveying the Program. 573 | 574 | ### 13. Use with the GNU Affero General Public License. 575 | 576 | Notwithstanding any other provision of this License, you have 577 | permission to link or combine any covered work with a work licensed 578 | under version 3 of the GNU Affero General Public License into a single 579 | combined work, and to convey the resulting work. The terms of this 580 | License will continue to apply to the part which is the covered work, 581 | but the special requirements of the GNU Affero General Public License, 582 | section 13, concerning interaction through a network will apply to the 583 | combination as such. 584 | 585 | ### 14. Revised Versions of this License. 586 | 587 | The Free Software Foundation may publish revised and/or new versions 588 | of the GNU General Public License from time to time. Such new versions 589 | will be similar in spirit to the present version, but may differ in 590 | detail to address new problems or concerns. 591 | 592 | Each version is given a distinguishing version number. If the Program 593 | specifies that a certain numbered version of the GNU General Public 594 | License "or any later version" applies to it, you have the option of 595 | following the terms and conditions either of that numbered version or 596 | of any later version published by the Free Software Foundation. If the 597 | Program does not specify a version number of the GNU General Public 598 | License, you may choose any version ever published by the Free 599 | Software Foundation. 600 | 601 | If the Program specifies that a proxy can decide which future versions 602 | of the GNU General Public License can be used, that proxy's public 603 | statement of acceptance of a version permanently authorizes you to 604 | choose that version for the Program. 605 | 606 | Later license versions may give you additional or different 607 | permissions. However, no additional obligations are imposed on any 608 | author or copyright holder as a result of your choosing to follow a 609 | later version. 610 | 611 | ### 15. Disclaimer of Warranty. 612 | 613 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 614 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 615 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT 616 | WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT 617 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 618 | A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND 619 | PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE 620 | DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR 621 | CORRECTION. 622 | 623 | ### 16. Limitation of Liability. 624 | 625 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 626 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR 627 | CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 628 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES 629 | ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT 630 | NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR 631 | LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM 632 | TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER 633 | PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 634 | 635 | ### 17. Interpretation of Sections 15 and 16. 636 | 637 | If the disclaimer of warranty and limitation of liability provided 638 | above cannot be given local legal effect according to their terms, 639 | reviewing courts shall apply local law that most closely approximates 640 | an absolute waiver of all civil liability in connection with the 641 | Program, unless a warranty or assumption of liability accompanies a 642 | copy of the Program in return for a fee. 643 | 644 | END OF TERMS AND CONDITIONS 645 | 646 | ## How to Apply These Terms to Your New Programs 647 | 648 | If you develop a new program, and you want it to be of the greatest 649 | possible use to the public, the best way to achieve this is to make it 650 | free software which everyone can redistribute and change under these 651 | terms. 652 | 653 | To do so, attach the following notices to the program. It is safest to 654 | attach them to the start of each source file to most effectively state 655 | the exclusion of warranty; and each file should have at least the 656 | "copyright" line and a pointer to where the full notice is found. 657 | 658 | 659 | Copyright (C) 660 | 661 | This program is free software: you can redistribute it and/or modify 662 | it under the terms of the GNU General Public License as published by 663 | the Free Software Foundation, either version 3 of the License, or 664 | (at your option) any later version. 665 | 666 | This program is distributed in the hope that it will be useful, 667 | but WITHOUT ANY WARRANTY; without even the implied warranty of 668 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 669 | GNU General Public License for more details. 670 | 671 | You should have received a copy of the GNU General Public License 672 | along with this program. If not, see . 673 | 674 | Also add information on how to contact you by electronic and paper 675 | mail. 676 | 677 | If the program does terminal interaction, make it output a short 678 | notice like this when it starts in an interactive mode: 679 | 680 | Copyright (C) 681 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 682 | This is free software, and you are welcome to redistribute it 683 | under certain conditions; type `show c' for details. 684 | 685 | The hypothetical commands \`show w' and \`show c' should show the 686 | appropriate parts of the General Public License. Of course, your 687 | program's commands might be different; for a GUI interface, you would 688 | use an "about box". 689 | 690 | You should also get your employer (if you work as a programmer) or 691 | school, if any, to sign a "copyright disclaimer" for the program, if 692 | necessary. For more information on this, and how to apply and follow 693 | the GNU GPL, see . 694 | 695 | The GNU General Public License does not permit incorporating your 696 | program into proprietary programs. If your program is a subroutine 697 | library, you may consider it more useful to permit linking proprietary 698 | applications with the library. If this is what you want to do, use the 699 | GNU Lesser General Public License instead of this License. But first, 700 | please read . 701 | --------------------------------------------------------------------------------