├── icon.rc
├── icon.ico
├── extras
└── icon_sources
│ ├── xpmgr.png
│ ├── xpmgr_vga.png
│ ├── xpmgr_16x16.png
│ ├── xpmgr_32x32.png
│ ├── xpmgr_48x48.png
│ ├── xpmgr_64x64.png
│ ├── xpmgr_96x96.png
│ ├── xpmgr_128x128.png
│ ├── xpmgr_256x256.png
│ ├── xpmgr_16x16_vga.png
│ ├── xpmgr_32x32_vga.png
│ ├── xpmgr_48x48_vga.png
│ ├── xpmgr_64x64_vga.png
│ ├── xpmgr_96x96_vga.png
│ ├── xpmgr_128x128_vga.png
│ ├── xpmgr_256x256_vga.png
│ └── README.txt
├── .idea
├── xpmgr.iml
├── vcs.xml
├── .gitignore
├── misc.xml
├── modules.xml
├── runConfigurations
│ ├── xpmgr_x64.xml
│ └── xpmgr_x86.xml
└── editor.xml
├── xpmgr.h
├── CMakeLists.txt
├── .gitattributes
├── README.md
├── .github
└── workflows
│ └── windows.yml
├── xpmgr.cpp
├── .gitignore
├── xpmgr_lib.cpp
├── ICON_LICENSE.txt
└── LICENSE
/icon.rc:
--------------------------------------------------------------------------------
1 | 1 ICON "icon.ico"
--------------------------------------------------------------------------------
/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UMSKT/xpmgr/HEAD/icon.ico
--------------------------------------------------------------------------------
/extras/icon_sources/xpmgr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UMSKT/xpmgr/HEAD/extras/icon_sources/xpmgr.png
--------------------------------------------------------------------------------
/extras/icon_sources/xpmgr_vga.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UMSKT/xpmgr/HEAD/extras/icon_sources/xpmgr_vga.png
--------------------------------------------------------------------------------
/.idea/xpmgr.iml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/extras/icon_sources/xpmgr_16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UMSKT/xpmgr/HEAD/extras/icon_sources/xpmgr_16x16.png
--------------------------------------------------------------------------------
/extras/icon_sources/xpmgr_32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UMSKT/xpmgr/HEAD/extras/icon_sources/xpmgr_32x32.png
--------------------------------------------------------------------------------
/extras/icon_sources/xpmgr_48x48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UMSKT/xpmgr/HEAD/extras/icon_sources/xpmgr_48x48.png
--------------------------------------------------------------------------------
/extras/icon_sources/xpmgr_64x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UMSKT/xpmgr/HEAD/extras/icon_sources/xpmgr_64x64.png
--------------------------------------------------------------------------------
/extras/icon_sources/xpmgr_96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UMSKT/xpmgr/HEAD/extras/icon_sources/xpmgr_96x96.png
--------------------------------------------------------------------------------
/extras/icon_sources/xpmgr_128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UMSKT/xpmgr/HEAD/extras/icon_sources/xpmgr_128x128.png
--------------------------------------------------------------------------------
/extras/icon_sources/xpmgr_256x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UMSKT/xpmgr/HEAD/extras/icon_sources/xpmgr_256x256.png
--------------------------------------------------------------------------------
/extras/icon_sources/xpmgr_16x16_vga.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UMSKT/xpmgr/HEAD/extras/icon_sources/xpmgr_16x16_vga.png
--------------------------------------------------------------------------------
/extras/icon_sources/xpmgr_32x32_vga.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UMSKT/xpmgr/HEAD/extras/icon_sources/xpmgr_32x32_vga.png
--------------------------------------------------------------------------------
/extras/icon_sources/xpmgr_48x48_vga.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UMSKT/xpmgr/HEAD/extras/icon_sources/xpmgr_48x48_vga.png
--------------------------------------------------------------------------------
/extras/icon_sources/xpmgr_64x64_vga.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UMSKT/xpmgr/HEAD/extras/icon_sources/xpmgr_64x64_vga.png
--------------------------------------------------------------------------------
/extras/icon_sources/xpmgr_96x96_vga.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UMSKT/xpmgr/HEAD/extras/icon_sources/xpmgr_96x96_vga.png
--------------------------------------------------------------------------------
/extras/icon_sources/xpmgr_128x128_vga.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UMSKT/xpmgr/HEAD/extras/icon_sources/xpmgr_128x128_vga.png
--------------------------------------------------------------------------------
/extras/icon_sources/xpmgr_256x256_vga.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/UMSKT/xpmgr/HEAD/extras/icon_sources/xpmgr_256x256_vga.png
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/extras/icon_sources/README.txt:
--------------------------------------------------------------------------------
1 | The icons in this folder follow the same CC-BY-SA 4.0 license as the final version, seen in the root folder.
2 | Modifications were made to the smaller VGA icons for clarity.
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Editor-based HTTP Client requests
5 | /httpRequests/
6 | # Datasource local storage ignored files
7 | /dataSources/
8 | /dataSources.local.xml
9 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/runConfigurations/xpmgr_x64.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.idea/runConfigurations/xpmgr_x86.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/xpmgr.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #ifdef __cplusplus
4 | extern "C" {
5 | #endif
6 |
7 | #include
8 |
9 | // Core functions that match command line options
10 | const wchar_t* XPMGR_GetInstallationID(); // /dti
11 | const wchar_t* XPMGR_SetConfirmationID(const wchar_t* confirmationId); // /atp
12 | const wchar_t* XPMGR_GetWPALeft(); // /xpr
13 | const wchar_t* XPMGR_GetEvalLeft(); // /xpr-eval
14 | const wchar_t* XPMGR_SetProductKey(const wchar_t* productKey); // /ipk
15 | const wchar_t* XPMGR_GetProductID(); // /dli
16 |
17 | // Additional utility functions
18 | const wchar_t* XPMGR_GetLastError();
19 | void XPMGR_Initialize();
20 | void XPMGR_Cleanup();
21 |
22 | #ifdef __cplusplus
23 | }
24 | #endif
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.15)
2 | project(xpmgr CXX)
3 |
4 | set(CMAKE_CXX_STANDARD 17)
5 | set(CMAKE_CXX_STANDARD_REQUIRED ON)
6 |
7 | set(SOURCES xpmgr.cpp)
8 | set(LIB_SOURCES xpmgr_lib.cpp)
9 |
10 | # ==== x86 build ====
11 |
12 | # Static library for x86
13 | add_library(xpmgr_static_x86 STATIC ${LIB_SOURCES})
14 | target_compile_options(xpmgr_static_x86 PRIVATE -m32)
15 | target_link_libraries(xpmgr_static_x86 PRIVATE ole32 oleaut32 uuid)
16 |
17 | set(RES_X86 ${CMAKE_BINARY_DIR}/icon_x86.res)
18 |
19 | # Create a custom target for the x86 resource compilation
20 | add_custom_command(
21 | OUTPUT ${RES_X86}
22 | COMMAND windres -F pe-i386 -O coff ${CMAKE_SOURCE_DIR}/icon.rc -o ${RES_X86}
23 | DEPENDS ${CMAKE_SOURCE_DIR}/icon.rc ${CMAKE_SOURCE_DIR}/icon.ico
24 | COMMENT "Compiling icon.rc for x86"
25 | )
26 |
27 | add_custom_target(xpmgr_x86_res ALL DEPENDS ${RES_X86})
28 |
29 | # Now define the executable and link dependencies
30 | add_executable(xpmgr_x86 ${SOURCES})
31 | add_dependencies(xpmgr_x86 xpmgr_x86_res)
32 |
33 | target_compile_options(xpmgr_x86 PRIVATE -m32)
34 | target_link_options(xpmgr_x86 PRIVATE -m32)
35 |
36 | # Link .res file and static library
37 | target_link_libraries(xpmgr_x86 PRIVATE ole32 oleaut32 uuid xpmgr_static_x86)
38 | target_link_options(xpmgr_x86 PRIVATE -Wl,--subsystem,console ${RES_X86})
39 |
40 | # ==== x64 build ====
41 |
42 | # Static library for x64
43 | add_library(xpmgr_static_x64 STATIC ${LIB_SOURCES})
44 | target_compile_options(xpmgr_static_x64 PRIVATE -m64)
45 | target_link_libraries(xpmgr_static_x64 PRIVATE ole32 oleaut32 uuid)
46 |
47 | set(RES_X64 ${CMAKE_BINARY_DIR}/icon_x64.res)
48 |
49 | # Create a custom target for the x64 resource compilation
50 | add_custom_command(
51 | OUTPUT ${RES_X64}
52 | COMMAND windres -O coff ${CMAKE_SOURCE_DIR}/icon.rc -o ${RES_X64}
53 | DEPENDS ${CMAKE_SOURCE_DIR}/icon.rc ${CMAKE_SOURCE_DIR}/icon.ico
54 | COMMENT "Compiling icon.rc for x64"
55 | )
56 |
57 | add_custom_target(xpmgr_x64_res ALL DEPENDS ${RES_X64})
58 |
59 | # Now define the executable and link dependencies
60 | add_executable(xpmgr_x64 ${SOURCES})
61 | add_dependencies(xpmgr_x64 xpmgr_x64_res)
62 |
63 | target_compile_options(xpmgr_x64 PRIVATE -m64)
64 | target_link_options(xpmgr_x64 PRIVATE -m64)
65 |
66 | # Link .res file and static library
67 | target_link_libraries(xpmgr_x64 PRIVATE ole32 oleaut32 uuid xpmgr_static_x64)
68 | target_link_options(xpmgr_x64 PRIVATE -Wl,--subsystem,console ${RES_X64})
69 |
70 | # Install targets
71 | install(TARGETS xpmgr_static_x86 xpmgr_static_x64
72 | ARCHIVE DESTINATION lib
73 | LIBRARY DESTINATION lib)
74 |
75 | install(FILES xpmgr.h DESTINATION include)
76 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # xpmgr
2 | 
3 |
4 | Command line interface for Windows XP license management, inspired by Microsoft's "slmgr".
5 |
6 | ## Usage
7 | **You need to download the right version for your edition of Windows XP/2003!**
8 |
9 | In most cases, you'll need `xpmgr_x86.exe`.
10 |
11 | If you have Windows XP Professional x64 Edition or a x64 version of Windows Server 2003, you need `xpmgr_x64.exe`.
12 |
13 | If you have an Itanium version of Windows XP or Server 2003, Windows Product Activation is not on those editions, so there is no need for this tool.
14 |
15 | `/dli`: Gets the product ID (ex: `76477-755-3803223-21229`).
16 |
17 | `/ipk`: Sets the product key (tested to work with dashes). If already activated, this should give an error instead.
18 |
19 | `/dti`: Gets an Installation ID with **no dashes** (ex: `253286028742154311079061239762245184619981623171292574`). If already activated, this should give an error instead.
20 |
21 | `/atp`: Sets a Confirmation ID (tested to work with dashes). If already activated, this should give an error instead. If successful, this also removes the "Activate Windows" shortcuts and kills the WPA notifier process (`wpabaln.exe`) if it's running.
22 |
23 | `/xpr`: Gets the number of days before activation is required, in days. If already activated, this should give an error instead.
24 |
25 | `/xpr-eval`: Gets the number of days before the evaluation period expires, in days. In non-evaluation copies of Windows, this should give an error instead.
26 |
27 | `/?`: Outputs all the commands you can use.
28 |
29 | `/ipk` and `/dti` also support reading from stdin via a pipe. So, you could do something like `echo FCKGW-RHQQ2-YXRKT-8TG6W-2B7Q8 | xpmgr_x86 /ipk` or `echo 253286028742154311079061239762245184619981623171292574 | xpmgr_x86 /atp` (replace echo with your own program).
30 |
31 | This can also be used as a library; see the xpmgr.h file for details.
32 |
33 | ## Releases
34 | https://github.com/UMSKT/xpmgr/releases
35 |
36 | ## Credits
37 | Icon made by [TehAweseomestKitteh](https://kittehcreations.com/), released under Creative Commons CC-BY-SA 4.0. Modified by [TheTank20](https://github.com/thepwrtank18) (poorly) to differenciate from UMSKT.
38 |
39 | ## License
40 | This code is licensed under the LGPLv3 license.
41 | > [!IMPORTANT]
42 | > Versions from May 7th, 2025 and earlier are licensed under the EPL license.
43 |
44 | ## Building
45 | Make sure Visual Studio 2017 or later is installed (recommended, might not be needed). Then, install [TDM-GCC](https://jmeubank.github.io/tdm-gcc/about/). Then, use CMake to build:
46 | ```
47 | cmake -S . -B build -G "MinGW Makefiles" -DCMAKE_CXX_COMPILER=C:/TDM-GCC-64/bin/g++.exe
48 | cmake --build build --config Debug
49 | ```
50 |
--------------------------------------------------------------------------------
/.github/workflows/windows.yml:
--------------------------------------------------------------------------------
1 | name: C/C++ CI (Windows)
2 |
3 | on:
4 | push:
5 | branches: [ "*" ]
6 |
7 | jobs:
8 | build:
9 | runs-on: windows-latest
10 | steps:
11 | - name: Checkout Source Tree
12 | uses: actions/checkout@v4.2.2
13 |
14 | - name: Cache TDM-GCC
15 | id: cache-gcc
16 | uses: actions/cache/restore@v4
17 | with:
18 | path: |
19 | C:\TDM-GCC-64
20 | key: TDM-GCC-10.3.0
21 |
22 | - name: Setup TDM-GCC
23 | if: steps.cache-gcc.outputs.cache-hit != 'true'
24 | run: |
25 | Write-Host Downloading TDM-GCC v10.3.0...
26 | Invoke-WebRequest -Uri 'https://github.com/jmeubank/tdm-gcc/releases/download/v10.3.0-tdm64-2/tdm64-gcc-10.3.0-2.exe' -OutFile 'C:\Windows\temp\TDM-GCC-64.exe'
27 | Write-Host Creating directory...
28 | New-Item -ItemType Directory -Path 'C:\TDM-GCC-64'
29 | Write-Host Copying files [Set 1/3]...
30 | Start-Process '7z' -ArgumentList 'e C:\Windows\temp\TDM-GCC-64.exe -oC:\TDM-GCC-64 -y' -Wait
31 | Write-Host Copying files [Set 2/3]...
32 | Start-Process '7z' -ArgumentList 'e C:\TDM-GCC-64\*.tar.xz -oC:\TDM-GCC-64 -y' -Wait
33 | Write-Host Copying files [Set 3/3]...
34 | Start-Process '7z' -ArgumentList 'x C:\TDM-GCC-64\*.tar -oC:\TDM-GCC-64 -y' -Wait
35 |
36 | - name: Save TDM-GCC
37 | uses: actions/cache/save@v4
38 | if: steps.cache-gcc.outputs.cache-hit != 'true'
39 | with:
40 | path: |
41 | C:\TDM-GCC-64
42 | key: TDM-GCC-10.3.0
43 |
44 | - name: Setup folder directories
45 | run: |
46 | Write-Host Adding environment variables...
47 | $env:PATH = 'C:\TDM-GCC-64\bin;' + $env:PATH
48 | [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine)
49 | mkdir build
50 | mkdir build\x86
51 | mkdir build\x64
52 |
53 | - name: Build xpmgr
54 | run: |
55 | cmake -S . -B build -G "MinGW Makefiles" -DCMAKE_CXX_COMPILER=C:/TDM-GCC-64/bin/g++.exe
56 | cmake --build build --config Debug
57 |
58 | - name: Upload build artifact (x86)
59 | uses: actions/upload-artifact@v4.6.2
60 | with:
61 | name: xpmgr (x86)
62 | path: .\build\xpmgr_x86.exe
63 |
64 | - name: Upload build artifact (x64)
65 | uses: actions/upload-artifact@v4.6.2
66 | with:
67 | name: xpmgr (x64)
68 | path: .\build\xpmgr_x64.exe
69 |
70 | compress:
71 | needs: build
72 | if: success()
73 | runs-on: windows-latest
74 | steps:
75 | - name: Cache TDM-GCC
76 | id: cache-gcc
77 | uses: actions/cache/restore@v4
78 | with:
79 | path: |
80 | C:\TDM-GCC-64
81 | key: TDM-GCC-10.3.0
82 |
83 | - name: Setup TDM-GCC
84 | if: steps.cache-gcc.outputs.cache-hit != 'true'
85 | run: |
86 | Write-Host Downloading TDM-GCC v10.3.0...
87 | Invoke-WebRequest -Uri 'https://github.com/jmeubank/tdm-gcc/releases/download/v10.3.0-tdm64-2/tdm64-gcc-10.3.0-2.exe' -OutFile 'C:\Windows\temp\TDM-GCC-64.exe'
88 | Write-Host Creating directory...
89 | New-Item -ItemType Directory -Path 'C:\TDM-GCC-64'
90 | Write-Host Copying files [Set 1/3]...
91 | Start-Process '7z' -ArgumentList 'e C:\Windows\temp\TDM-GCC-64.exe -oC:\TDM-GCC-64 -y' -Wait
92 | Write-Host Copying files [Set 2/3]...
93 | Start-Process '7z' -ArgumentList 'e C:\TDM-GCC-64\*.tar.xz -oC:\TDM-GCC-64 -y' -Wait
94 | Write-Host Copying files [Set 3/3]...
95 | Start-Process '7z' -ArgumentList 'x C:\TDM-GCC-64\*.tar -oC:\TDM-GCC-64 -y' -Wait
96 |
97 | - name: Save TDM-GCC
98 | uses: actions/cache/save@v4
99 | if: steps.cache-gcc.outputs.cache-hit != 'true'
100 | with:
101 | path: |
102 | C:\TDM-GCC-64
103 | key: TDM-GCC-10.3.0
104 |
105 | - name: Setup UPX
106 | run: |
107 | Invoke-WebRequest -Uri 'https://github.com/upx/upx/releases/download/v5.0.2/upx-5.0.2-win64.zip' -OutFile 'C:\Windows\temp\upx.zip'
108 | Write-Host Creating directory...
109 | New-Item -ItemType Directory -Path 'C:\UPX'
110 | Write-Host Copying files...
111 | Expand-Archive -Path 'C:\Windows\temp\upx.zip' -DestinationPath 'C:\UPX'
112 | Write-Host Adding environment variables...
113 | $env:PATH = 'C:\UPX\upx-5.0.2-win64;' + $env:PATH
114 | [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine)
115 |
116 | - name: Download x86 artifact
117 | uses: actions/download-artifact@v4
118 | with:
119 | name: xpmgr (x86)
120 | path: .\build\x86
121 | - name: Download x64 artifact
122 | uses: actions/download-artifact@v4
123 | with:
124 | name: xpmgr (x64)
125 | path: .\build\x64
126 |
127 | - name: Compress binaries
128 | shell: pwsh
129 | run: |
130 | # Strip symbols
131 | strip .\build\x86\xpmgr_x86.exe
132 | strip .\build\x64\xpmgr_x64.exe
133 |
134 | # Remove resources
135 | New-Item -ItemType Directory -Force -Path .\actions_upload
136 | llvm-objcopy --remove-section .rsrc .\build\x86\xpmgr_x86.exe .\actions_upload\xpmgr_x86_comp.exe
137 | llvm-objcopy --remove-section .rsrc .\build\x64\xpmgr_x64.exe .\actions_upload\xpmgr_x64_comp.exe
138 |
139 |
140 | # Compress with UPX
141 | & "C:\UPX\upx-5.0.2-win64\upx.exe" --best --ultra-brute .\actions_upload\xpmgr_x86_comp.exe
142 | & "C:\UPX\upx-5.0.2-win64\upx.exe" --best --ultra-brute .\actions_upload\xpmgr_x64_comp.exe
143 |
144 | Rename-Item -Path .\actions_upload\xpmgr_x86_comp.exe -NewName xpmgr_x86.exe
145 | Rename-Item -Path .\actions_upload\xpmgr_x64_comp.exe -NewName xpmgr_x64.exe
146 |
147 | - name: Upload build artifact (x86)
148 | uses: actions/upload-artifact@v4.6.2
149 | with:
150 | name: xpmgr (x86, compressed)
151 | path: .\actions_upload\xpmgr_x86.exe
152 |
153 | - name: Upload build artifact (x64)
154 | uses: actions/upload-artifact@v4.6.2
155 | with:
156 | name: xpmgr (x64, compressed)
157 | path: .\actions_upload\xpmgr_x64.exe
158 |
--------------------------------------------------------------------------------
/xpmgr.cpp:
--------------------------------------------------------------------------------
1 | // ReSharper disable CppEnforceOverridingFunctionStyle
2 | typedef struct IUnknown IUnknown;
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include "xpmgr.h"
9 |
10 | // Command line handling
11 | struct CommandLineArgs {
12 | static const char* getCmdOption(char** begin, char** end, const std::string& option) {
13 | const char* opt = option.c_str();
14 | char** itr = std::find_if(begin, end, [opt](const char* arg) { return strcmp(arg, opt) == 0; });
15 | if (itr != end && ++itr != end) {
16 | return *itr;
17 | }
18 | return nullptr;
19 | }
20 |
21 | static bool cmdOptionExists(char** begin, char** end, const std::string& option) {
22 | const char* opt = option.c_str();
23 | return std::find_if(begin, end, [opt](const char* arg) { return strcmp(arg, opt) == 0; }) != end;
24 | }
25 |
26 | static std::string readFromStdin() {
27 | std::string input;
28 | if (!std::cin.eof() && std::getline(std::cin, input)) {
29 | // Remove any trailing whitespace, newlines or carriage returns
30 | input.erase(std::find_if(input.rbegin(), input.rend(), [](unsigned char ch) {
31 | return !std::isspace(ch);
32 | }).base(), input.end());
33 | return input;
34 | }
35 | return "";
36 | }
37 | };
38 |
39 | // Helper function to convert char* to wchar_t*
40 | wchar_t* convertCharArrayToLPCWSTR(const char* charArray) {
41 | auto* wString = new wchar_t[4096];
42 | MultiByteToWideChar(CP_ACP, 0, charArray, -1, wString, 4096);
43 | return wString;
44 | }
45 |
46 | // Helper function to convert wchar_t* to char*
47 | char* convertWCharToChar(const wchar_t* wcharArray) {
48 | const int size = WideCharToMultiByte(CP_UTF8, 0, wcharArray, -1, nullptr, 0, nullptr, nullptr);
49 | auto* charStr = new char[size];
50 | WideCharToMultiByte(CP_UTF8, 0, wcharArray, -1, charStr, size, nullptr, nullptr);
51 | return charStr;
52 | }
53 |
54 | int main(int argc, char* argv[]) {
55 | const char* USAGE_TEXT =
56 | "xpmgr - Windows XP License Manager (compiled on " __DATE__ " " __TIME__ ")\n"
57 | "\n"
58 | "Usage: \n"
59 | "/dti: Gets the Installation ID\n"
60 | "/atp [cid]: Sets Confirmation ID (If successful, activates Windows/Office) (can also read from stdin)\n"
61 | "/xpr: Gets the days before activation is required (Grace period)\n"
62 | "/xpr-eval: Gets the days before the evaluation period expires (Eval. copies only)\n"
63 | "/ipk [pkey]: Sets/changes product key (can also read from stdin)\n"
64 | "/dli: Gets the product ID of Windows\n"
65 | "/?: Displays this message";
66 |
67 | if (CommandLineArgs::cmdOptionExists(argv, argv + argc, "--GetUsage")) {
68 | std::cout << USAGE_TEXT;
69 | return 0;
70 | }
71 |
72 | // Check Windows version
73 | OSVERSIONINFOEX info = {};
74 | info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
75 | GetVersionEx(reinterpret_cast(&info));
76 |
77 | if (info.dwMajorVersion != 5) {
78 | std::cout << "An error occurred: Windows management only works on Windows NT 5.1 and 5.2.";
79 | if (info.dwMajorVersion > 5) {
80 | std::cout << " Use slmgr instead: https://learn.microsoft.com/en-us/windows-server/get-started/activation-slmgr-vbs-options";
81 | return 3;
82 | }
83 | return 2;
84 | }
85 |
86 | if (info.dwMinorVersion != 1 && info.dwMinorVersion != 2) {
87 | std::cout << "An error occurred: Windows management only works on Windows NT 5.1 and 5.2.";
88 | if (info.dwMinorVersion == 0) {
89 | std::cout << " You should be fine anyways, since Windows 2000 doesn't use Product Activation.";
90 | return 4;
91 | }
92 | return 5;
93 | }
94 |
95 | // Check architecture
96 | #ifdef ENVIRONMENT32
97 | SYSTEM_INFO systemInfo;
98 | GetNativeSystemInfo(&systemInfo);
99 | if (systemInfo.wProcessorArchitecture != PROCESSOR_ARCHITECTURE_INTEL) {
100 | if (systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) {
101 | std::cout << "An error occurred: Incorrect version of xpmgr. You need to download the x64 version.";
102 | return 1;
103 | }
104 | if (systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64) {
105 | std::cout << "An error occurred: Windows Product Activation does not exist on this platform.";
106 | return 1;
107 | }
108 | std::cout << "An error occurred: Incorrect version of xpmgr. Send an issue at https://github.com/UMSKT/xpmgr/issues if you want to help us make a version for your platform!";
109 | return 1;
110 | }
111 | #endif
112 |
113 | // Initialize the library
114 | XPMGR_Initialize();
115 |
116 | // Handle commands
117 | const wchar_t* result = nullptr;
118 | if (CommandLineArgs::cmdOptionExists(argv, argv + argc, "/dti")) {
119 | result = XPMGR_GetInstallationID();
120 | }
121 | else if (CommandLineArgs::cmdOptionExists(argv, argv + argc, "/atp")) {
122 | const char* confirmationId = CommandLineArgs::getCmdOption(argv, argv + argc, "/atp");
123 | if (!confirmationId) {
124 | std::string pipedInput = CommandLineArgs::readFromStdin();
125 | if (!pipedInput.empty()) {
126 | result = XPMGR_SetConfirmationID(convertCharArrayToLPCWSTR(pipedInput.c_str()));
127 | } else {
128 | std::cout << "An error occurred: No confirmation ID provided via argument or pipe\n\n" << USAGE_TEXT;
129 | XPMGR_Cleanup();
130 | return 7;
131 | }
132 | } else {
133 | result = XPMGR_SetConfirmationID(convertCharArrayToLPCWSTR(confirmationId));
134 | }
135 | }
136 | else if (CommandLineArgs::cmdOptionExists(argv, argv + argc, "/xpr")) {
137 | result = XPMGR_GetWPALeft();
138 | }
139 | else if (CommandLineArgs::cmdOptionExists(argv, argv + argc, "/xpr-eval")) {
140 | result = XPMGR_GetEvalLeft();
141 | }
142 | else if (CommandLineArgs::cmdOptionExists(argv, argv + argc, "/ipk")) {
143 | const char* productKey = CommandLineArgs::getCmdOption(argv, argv + argc, "/ipk");
144 | if (!productKey) {
145 | std::string pipedInput = CommandLineArgs::readFromStdin();
146 | if (!pipedInput.empty()) {
147 | result = XPMGR_SetProductKey(convertCharArrayToLPCWSTR(pipedInput.c_str()));
148 | } else {
149 | std::cout << "An error occurred: No product key provided via argument or pipe\n\n" << USAGE_TEXT;
150 | XPMGR_Cleanup();
151 | return 7;
152 | }
153 | } else {
154 | result = XPMGR_SetProductKey(convertCharArrayToLPCWSTR(productKey));
155 | }
156 | }
157 | else if (CommandLineArgs::cmdOptionExists(argv, argv + argc, "/dli")) {
158 | result = XPMGR_GetProductID();
159 | }
160 | else {
161 | std::cout << "An error occurred: No arguments listed\n\n" << USAGE_TEXT;
162 | XPMGR_Cleanup();
163 | return 7;
164 | }
165 |
166 | if (result) {
167 | char* output = convertWCharToChar(result);
168 | std::cout << output;
169 | delete[] output;
170 | }
171 |
172 | XPMGR_Cleanup();
173 | return 0;
174 | }
175 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Oo]ut/
33 | [Ll]og/
34 | [Ll]ogs/
35 | [Bb]uild/
36 | cmake-build-debug/
37 |
38 | # Visual Studio 2015/2017 cache/options directory
39 | .vs/
40 | # Uncomment if you have tasks that create the project's static files in wwwroot
41 | #wwwroot/
42 |
43 | # Visual Studio 2017 auto generated files
44 | Generated\ Files/
45 |
46 | # MSTest test Results
47 | [Tt]est[Rr]esult*/
48 | [Bb]uild[Ll]og.*
49 |
50 | # NUnit
51 | *.VisualState.xml
52 | TestResult.xml
53 | nunit-*.xml
54 |
55 | # Build Results of an ATL Project
56 | [Dd]ebugPS/
57 | [Rr]eleasePS/
58 | dlldata.c
59 |
60 | # Benchmark Results
61 | BenchmarkDotNet.Artifacts/
62 |
63 | # .NET Core
64 | project.lock.json
65 | project.fragment.lock.json
66 | artifacts/
67 |
68 | # ASP.NET Scaffolding
69 | ScaffoldingReadMe.txt
70 |
71 | # StyleCop
72 | StyleCopReport.xml
73 |
74 | # Files built by Visual Studio
75 | *_i.c
76 | *_p.c
77 | *_h.h
78 | *.ilk
79 | *.meta
80 | *.obj
81 | *.iobj
82 | *.pch
83 | *.pdb
84 | *.ipdb
85 | *.pgc
86 | *.pgd
87 | *.rsp
88 | *.sbr
89 | *.tlb
90 | *.tli
91 | *.tlh
92 | *.tmp
93 | *.tmp_proj
94 | *_wpftmp.csproj
95 | *.log
96 | *.vspscc
97 | *.vssscc
98 | .builds
99 | *.pidb
100 | *.svclog
101 | *.scc
102 |
103 | # Chutzpah Test files
104 | _Chutzpah*
105 |
106 | # Visual C++ cache files
107 | ipch/
108 | *.aps
109 | *.ncb
110 | *.opendb
111 | *.opensdf
112 | *.sdf
113 | *.cachefile
114 | *.VC.db
115 | *.VC.VC.opendb
116 |
117 | # Visual Studio profiler
118 | *.psess
119 | *.vsp
120 | *.vspx
121 | *.sap
122 |
123 | # Visual Studio Trace Files
124 | *.e2e
125 |
126 | # TFS 2012 Local Workspace
127 | $tf/
128 |
129 | # Guidance Automation Toolkit
130 | *.gpState
131 |
132 | # ReSharper is a .NET coding add-in
133 | _ReSharper*/
134 | *.[Rr]e[Ss]harper
135 | *.DotSettings.user
136 |
137 | # TeamCity is a build add-in
138 | _TeamCity*
139 |
140 | # DotCover is a Code Coverage Tool
141 | *.dotCover
142 |
143 | # AxoCover is a Code Coverage Tool
144 | .axoCover/*
145 | !.axoCover/settings.json
146 |
147 | # Coverlet is a free, cross platform Code Coverage Tool
148 | coverage*.json
149 | coverage*.xml
150 | coverage*.info
151 |
152 | # Visual Studio code coverage results
153 | *.coverage
154 | *.coveragexml
155 |
156 | # NCrunch
157 | _NCrunch_*
158 | .*crunch*.local.xml
159 | nCrunchTemp_*
160 |
161 | # MightyMoose
162 | *.mm.*
163 | AutoTest.Net/
164 |
165 | # Web workbench (sass)
166 | .sass-cache/
167 |
168 | # Installshield output folder
169 | [Ee]xpress/
170 |
171 | # DocProject is a documentation generator add-in
172 | DocProject/buildhelp/
173 | DocProject/Help/*.HxT
174 | DocProject/Help/*.HxC
175 | DocProject/Help/*.hhc
176 | DocProject/Help/*.hhk
177 | DocProject/Help/*.hhp
178 | DocProject/Help/Html2
179 | DocProject/Help/html
180 |
181 | # Click-Once directory
182 | publish/
183 |
184 | # Publish Web Output
185 | *.[Pp]ublish.xml
186 | *.azurePubxml
187 | # Note: Comment the next line if you want to checkin your web deploy settings,
188 | # but database connection strings (with potential passwords) will be unencrypted
189 | *.pubxml
190 | *.publishproj
191 |
192 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
193 | # checkin your Azure Web App publish settings, but sensitive information contained
194 | # in these scripts will be unencrypted
195 | PublishScripts/
196 |
197 | # NuGet Packages
198 | *.nupkg
199 | # NuGet Symbol Packages
200 | *.snupkg
201 | # The packages folder can be ignored because of Package Restore
202 | **/[Pp]ackages/*
203 | # except build/, which is used as an MSBuild target.
204 | !**/[Pp]ackages/build/
205 | # Uncomment if necessary however generally it will be regenerated when needed
206 | #!**/[Pp]ackages/repositories.config
207 | # NuGet v3's project.json files produces more ignorable files
208 | *.nuget.props
209 | *.nuget.targets
210 |
211 | # Microsoft Azure Build Output
212 | csx/
213 | *.build.csdef
214 |
215 | # Microsoft Azure Emulator
216 | ecf/
217 | rcf/
218 |
219 | # Windows Store app package directories and files
220 | AppPackages/
221 | BundleArtifacts/
222 | Package.StoreAssociation.xml
223 | _pkginfo.txt
224 | *.appx
225 | *.appxbundle
226 | *.appxupload
227 |
228 | # Visual Studio cache files
229 | # files ending in .cache can be ignored
230 | *.[Cc]ache
231 | # but keep track of directories ending in .cache
232 | !?*.[Cc]ache/
233 |
234 | # Others
235 | ClientBin/
236 | ~$*
237 | *~
238 | *.dbmdl
239 | *.dbproj.schemaview
240 | *.jfm
241 | *.pfx
242 | *.publishsettings
243 | orleans.codegen.cs
244 |
245 | # Including strong name files can present a security risk
246 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
247 | #*.snk
248 |
249 | # Since there are multiple workflows, uncomment next line to ignore bower_components
250 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
251 | #bower_components/
252 |
253 | # RIA/Silverlight projects
254 | Generated_Code/
255 |
256 | # Backup & report files from converting an old project file
257 | # to a newer Visual Studio version. Backup files are not needed,
258 | # because we have git ;-)
259 | _UpgradeReport_Files/
260 | Backup*/
261 | UpgradeLog*.XML
262 | UpgradeLog*.htm
263 | ServiceFabricBackup/
264 | *.rptproj.bak
265 |
266 | # SQL Server files
267 | *.mdf
268 | *.ldf
269 | *.ndf
270 |
271 | # Business Intelligence projects
272 | *.rdl.data
273 | *.bim.layout
274 | *.bim_*.settings
275 | *.rptproj.rsuser
276 | *- [Bb]ackup.rdl
277 | *- [Bb]ackup ([0-9]).rdl
278 | *- [Bb]ackup ([0-9][0-9]).rdl
279 |
280 | # Microsoft Fakes
281 | FakesAssemblies/
282 |
283 | # GhostDoc plugin setting file
284 | *.GhostDoc.xml
285 |
286 | # Node.js Tools for Visual Studio
287 | .ntvs_analysis.dat
288 | node_modules/
289 |
290 | # Visual Studio 6 build log
291 | *.plg
292 |
293 | # Visual Studio 6 workspace options file
294 | *.opt
295 |
296 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
297 | *.vbw
298 |
299 | # Visual Studio LightSwitch build output
300 | **/*.HTMLClient/GeneratedArtifacts
301 | **/*.DesktopClient/GeneratedArtifacts
302 | **/*.DesktopClient/ModelManifest.xml
303 | **/*.Server/GeneratedArtifacts
304 | **/*.Server/ModelManifest.xml
305 | _Pvt_Extensions
306 |
307 | # Paket dependency manager
308 | .paket/paket.exe
309 | paket-files/
310 |
311 | # FAKE - F# Make
312 | .fake/
313 |
314 | # CodeRush personal settings
315 | .cr/personal
316 |
317 | # Python Tools for Visual Studio (PTVS)
318 | __pycache__/
319 | *.pyc
320 |
321 | # Cake - Uncomment if you are using it
322 | # tools/**
323 | # !tools/packages.config
324 |
325 | # Tabs Studio
326 | *.tss
327 |
328 | # Telerik's JustMock configuration file
329 | *.jmconfig
330 |
331 | # BizTalk build output
332 | *.btp.cs
333 | *.btm.cs
334 | *.odx.cs
335 | *.xsd.cs
336 |
337 | # OpenCover UI analysis results
338 | OpenCover/
339 |
340 | # Azure Stream Analytics local run output
341 | ASALocalRun/
342 |
343 | # MSBuild Binary and Structured Log
344 | *.binlog
345 |
346 | # NVidia Nsight GPU debugger configuration file
347 | *.nvuser
348 |
349 | # MFractors (Xamarin productivity tool) working folder
350 | .mfractor/
351 |
352 | # Local History for Visual Studio
353 | .localhistory/
354 |
355 | # BeatPulse healthcheck temp database
356 | healthchecksdb
357 |
358 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
359 | MigrationBackup/
360 |
361 | # Ionide (cross platform F# VS Code tools) working folder
362 | .ionide/
363 |
364 | # Fody - auto-generated XML schema
365 | FodyWeavers.xsd
366 |
367 | CMakeFiles/
--------------------------------------------------------------------------------
/xpmgr_lib.cpp:
--------------------------------------------------------------------------------
1 | #include "xpmgr.h"
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 |
11 | // CLSID and IID definitions
12 | static CLSID XP_CLSID = { 0xACADF079, 0xCBCD, 0x4032, {0x83, 0xF2, 0xFA, 0x47, 0xC4, 0xDB, 0x09, 0x6F} };
13 | static IID XP_IID = { 0xB8CBAD79, 0x3F1F, 0x481A, { 0xBB, 0x0C, 0xE7, 0xBB, 0xD7, 0x7B, 0xDD, 0xD1 } };
14 |
15 | // Interface definition
16 | DECLARE_INTERFACE_(ICOMLicenseAgent, IDispatch)
17 | {
18 | protected:
19 | ~ICOMLicenseAgent() = default;
20 |
21 | public:
22 | /*** IUnknown methods ***/
23 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* ppvObj) PURE;
24 | STDMETHOD_(ULONG, AddRef)() PURE;
25 | STDMETHOD_(ULONG, Release)() PURE;
26 |
27 | /*** IDispatch methods ***/
28 | STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE;
29 | STDMETHOD(GetTypeInfo)(THIS_ UINT itinfo, LCID lcid, ITypeInfo FAR* FAR* pptinfo) PURE;
30 | STDMETHOD(GetIDsOfNames)(THIS_ REFIID riid, OLECHAR FAR* FAR* rgszNames, UINT cNames, LCID lcid, DISPID FAR* rgdispid) PURE;
31 | STDMETHOD(Invoke)(THIS_ DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS FAR* pdispparams, VARIANT FAR* pvarResult, EXCEPINFO FAR* pexcepinfo, UINT FAR* puArgErr) PURE;
32 |
33 | /*** ICOMLicenseAgent methods ***/
34 | STDMETHOD(Initialize)(THIS_ ULONG dwBPC, ULONG dwMode, BSTR bstrLicSource, ULONG* pdwRetCode) PURE;
35 | STDMETHOD(GetFirstName)(THIS_ BSTR* pbstrVal) PURE;
36 | STDMETHOD(SetFirstName)(THIS_ BSTR bstrNewVal) PURE;
37 | STDMETHOD(GetLastName)(THIS_ BSTR* pbstrVal) PURE;
38 | STDMETHOD(SetLastName)(THIS_ BSTR bstrNewVal) PURE;
39 | STDMETHOD(GetOrgName)(THIS_ BSTR* pbstrVal) PURE;
40 | STDMETHOD(SetOrgName)(THIS_ BSTR bstrNewVal) PURE;
41 | STDMETHOD(GetEmail)(THIS_ BSTR* pbstrVal) PURE;
42 | STDMETHOD(SetEmail)(THIS_ BSTR bstrNewVal) PURE;
43 | STDMETHOD(GetPhone)(THIS_ BSTR* pbstrVal) PURE;
44 | STDMETHOD(SetPhone)(THIS_ BSTR bstrNewVal) PURE;
45 | STDMETHOD(GetAddress1)(THIS_ BSTR* pbstrVal) PURE;
46 | STDMETHOD(SetAddress1)(THIS_ BSTR bstrNewVal) PURE;
47 | STDMETHOD(GetCity)(THIS_ BSTR* pbstrVal) PURE;
48 | STDMETHOD(SetCity)(THIS_ BSTR bstrNewVal) PURE;
49 | STDMETHOD(GetState)(THIS_ BSTR* pbstrVal) PURE;
50 | STDMETHOD(SetState)(THIS_ BSTR bstrNewVal) PURE;
51 | STDMETHOD(GetCountryCode)(THIS_ BSTR* pbstrVal) PURE;
52 | STDMETHOD(SetCountryCode)(THIS_ BSTR bstrNewVal) PURE;
53 | STDMETHOD(GetCountryDesc)(THIS_ BSTR* pbstrVal) PURE;
54 | STDMETHOD(SetCountryDesc)(THIS_ BSTR bstrNewVal) PURE;
55 | STDMETHOD(GetZip)(THIS_ BSTR* pbstrVal) PURE;
56 | STDMETHOD(SetZip)(THIS_ BSTR bstrNewVal) PURE;
57 | STDMETHOD(GetIsoLanguage)(THIS_ ULONG* pdwVal) PURE;
58 | STDMETHOD(SetIsoLanguage)(THIS_ ULONG dwNewVal) PURE;
59 | STDMETHOD(GetMSUpdate)(THIS_ BSTR* pbstrVal) PURE;
60 | STDMETHOD(SetMSUpdate)(THIS_ BSTR bstrNewVal) PURE;
61 | STDMETHOD(GetMSOffer)(THIS_ BSTR* pbstrVal) PURE;
62 | STDMETHOD(SetMSOffer)(THIS_ BSTR bstrNewVal) PURE;
63 | STDMETHOD(GetOtherOffer)(THIS_ BSTR* pbstrVal) PURE;
64 | STDMETHOD(SetOtherOffer)(THIS_ BSTR bstrNewVal) PURE;
65 | STDMETHOD(GetAddress2)(THIS_ BSTR* pbstrVal) PURE;
66 | STDMETHOD(SetAddress2)(THIS_ BSTR bstrNewVal) PURE;
67 | STDMETHOD(AsyncProcessHandshakeRequest)(THIS_ LONG bReviseCustInfo) PURE;
68 | STDMETHOD(AsyncProcessNewLicenseRequest)() PURE;
69 | STDMETHOD(AsyncProcessReissueLicenseRequest)() PURE;
70 | STDMETHOD(AsyncProcessReviseCustInfoRequest)() PURE;
71 | STDMETHOD(GetAsyncProcessReturnCode)(THIS_ ULONG* pdwRetCode) PURE;
72 | STDMETHOD(AsyncProcessDroppedLicenseRequest)() PURE;
73 | STDMETHOD(GenerateInstallationId)(THIS_ BSTR* pbstrVal) PURE;
74 | STDMETHOD(DepositConfirmationId)(THIS_ BSTR bstrVal, ULONG* pdwRetCode) PURE;
75 | STDMETHOD(GetExpirationInfo)(THIS_ ULONG* pdwWPALeft, ULONG* pdwEvalLeft) PURE;
76 | STDMETHOD(AsyncProcessRegistrationRequest)() PURE;
77 | STDMETHOD(ProcessHandshakeRequest)(THIS_ LONG bReviseCustInfo) PURE;
78 | STDMETHOD(ProcessNewLicenseRequest)() PURE;
79 | STDMETHOD(ProcessDroppedLicenseRequest)() PURE;
80 | STDMETHOD(ProcessReissueLicenseRequest)() PURE;
81 | STDMETHOD(ProcessReviseCustInfoRequest)() PURE;
82 | STDMETHOD(EnsureInternetConnection)() PURE;
83 | STDMETHOD(SetProductKey)(THIS_ LPWSTR pszNewProductKey) PURE;
84 | STDMETHOD(GetProductID)(THIS_ BSTR* pbstrVal) PURE;
85 | STDMETHOD(VerifyCheckDigits)(THIS_ BSTR bstrCIDIID, LONG* pbValue) PURE;
86 | };
87 |
88 | // Static variables
89 | static BOOL XP_ComInitialized = FALSE;
90 | static ICOMLicenseAgent* XP_LicenseAgent = nullptr;
91 | static wchar_t LastErrorMessage[1024] = L"";
92 |
93 | // Helper functions
94 | static void SetLastErrorMessage(const wchar_t* message) {
95 | wcscpy(LastErrorMessage, message);
96 | }
97 |
98 | static BOOL XP_LoadLicenseManager() {
99 | if (!XP_ComInitialized) {
100 | const HRESULT status = CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
101 | if (FAILED(status)) {
102 | SetLastErrorMessage(L"Failed to initialize COM");
103 | return FALSE;
104 | }
105 | XP_ComInitialized = TRUE;
106 | }
107 |
108 | if (!XP_LicenseAgent) {
109 | HRESULT status = CoCreateInstance(XP_CLSID, nullptr, CLSCTX_INPROC_SERVER, XP_IID, reinterpret_cast(&XP_LicenseAgent));
110 | if (SUCCEEDED(status)) {
111 | ULONG dwRetCode;
112 | status = XP_LicenseAgent->Initialize(0xC475, 3, nullptr, &dwRetCode);
113 | if (SUCCEEDED(status) && dwRetCode == 0) {
114 | return TRUE;
115 | }
116 | XP_LicenseAgent->Release();
117 | XP_LicenseAgent = nullptr;
118 | }
119 | SetLastErrorMessage(L"Failed to create license manager instance");
120 | return FALSE;
121 | }
122 | return TRUE;
123 | }
124 |
125 | // Helper function to verify a confirmation ID chunk
126 | static bool VerifyConfirmationIDChunk(ICOMLicenseAgent* agent, const wchar_t* chunk) {
127 | LONG pbValue = 0;
128 | BSTR bstrChunk = SysAllocString(chunk);
129 | HRESULT status = agent->VerifyCheckDigits(bstrChunk, &pbValue);
130 | SysFreeString(bstrChunk);
131 | return SUCCEEDED(status) && pbValue != 0;
132 | }
133 |
134 | struct ProcessHandle {
135 | HANDLE handle;
136 | explicit ProcessHandle(HANDLE h) : handle(h) {}
137 | ~ProcessHandle() { if (handle != INVALID_HANDLE_VALUE) CloseHandle(handle); }
138 | operator HANDLE() const { return handle; }
139 | };
140 |
141 | bool IsProcessRunning(const wchar_t* processName) {
142 | ProcessHandle snapshot(CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0));
143 | if (snapshot == INVALID_HANDLE_VALUE) {
144 | std::cout << "Failed to create process snapshot: " << GetLastError() << std::endl;
145 | return false;
146 | }
147 |
148 | PROCESSENTRY32W processEntry{};
149 | processEntry.dwSize = sizeof(PROCESSENTRY32W);
150 |
151 | if (!Process32FirstW(snapshot, &processEntry)) {
152 | std::cout << "Failed to retrieve process information: " << GetLastError() << std::endl;
153 | return false;
154 | }
155 |
156 | do {
157 | if (wcscmp(processEntry.szExeFile, processName) == 0) {
158 | return true;
159 | }
160 | } while (Process32NextW(snapshot, &processEntry));
161 |
162 | return false;
163 | }
164 |
165 | bool TerminateProcessByName(const wchar_t* processName) {
166 | ProcessHandle snapshot(CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0));
167 | if (snapshot == INVALID_HANDLE_VALUE) {
168 | std::cout << "Failed to create process snapshot: " << GetLastError() << std::endl;
169 | return false;
170 | }
171 |
172 | PROCESSENTRY32W processEntry{};
173 | processEntry.dwSize = sizeof(PROCESSENTRY32W);
174 |
175 | if (!Process32FirstW(snapshot, &processEntry)) {
176 | std::cout << "Failed to retrieve process information: " << GetLastError() << std::endl;
177 | return false;
178 | }
179 |
180 | do {
181 | if (wcscmp(processEntry.szExeFile, processName) == 0) {
182 | ProcessHandle processHandle(OpenProcess(PROCESS_TERMINATE, FALSE, processEntry.th32ProcessID));
183 | if (processHandle == nullptr) {
184 | std::cout << "Failed to open process: " << GetLastError() << std::endl;
185 | return false;
186 | }
187 |
188 | if (!TerminateProcess(processHandle, 0)) {
189 | std::cout << "Failed to terminate process: " << GetLastError() << std::endl;
190 | return false;
191 | }
192 |
193 | return true;
194 | }
195 | } while (Process32NextW(snapshot, &processEntry));
196 |
197 | std::cout << "Process not found: " << processName << std::endl;
198 | return false;
199 | }
200 |
201 | // Exported functions implementation
202 | extern "C" {
203 |
204 | void XPMGR_Initialize() {
205 | XP_LoadLicenseManager();
206 | }
207 |
208 | void XPMGR_Cleanup() {
209 | if (XP_LicenseAgent) {
210 | XP_LicenseAgent->Release();
211 | XP_LicenseAgent = nullptr;
212 | }
213 | if (XP_ComInitialized) {
214 | CoUninitialize();
215 | XP_ComInitialized = FALSE;
216 | }
217 | }
218 |
219 | const wchar_t* XPMGR_GetLastError() {
220 | return LastErrorMessage;
221 | }
222 |
223 | const wchar_t* XPMGR_GetInstallationID() {
224 | if (!XP_LoadLicenseManager()) {
225 | return XPMGR_GetLastError();
226 | }
227 |
228 | BSTR installationID = nullptr;
229 | const HRESULT status = XP_LicenseAgent->GenerateInstallationId(&installationID);
230 | if (FAILED(status) || !installationID) {
231 | SetLastErrorMessage(L"Failed to generate installation ID");
232 | return XPMGR_GetLastError();
233 | }
234 |
235 | static wchar_t result[256];
236 | wcscpy(result, installationID);
237 | SysFreeString(installationID);
238 | return result;
239 | }
240 |
241 | const wchar_t* XPMGR_SetConfirmationID(const wchar_t* confirmationId) {
242 | if (!XP_LoadLicenseManager()) {
243 | return XPMGR_GetLastError();
244 | }
245 |
246 | // Create a working copy and remove dashes
247 | wchar_t cleanCid[256] = {0};
248 | const wchar_t* src = confirmationId;
249 | wchar_t* dst = cleanCid;
250 | while (*src) {
251 | if (*src != L'-') {
252 | *dst++ = *src;
253 | }
254 | src++;
255 | }
256 | *dst = 0;
257 |
258 | // Verify each 6-character chunk
259 | size_t len = wcslen(cleanCid);
260 | for (size_t i = 0; i < len; i += 6) {
261 | wchar_t chunk[7] = {0};
262 | wcsncpy(chunk, cleanCid + i, 6);
263 | if (!VerifyConfirmationIDChunk(XP_LicenseAgent, chunk)) {
264 | SetLastErrorMessage(L"Invalid confirmation ID - verification failed");
265 | return XPMGR_GetLastError();
266 | }
267 | }
268 |
269 | // Pass the original confirmation ID (with dashes if present) to the API
270 | BSTR bstrConfirmationId = SysAllocString(confirmationId);
271 | ULONG dwRetCode;
272 | const HRESULT status = XP_LicenseAgent->DepositConfirmationId(bstrConfirmationId, &dwRetCode);
273 | SysFreeString(bstrConfirmationId);
274 |
275 | if (FAILED(status) || dwRetCode) {
276 | SetLastErrorMessage(L"Failed to deposit confirmation ID");
277 | return XPMGR_GetLastError();
278 | }
279 |
280 | // Handle WPA notifier process
281 | if (IsProcessRunning(L"wpabaln.exe")) {
282 | if (!TerminateProcessByName(L"wpabaln.exe")) {
283 | std::cout << "Warning: Failed to terminate WPA notifier process." << std::endl;
284 | }
285 | }
286 |
287 | // Clean up activation files
288 | HMODULE hMod = LoadLibraryW(L"setupapi.dll");
289 | if (hMod) {
290 | using InstallHinfSectionFunc = BOOL (WINAPI*)(HWND, HINSTANCE, PCWSTR, INT);
291 | if (auto installHinfSection = reinterpret_cast(GetProcAddress(hMod, "InstallHinfSectionW"))) {
292 | SetLastError(0);
293 | const BOOL result = installHinfSection(nullptr, nullptr, L"DEL_OOBE_ACTIVATE 132 syssetup.inf", 132);
294 | const DWORD error = GetLastError();
295 |
296 | if (!result && error != 0 && error != 6) { // Ignore error 6 (ERROR_INVALID_HANDLE) as it indicates success
297 | std::cout << "Warning: Failed to remove activation reminders. Error: " << error << std::endl;
298 | std::cout << "You can try to run the following command yourself: " << std::endl;
299 | std::cout << "rundll32 setupapi,InstallHinfSection DEL_OOBE_ACTIVATE 132 syssetup.inf" << std::endl;
300 | }
301 | }
302 | FreeLibrary(hMod);
303 | }
304 |
305 | return L"Successfully set confirmation ID";
306 | }
307 |
308 | const wchar_t* XPMGR_GetWPALeft() {
309 | if (!XP_LoadLicenseManager()) {
310 | return XPMGR_GetLastError();
311 | }
312 |
313 | ULONG dwWPALeft = 0, dwEvalLeft = 0;
314 | const HRESULT status = XP_LicenseAgent->GetExpirationInfo(&dwWPALeft, &dwEvalLeft);
315 | if (FAILED(status)) {
316 | SetLastErrorMessage(L"Failed to get expiration info");
317 | return XPMGR_GetLastError();
318 | }
319 |
320 | if (dwWPALeft == 0x7FFFFFFF) {
321 | return L"Windows is activated";
322 | }
323 |
324 | static wchar_t result[16];
325 | _ultow(dwWPALeft, result, 10);
326 | return result;
327 | }
328 |
329 | const wchar_t* XPMGR_GetEvalLeft() {
330 | if (!XP_LoadLicenseManager()) {
331 | return XPMGR_GetLastError();
332 | }
333 |
334 | ULONG dwWPALeft = 0, dwEvalLeft = 0;
335 | const HRESULT status = XP_LicenseAgent->GetExpirationInfo(&dwWPALeft, &dwEvalLeft);
336 | if (FAILED(status)) {
337 | SetLastErrorMessage(L"Failed to get expiration info");
338 | return XPMGR_GetLastError();
339 | }
340 |
341 | if (dwEvalLeft == 0x7FFFFFFF) {
342 | return L"Not an evaluation copy";
343 | }
344 |
345 | static wchar_t result[16];
346 | _ultow(dwEvalLeft, result, 10);
347 | return result;
348 | }
349 |
350 | const wchar_t* XPMGR_SetProductKey(const wchar_t* productKey) {
351 | if (!XP_LoadLicenseManager()) {
352 | return XPMGR_GetLastError();
353 | }
354 |
355 | // Validate product key format
356 | std::wregex pattern(L"[2346789BCDFGHJKMPQRTVWXY]{5}-[2346789BCDFGHJKMPQRTVWXY]{5}-[2346789BCDFGHJKMPQRTVWXY]{5}-[2346789BCDFGHJKMPQRTVWXY]{5}-[2346789BCDFGHJKMPQRTVWXY]{5}");
357 | if (!std::regex_match(productKey, pattern)) {
358 | SetLastErrorMessage(L"Invalid product key format");
359 | return XPMGR_GetLastError();
360 | }
361 |
362 | const HRESULT status = XP_LicenseAgent->SetProductKey(const_cast(productKey));
363 | if (FAILED(status)) {
364 | SetLastErrorMessage(L"Failed to set product key");
365 | return XPMGR_GetLastError();
366 | }
367 |
368 | return L"Successfully set product key";
369 | }
370 |
371 | const wchar_t* XPMGR_GetProductID() {
372 | if (!XP_LoadLicenseManager()) {
373 | return XPMGR_GetLastError();
374 | }
375 |
376 | BSTR productID = nullptr;
377 | const HRESULT status = XP_LicenseAgent->GetProductID(&productID);
378 | if (FAILED(status) || !productID) {
379 | SetLastErrorMessage(L"Failed to get product ID");
380 | return XPMGR_GetLastError();
381 | }
382 |
383 | static wchar_t result[256];
384 | wcscpy(result, productID);
385 | SysFreeString(productID);
386 | return result;
387 | }
388 |
389 | }
--------------------------------------------------------------------------------
/ICON_LICENSE.txt:
--------------------------------------------------------------------------------
1 | xpmgr Program Icon © 2025 by TehAwesomestKitteh (modified by TheTank20
2 | to differenciate from UMSKT) is licensed under CC BY-SA 4.0:
3 |
4 | Attribution-ShareAlike 4.0 International
5 |
6 | =======================================================================
7 |
8 | Creative Commons Corporation ("Creative Commons") is not a law firm and
9 | does not provide legal services or legal advice. Distribution of
10 | Creative Commons public licenses does not create a lawyer-client or
11 | other relationship. Creative Commons makes its licenses and related
12 | information available on an "as-is" basis. Creative Commons gives no
13 | warranties regarding its licenses, any material licensed under their
14 | terms and conditions, or any related information. Creative Commons
15 | disclaims all liability for damages resulting from their use to the
16 | fullest extent possible.
17 |
18 | Using Creative Commons Public Licenses
19 |
20 | Creative Commons public licenses provide a standard set of terms and
21 | conditions that creators and other rights holders may use to share
22 | original works of authorship and other material subject to copyright
23 | and certain other rights specified in the public license below. The
24 | following considerations are for informational purposes only, are not
25 | exhaustive, and do not form part of our licenses.
26 |
27 | Considerations for licensors: Our public licenses are
28 | intended for use by those authorized to give the public
29 | permission to use material in ways otherwise restricted by
30 | copyright and certain other rights. Our licenses are
31 | irrevocable. Licensors should read and understand the terms
32 | and conditions of the license they choose before applying it.
33 | Licensors should also secure all rights necessary before
34 | applying our licenses so that the public can reuse the
35 | material as expected. Licensors should clearly mark any
36 | material not subject to the license. This includes other CC-
37 | licensed material, or material used under an exception or
38 | limitation to copyright. More considerations for licensors:
39 | wiki.creativecommons.org/Considerations_for_licensors
40 |
41 | Considerations for the public: By using one of our public
42 | licenses, a licensor grants the public permission to use the
43 | licensed material under specified terms and conditions. If
44 | the licensor's permission is not necessary for any reason--for
45 | example, because of any applicable exception or limitation to
46 | copyright--then that use is not regulated by the license. Our
47 | licenses grant only permissions under copyright and certain
48 | other rights that a licensor has authority to grant. Use of
49 | the licensed material may still be restricted for other
50 | reasons, including because others have copyright or other
51 | rights in the material. A licensor may make special requests,
52 | such as asking that all changes be marked or described.
53 | Although not required by our licenses, you are encouraged to
54 | respect those requests where reasonable. More considerations
55 | for the public:
56 | wiki.creativecommons.org/Considerations_for_licensees
57 |
58 | =======================================================================
59 |
60 | Creative Commons Attribution-ShareAlike 4.0 International Public
61 | License
62 |
63 | By exercising the Licensed Rights (defined below), You accept and agree
64 | to be bound by the terms and conditions of this Creative Commons
65 | Attribution-ShareAlike 4.0 International Public License ("Public
66 | License"). To the extent this Public License may be interpreted as a
67 | contract, You are granted the Licensed Rights in consideration of Your
68 | acceptance of these terms and conditions, and the Licensor grants You
69 | such rights in consideration of benefits the Licensor receives from
70 | making the Licensed Material available under these terms and
71 | conditions.
72 |
73 |
74 | Section 1 -- Definitions.
75 |
76 | a. Adapted Material means material subject to Copyright and Similar
77 | Rights that is derived from or based upon the Licensed Material
78 | and in which the Licensed Material is translated, altered,
79 | arranged, transformed, or otherwise modified in a manner requiring
80 | permission under the Copyright and Similar Rights held by the
81 | Licensor. For purposes of this Public License, where the Licensed
82 | Material is a musical work, performance, or sound recording,
83 | Adapted Material is always produced where the Licensed Material is
84 | synched in timed relation with a moving image.
85 |
86 | b. Adapter's License means the license You apply to Your Copyright
87 | and Similar Rights in Your contributions to Adapted Material in
88 | accordance with the terms and conditions of this Public License.
89 |
90 | c. BY-SA Compatible License means a license listed at
91 | creativecommons.org/compatiblelicenses, approved by Creative
92 | Commons as essentially the equivalent of this Public License.
93 |
94 | d. Copyright and Similar Rights means copyright and/or similar rights
95 | closely related to copyright including, without limitation,
96 | performance, broadcast, sound recording, and Sui Generis Database
97 | Rights, without regard to how the rights are labeled or
98 | categorized. For purposes of this Public License, the rights
99 | specified in Section 2(b)(1)-(2) are not Copyright and Similar
100 | Rights.
101 |
102 | e. Effective Technological Measures means those measures that, in the
103 | absence of proper authority, may not be circumvented under laws
104 | fulfilling obligations under Article 11 of the WIPO Copyright
105 | Treaty adopted on December 20, 1996, and/or similar international
106 | agreements.
107 |
108 | f. Exceptions and Limitations means fair use, fair dealing, and/or
109 | any other exception or limitation to Copyright and Similar Rights
110 | that applies to Your use of the Licensed Material.
111 |
112 | g. License Elements means the license attributes listed in the name
113 | of a Creative Commons Public License. The License Elements of this
114 | Public License are Attribution and ShareAlike.
115 |
116 | h. Licensed Material means the artistic or literary work, database,
117 | or other material to which the Licensor applied this Public
118 | License.
119 |
120 | i. Licensed Rights means the rights granted to You subject to the
121 | terms and conditions of this Public License, which are limited to
122 | all Copyright and Similar Rights that apply to Your use of the
123 | Licensed Material and that the Licensor has authority to license.
124 |
125 | j. Licensor means the individual(s) or entity(ies) granting rights
126 | under this Public License.
127 |
128 | k. Share means to provide material to the public by any means or
129 | process that requires permission under the Licensed Rights, such
130 | as reproduction, public display, public performance, distribution,
131 | dissemination, communication, or importation, and to make material
132 | available to the public including in ways that members of the
133 | public may access the material from a place and at a time
134 | individually chosen by them.
135 |
136 | l. Sui Generis Database Rights means rights other than copyright
137 | resulting from Directive 96/9/EC of the European Parliament and of
138 | the Council of 11 March 1996 on the legal protection of databases,
139 | as amended and/or succeeded, as well as other essentially
140 | equivalent rights anywhere in the world.
141 |
142 | m. You means the individual or entity exercising the Licensed Rights
143 | under this Public License. Your has a corresponding meaning.
144 |
145 |
146 | Section 2 -- Scope.
147 |
148 | a. License grant.
149 |
150 | 1. Subject to the terms and conditions of this Public License,
151 | the Licensor hereby grants You a worldwide, royalty-free,
152 | non-sublicensable, non-exclusive, irrevocable license to
153 | exercise the Licensed Rights in the Licensed Material to:
154 |
155 | a. reproduce and Share the Licensed Material, in whole or
156 | in part; and
157 |
158 | b. produce, reproduce, and Share Adapted Material.
159 |
160 | 2. Exceptions and Limitations. For the avoidance of doubt, where
161 | Exceptions and Limitations apply to Your use, this Public
162 | License does not apply, and You do not need to comply with
163 | its terms and conditions.
164 |
165 | 3. Term. The term of this Public License is specified in Section
166 | 6(a).
167 |
168 | 4. Media and formats; technical modifications allowed. The
169 | Licensor authorizes You to exercise the Licensed Rights in
170 | all media and formats whether now known or hereafter created,
171 | and to make technical modifications necessary to do so. The
172 | Licensor waives and/or agrees not to assert any right or
173 | authority to forbid You from making technical modifications
174 | necessary to exercise the Licensed Rights, including
175 | technical modifications necessary to circumvent Effective
176 | Technological Measures. For purposes of this Public License,
177 | simply making modifications authorized by this Section 2(a)
178 | (4) never produces Adapted Material.
179 |
180 | 5. Downstream recipients.
181 |
182 | a. Offer from the Licensor -- Licensed Material. Every
183 | recipient of the Licensed Material automatically
184 | receives an offer from the Licensor to exercise the
185 | Licensed Rights under the terms and conditions of this
186 | Public License.
187 |
188 | b. Additional offer from the Licensor -- Adapted Material.
189 | Every recipient of Adapted Material from You
190 | automatically receives an offer from the Licensor to
191 | exercise the Licensed Rights in the Adapted Material
192 | under the conditions of the Adapter's License You apply.
193 |
194 | c. No downstream restrictions. You may not offer or impose
195 | any additional or different terms or conditions on, or
196 | apply any Effective Technological Measures to, the
197 | Licensed Material if doing so restricts exercise of the
198 | Licensed Rights by any recipient of the Licensed
199 | Material.
200 |
201 | 6. No endorsement. Nothing in this Public License constitutes or
202 | may be construed as permission to assert or imply that You
203 | are, or that Your use of the Licensed Material is, connected
204 | with, or sponsored, endorsed, or granted official status by,
205 | the Licensor or others designated to receive attribution as
206 | provided in Section 3(a)(1)(A)(i).
207 |
208 | b. Other rights.
209 |
210 | 1. Moral rights, such as the right of integrity, are not
211 | licensed under this Public License, nor are publicity,
212 | privacy, and/or other similar personality rights; however, to
213 | the extent possible, the Licensor waives and/or agrees not to
214 | assert any such rights held by the Licensor to the limited
215 | extent necessary to allow You to exercise the Licensed
216 | Rights, but not otherwise.
217 |
218 | 2. Patent and trademark rights are not licensed under this
219 | Public License.
220 |
221 | 3. To the extent possible, the Licensor waives any right to
222 | collect royalties from You for the exercise of the Licensed
223 | Rights, whether directly or through a collecting society
224 | under any voluntary or waivable statutory or compulsory
225 | licensing scheme. In all other cases the Licensor expressly
226 | reserves any right to collect such royalties.
227 |
228 |
229 | Section 3 -- License Conditions.
230 |
231 | Your exercise of the Licensed Rights is expressly made subject to the
232 | following conditions.
233 |
234 | a. Attribution.
235 |
236 | 1. If You Share the Licensed Material (including in modified
237 | form), You must:
238 |
239 | a. retain the following if it is supplied by the Licensor
240 | with the Licensed Material:
241 |
242 | i. identification of the creator(s) of the Licensed
243 | Material and any others designated to receive
244 | attribution, in any reasonable manner requested by
245 | the Licensor (including by pseudonym if
246 | designated);
247 |
248 | ii. a copyright notice;
249 |
250 | iii. a notice that refers to this Public License;
251 |
252 | iv. a notice that refers to the disclaimer of
253 | warranties;
254 |
255 | v. a URI or hyperlink to the Licensed Material to the
256 | extent reasonably practicable;
257 |
258 | b. indicate if You modified the Licensed Material and
259 | retain an indication of any previous modifications; and
260 |
261 | c. indicate the Licensed Material is licensed under this
262 | Public License, and include the text of, or the URI or
263 | hyperlink to, this Public License.
264 |
265 | 2. You may satisfy the conditions in Section 3(a)(1) in any
266 | reasonable manner based on the medium, means, and context in
267 | which You Share the Licensed Material. For example, it may be
268 | reasonable to satisfy the conditions by providing a URI or
269 | hyperlink to a resource that includes the required
270 | information.
271 |
272 | 3. If requested by the Licensor, You must remove any of the
273 | information required by Section 3(a)(1)(A) to the extent
274 | reasonably practicable.
275 |
276 | b. ShareAlike.
277 |
278 | In addition to the conditions in Section 3(a), if You Share
279 | Adapted Material You produce, the following conditions also apply.
280 |
281 | 1. The Adapter's License You apply must be a Creative Commons
282 | license with the same License Elements, this version or
283 | later, or a BY-SA Compatible License.
284 |
285 | 2. You must include the text of, or the URI or hyperlink to, the
286 | Adapter's License You apply. You may satisfy this condition
287 | in any reasonable manner based on the medium, means, and
288 | context in which You Share Adapted Material.
289 |
290 | 3. You may not offer or impose any additional or different terms
291 | or conditions on, or apply any Effective Technological
292 | Measures to, Adapted Material that restrict exercise of the
293 | rights granted under the Adapter's License You apply.
294 |
295 |
296 | Section 4 -- Sui Generis Database Rights.
297 |
298 | Where the Licensed Rights include Sui Generis Database Rights that
299 | apply to Your use of the Licensed Material:
300 |
301 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right
302 | to extract, reuse, reproduce, and Share all or a substantial
303 | portion of the contents of the database;
304 |
305 | b. if You include all or a substantial portion of the database
306 | contents in a database in which You have Sui Generis Database
307 | Rights, then the database in which You have Sui Generis Database
308 | Rights (but not its individual contents) is Adapted Material,
309 | including for purposes of Section 3(b); and
310 |
311 | c. You must comply with the conditions in Section 3(a) if You Share
312 | all or a substantial portion of the contents of the database.
313 |
314 | For the avoidance of doubt, this Section 4 supplements and does not
315 | replace Your obligations under this Public License where the Licensed
316 | Rights include other Copyright and Similar Rights.
317 |
318 |
319 | Section 5 -- Disclaimer of Warranties and Limitation of Liability.
320 |
321 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
322 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
323 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
324 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
325 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
326 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
327 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
328 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
329 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
330 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
331 |
332 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
333 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
334 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
335 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
336 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
337 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
338 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
339 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
340 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
341 |
342 | c. The disclaimer of warranties and limitation of liability provided
343 | above shall be interpreted in a manner that, to the extent
344 | possible, most closely approximates an absolute disclaimer and
345 | waiver of all liability.
346 |
347 |
348 | Section 6 -- Term and Termination.
349 |
350 | a. This Public License applies for the term of the Copyright and
351 | Similar Rights licensed here. However, if You fail to comply with
352 | this Public License, then Your rights under this Public License
353 | terminate automatically.
354 |
355 | b. Where Your right to use the Licensed Material has terminated under
356 | Section 6(a), it reinstates:
357 |
358 | 1. automatically as of the date the violation is cured, provided
359 | it is cured within 30 days of Your discovery of the
360 | violation; or
361 |
362 | 2. upon express reinstatement by the Licensor.
363 |
364 | For the avoidance of doubt, this Section 6(b) does not affect any
365 | right the Licensor may have to seek remedies for Your violations
366 | of this Public License.
367 |
368 | c. For the avoidance of doubt, the Licensor may also offer the
369 | Licensed Material under separate terms or conditions or stop
370 | distributing the Licensed Material at any time; however, doing so
371 | will not terminate this Public License.
372 |
373 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
374 | License.
375 |
376 |
377 | Section 7 -- Other Terms and Conditions.
378 |
379 | a. The Licensor shall not be bound by any additional or different
380 | terms or conditions communicated by You unless expressly agreed.
381 |
382 | b. Any arrangements, understandings, or agreements regarding the
383 | Licensed Material not stated herein are separate from and
384 | independent of the terms and conditions of this Public License.
385 |
386 |
387 | Section 8 -- Interpretation.
388 |
389 | a. For the avoidance of doubt, this Public License does not, and
390 | shall not be interpreted to, reduce, limit, restrict, or impose
391 | conditions on any use of the Licensed Material that could lawfully
392 | be made without permission under this Public License.
393 |
394 | b. To the extent possible, if any provision of this Public License is
395 | deemed unenforceable, it shall be automatically reformed to the
396 | minimum extent necessary to make it enforceable. If the provision
397 | cannot be reformed, it shall be severed from this Public License
398 | without affecting the enforceability of the remaining terms and
399 | conditions.
400 |
401 | c. No term or condition of this Public License will be waived and no
402 | failure to comply consented to unless expressly agreed to by the
403 | Licensor.
404 |
405 | d. Nothing in this Public License constitutes or may be interpreted
406 | as a limitation upon, or waiver of, any privileges and immunities
407 | that apply to the Licensor or You, including from the legal
408 | processes of any jurisdiction or authority.
409 |
410 |
411 | =======================================================================
412 |
413 | Creative Commons is not a party to its public
414 | licenses. Notwithstanding, Creative Commons may elect to apply one of
415 | its public licenses to material it publishes and in those instances
416 | will be considered the “Licensor.” The text of the Creative Commons
417 | public licenses is dedicated to the public domain under the CC0 Public
418 | Domain Dedication. Except for the limited purpose of indicating that
419 | material is shared under a Creative Commons public license or as
420 | otherwise permitted by the Creative Commons policies published at
421 | creativecommons.org/policies, Creative Commons does not authorize the
422 | use of the trademark "Creative Commons" or any other trademark or logo
423 | of Creative Commons without its prior written consent including,
424 | without limitation, in connection with any unauthorized modifications
425 | to any of its public licenses or any other arrangements,
426 | understandings, or agreements concerning use of licensed material. For
427 | the avoidance of doubt, this paragraph does not form part of the
428 | public licenses.
429 |
430 | Creative Commons may be contacted at creativecommons.org.
431 |
432 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU LESSER GENERAL PUBLIC LICENSE
2 | Version 2.1, February 1999
3 |
4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc.
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | [This is the first released version of the Lesser GPL. It also counts
10 | as the successor of the GNU Library Public License, version 2, hence
11 | the version number 2.1.]
12 |
13 | Preamble
14 |
15 | The licenses for most software are designed to take away your
16 | freedom to share and change it. By contrast, the GNU General Public
17 | Licenses are intended to guarantee your freedom to share and change
18 | free software--to make sure the software is free for all its users.
19 |
20 | This license, the Lesser General Public License, applies to some
21 | specially designated software packages--typically libraries--of the
22 | Free Software Foundation and other authors who decide to use it. You
23 | can use it too, but we suggest you first think carefully about whether
24 | this license or the ordinary General Public License is the better
25 | strategy to use in any particular case, based on the explanations below.
26 |
27 | When we speak of free software, we are referring to freedom of use,
28 | not price. Our General Public Licenses are designed to make sure that
29 | you have the freedom to distribute copies of free software (and charge
30 | for this service if you wish); that you receive source code or can get
31 | it if you want it; that you can change the software and use pieces of
32 | it in new free programs; and that you are informed that you can do
33 | these things.
34 |
35 | To protect your rights, we need to make restrictions that forbid
36 | distributors to deny you these rights or to ask you to surrender these
37 | rights. These restrictions translate to certain responsibilities for
38 | you if you distribute copies of the library or if you modify it.
39 |
40 | For example, if you distribute copies of the library, whether gratis
41 | or for a fee, you must give the recipients all the rights that we gave
42 | you. You must make sure that they, too, receive or can get the source
43 | code. If you link other code with the library, you must provide
44 | complete object files to the recipients, so that they can relink them
45 | with the library after making changes to the library and recompiling
46 | it. And you must show them these terms so they know their rights.
47 |
48 | We protect your rights with a two-step method: (1) we copyright the
49 | library, and (2) we offer you this license, which gives you legal
50 | permission to copy, distribute and/or modify the library.
51 |
52 | To protect each distributor, we want to make it very clear that
53 | there is no warranty for the free library. Also, if the library is
54 | modified by someone else and passed on, the recipients should know
55 | that what they have is not the original version, so that the original
56 | author's reputation will not be affected by problems that might be
57 | introduced by others.
58 |
59 | Finally, software patents pose a constant threat to the existence of
60 | any free program. We wish to make sure that a company cannot
61 | effectively restrict the users of a free program by obtaining a
62 | restrictive license from a patent holder. Therefore, we insist that
63 | any patent license obtained for a version of the library must be
64 | consistent with the full freedom of use specified in this license.
65 |
66 | Most GNU software, including some libraries, is covered by the
67 | ordinary GNU General Public License. This license, the GNU Lesser
68 | General Public License, applies to certain designated libraries, and
69 | is quite different from the ordinary General Public License. We use
70 | this license for certain libraries in order to permit linking those
71 | libraries into non-free programs.
72 |
73 | When a program is linked with a library, whether statically or using
74 | a shared library, the combination of the two is legally speaking a
75 | combined work, a derivative of the original library. The ordinary
76 | General Public License therefore permits such linking only if the
77 | entire combination fits its criteria of freedom. The Lesser General
78 | Public License permits more lax criteria for linking other code with
79 | the library.
80 |
81 | We call this license the "Lesser" General Public License because it
82 | does Less to protect the user's freedom than the ordinary General
83 | Public License. It also provides other free software developers Less
84 | of an advantage over competing non-free programs. These disadvantages
85 | are the reason we use the ordinary General Public License for many
86 | libraries. However, the Lesser license provides advantages in certain
87 | special circumstances.
88 |
89 | For example, on rare occasions, there may be a special need to
90 | encourage the widest possible use of a certain library, so that it becomes
91 | a de-facto standard. To achieve this, non-free programs must be
92 | allowed to use the library. A more frequent case is that a free
93 | library does the same job as widely used non-free libraries. In this
94 | case, there is little to gain by limiting the free library to free
95 | software only, so we use the Lesser General Public License.
96 |
97 | In other cases, permission to use a particular library in non-free
98 | programs enables a greater number of people to use a large body of
99 | free software. For example, permission to use the GNU C Library in
100 | non-free programs enables many more people to use the whole GNU
101 | operating system, as well as its variant, the GNU/Linux operating
102 | system.
103 |
104 | Although the Lesser General Public License is Less protective of the
105 | users' freedom, it does ensure that the user of a program that is
106 | linked with the Library has the freedom and the wherewithal to run
107 | that program using a modified version of the Library.
108 |
109 | The precise terms and conditions for copying, distribution and
110 | modification follow. Pay close attention to the difference between a
111 | "work based on the library" and a "work that uses the library". The
112 | former contains code derived from the library, whereas the latter must
113 | be combined with the library in order to run.
114 |
115 | GNU LESSER GENERAL PUBLIC LICENSE
116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
117 |
118 | 0. This License Agreement applies to any software library or other
119 | program which contains a notice placed by the copyright holder or
120 | other authorized party saying it may be distributed under the terms of
121 | this Lesser General Public License (also called "this License").
122 | Each licensee is addressed as "you".
123 |
124 | A "library" means a collection of software functions and/or data
125 | prepared so as to be conveniently linked with application programs
126 | (which use some of those functions and data) to form executables.
127 |
128 | The "Library", below, refers to any such software library or work
129 | which has been distributed under these terms. A "work based on the
130 | Library" means either the Library or any derivative work under
131 | copyright law: that is to say, a work containing the Library or a
132 | portion of it, either verbatim or with modifications and/or translated
133 | straightforwardly into another language. (Hereinafter, translation is
134 | included without limitation in the term "modification".)
135 |
136 | "Source code" for a work means the preferred form of the work for
137 | making modifications to it. For a library, complete source code means
138 | all the source code for all modules it contains, plus any associated
139 | interface definition files, plus the scripts used to control compilation
140 | and installation of the library.
141 |
142 | Activities other than copying, distribution and modification are not
143 | covered by this License; they are outside its scope. The act of
144 | running a program using the Library is not restricted, and output from
145 | such a program is covered only if its contents constitute a work based
146 | on the Library (independent of the use of the Library in a tool for
147 | writing it). Whether that is true depends on what the Library does
148 | and what the program that uses the Library does.
149 |
150 | 1. You may copy and distribute verbatim copies of the Library's
151 | complete source code as you receive it, in any medium, provided that
152 | you conspicuously and appropriately publish on each copy an
153 | appropriate copyright notice and disclaimer of warranty; keep intact
154 | all the notices that refer to this License and to the absence of any
155 | warranty; and distribute a copy of this License along with the
156 | Library.
157 |
158 | You may charge a fee for the physical act of transferring a copy,
159 | and you may at your option offer warranty protection in exchange for a
160 | fee.
161 |
162 | 2. You may modify your copy or copies of the Library or any portion
163 | of it, thus forming a work based on the Library, and copy and
164 | distribute such modifications or work under the terms of Section 1
165 | above, provided that you also meet all of these conditions:
166 |
167 | a) The modified work must itself be a software library.
168 |
169 | b) You must cause the files modified to carry prominent notices
170 | stating that you changed the files and the date of any change.
171 |
172 | c) You must cause the whole of the work to be licensed at no
173 | charge to all third parties under the terms of this License.
174 |
175 | d) If a facility in the modified Library refers to a function or a
176 | table of data to be supplied by an application program that uses
177 | the facility, other than as an argument passed when the facility
178 | is invoked, then you must make a good faith effort to ensure that,
179 | in the event an application does not supply such function or
180 | table, the facility still operates, and performs whatever part of
181 | its purpose remains meaningful.
182 |
183 | (For example, a function in a library to compute square roots has
184 | a purpose that is entirely well-defined independent of the
185 | application. Therefore, Subsection 2d requires that any
186 | application-supplied function or table used by this function must
187 | be optional: if the application does not supply it, the square
188 | root function must still compute square roots.)
189 |
190 | These requirements apply to the modified work as a whole. If
191 | identifiable sections of that work are not derived from the Library,
192 | and can be reasonably considered independent and separate works in
193 | themselves, then this License, and its terms, do not apply to those
194 | sections when you distribute them as separate works. But when you
195 | distribute the same sections as part of a whole which is a work based
196 | on the Library, the distribution of the whole must be on the terms of
197 | this License, whose permissions for other licensees extend to the
198 | entire whole, and thus to each and every part regardless of who wrote
199 | it.
200 |
201 | Thus, it is not the intent of this section to claim rights or contest
202 | your rights to work written entirely by you; rather, the intent is to
203 | exercise the right to control the distribution of derivative or
204 | collective works based on the Library.
205 |
206 | In addition, mere aggregation of another work not based on the Library
207 | with the Library (or with a work based on the Library) on a volume of
208 | a storage or distribution medium does not bring the other work under
209 | the scope of this License.
210 |
211 | 3. You may opt to apply the terms of the ordinary GNU General Public
212 | License instead of this License to a given copy of the Library. To do
213 | this, you must alter all the notices that refer to this License, so
214 | that they refer to the ordinary GNU General Public License, version 2,
215 | instead of to this License. (If a newer version than version 2 of the
216 | ordinary GNU General Public License has appeared, then you can specify
217 | that version instead if you wish.) Do not make any other change in
218 | these notices.
219 |
220 | Once this change is made in a given copy, it is irreversible for
221 | that copy, so the ordinary GNU General Public License applies to all
222 | subsequent copies and derivative works made from that copy.
223 |
224 | This option is useful when you wish to copy part of the code of
225 | the Library into a program that is not a library.
226 |
227 | 4. You may copy and distribute the Library (or a portion or
228 | derivative of it, under Section 2) in object code or executable form
229 | under the terms of Sections 1 and 2 above provided that you accompany
230 | it with the complete corresponding machine-readable source code, which
231 | must be distributed under the terms of Sections 1 and 2 above on a
232 | medium customarily used for software interchange.
233 |
234 | If distribution of object code is made by offering access to copy
235 | from a designated place, then offering equivalent access to copy the
236 | source code from the same place satisfies the requirement to
237 | distribute the source code, even though third parties are not
238 | compelled to copy the source along with the object code.
239 |
240 | 5. A program that contains no derivative of any portion of the
241 | Library, but is designed to work with the Library by being compiled or
242 | linked with it, is called a "work that uses the Library". Such a
243 | work, in isolation, is not a derivative work of the Library, and
244 | therefore falls outside the scope of this License.
245 |
246 | However, linking a "work that uses the Library" with the Library
247 | creates an executable that is a derivative of the Library (because it
248 | contains portions of the Library), rather than a "work that uses the
249 | library". The executable is therefore covered by this License.
250 | Section 6 states terms for distribution of such executables.
251 |
252 | When a "work that uses the Library" uses material from a header file
253 | that is part of the Library, the object code for the work may be a
254 | derivative work of the Library even though the source code is not.
255 | Whether this is true is especially significant if the work can be
256 | linked without the Library, or if the work is itself a library. The
257 | threshold for this to be true is not precisely defined by law.
258 |
259 | If such an object file uses only numerical parameters, data
260 | structure layouts and accessors, and small macros and small inline
261 | functions (ten lines or less in length), then the use of the object
262 | file is unrestricted, regardless of whether it is legally a derivative
263 | work. (Executables containing this object code plus portions of the
264 | Library will still fall under Section 6.)
265 |
266 | Otherwise, if the work is a derivative of the Library, you may
267 | distribute the object code for the work under the terms of Section 6.
268 | Any executables containing that work also fall under Section 6,
269 | whether or not they are linked directly with the Library itself.
270 |
271 | 6. As an exception to the Sections above, you may also combine or
272 | link a "work that uses the Library" with the Library to produce a
273 | work containing portions of the Library, and distribute that work
274 | under terms of your choice, provided that the terms permit
275 | modification of the work for the customer's own use and reverse
276 | engineering for debugging such modifications.
277 |
278 | You must give prominent notice with each copy of the work that the
279 | Library is used in it and that the Library and its use are covered by
280 | this License. You must supply a copy of this License. If the work
281 | during execution displays copyright notices, you must include the
282 | copyright notice for the Library among them, as well as a reference
283 | directing the user to the copy of this License. Also, you must do one
284 | of these things:
285 |
286 | a) Accompany the work with the complete corresponding
287 | machine-readable source code for the Library including whatever
288 | changes were used in the work (which must be distributed under
289 | Sections 1 and 2 above); and, if the work is an executable linked
290 | with the Library, with the complete machine-readable "work that
291 | uses the Library", as object code and/or source code, so that the
292 | user can modify the Library and then relink to produce a modified
293 | executable containing the modified Library. (It is understood
294 | that the user who changes the contents of definitions files in the
295 | Library will not necessarily be able to recompile the application
296 | to use the modified definitions.)
297 |
298 | b) Use a suitable shared library mechanism for linking with the
299 | Library. A suitable mechanism is one that (1) uses at run time a
300 | copy of the library already present on the user's computer system,
301 | rather than copying library functions into the executable, and (2)
302 | will operate properly with a modified version of the library, if
303 | the user installs one, as long as the modified version is
304 | interface-compatible with the version that the work was made with.
305 |
306 | c) Accompany the work with a written offer, valid for at
307 | least three years, to give the same user the materials
308 | specified in Subsection 6a, above, for a charge no more
309 | than the cost of performing this distribution.
310 |
311 | d) If distribution of the work is made by offering access to copy
312 | from a designated place, offer equivalent access to copy the above
313 | specified materials from the same place.
314 |
315 | e) Verify that the user has already received a copy of these
316 | materials or that you have already sent this user a copy.
317 |
318 | For an executable, the required form of the "work that uses the
319 | Library" must include any data and utility programs needed for
320 | reproducing the executable from it. However, as a special exception,
321 | the materials to be distributed need not include anything that is
322 | normally distributed (in either source or binary form) with the major
323 | components (compiler, kernel, and so on) of the operating system on
324 | which the executable runs, unless that component itself accompanies
325 | the executable.
326 |
327 | It may happen that this requirement contradicts the license
328 | restrictions of other proprietary libraries that do not normally
329 | accompany the operating system. Such a contradiction means you cannot
330 | use both them and the Library together in an executable that you
331 | distribute.
332 |
333 | 7. You may place library facilities that are a work based on the
334 | Library side-by-side in a single library together with other library
335 | facilities not covered by this License, and distribute such a combined
336 | library, provided that the separate distribution of the work based on
337 | the Library and of the other library facilities is otherwise
338 | permitted, and provided that you do these two things:
339 |
340 | a) Accompany the combined library with a copy of the same work
341 | based on the Library, uncombined with any other library
342 | facilities. This must be distributed under the terms of the
343 | Sections above.
344 |
345 | b) Give prominent notice with the combined library of the fact
346 | that part of it is a work based on the Library, and explaining
347 | where to find the accompanying uncombined form of the same work.
348 |
349 | 8. You may not copy, modify, sublicense, link with, or distribute
350 | the Library except as expressly provided under this License. Any
351 | attempt otherwise to copy, modify, sublicense, link with, or
352 | distribute the Library is void, and will automatically terminate your
353 | rights under this License. However, parties who have received copies,
354 | or rights, from you under this License will not have their licenses
355 | terminated so long as such parties remain in full compliance.
356 |
357 | 9. You are not required to accept this License, since you have not
358 | signed it. However, nothing else grants you permission to modify or
359 | distribute the Library or its derivative works. These actions are
360 | prohibited by law if you do not accept this License. Therefore, by
361 | modifying or distributing the Library (or any work based on the
362 | Library), you indicate your acceptance of this License to do so, and
363 | all its terms and conditions for copying, distributing or modifying
364 | the Library or works based on it.
365 |
366 | 10. Each time you redistribute the Library (or any work based on the
367 | Library), the recipient automatically receives a license from the
368 | original licensor to copy, distribute, link with or modify the Library
369 | subject to these terms and conditions. You may not impose any further
370 | restrictions on the recipients' exercise of the rights granted herein.
371 | You are not responsible for enforcing compliance by third parties with
372 | this License.
373 |
374 | 11. If, as a consequence of a court judgment or allegation of patent
375 | infringement or for any other reason (not limited to patent issues),
376 | conditions are imposed on you (whether by court order, agreement or
377 | otherwise) that contradict the conditions of this License, they do not
378 | excuse you from the conditions of this License. If you cannot
379 | distribute so as to satisfy simultaneously your obligations under this
380 | License and any other pertinent obligations, then as a consequence you
381 | may not distribute the Library at all. For example, if a patent
382 | license would not permit royalty-free redistribution of the Library by
383 | all those who receive copies directly or indirectly through you, then
384 | the only way you could satisfy both it and this License would be to
385 | refrain entirely from distribution of the Library.
386 |
387 | If any portion of this section is held invalid or unenforceable under any
388 | particular circumstance, the balance of the section is intended to apply,
389 | and the section as a whole is intended to apply in other circumstances.
390 |
391 | It is not the purpose of this section to induce you to infringe any
392 | patents or other property right claims or to contest validity of any
393 | such claims; this section has the sole purpose of protecting the
394 | integrity of the free software distribution system which is
395 | implemented by public license practices. Many people have made
396 | generous contributions to the wide range of software distributed
397 | through that system in reliance on consistent application of that
398 | system; it is up to the author/donor to decide if he or she is willing
399 | to distribute software through any other system and a licensee cannot
400 | impose that choice.
401 |
402 | This section is intended to make thoroughly clear what is believed to
403 | be a consequence of the rest of this License.
404 |
405 | 12. If the distribution and/or use of the Library is restricted in
406 | certain countries either by patents or by copyrighted interfaces, the
407 | original copyright holder who places the Library under this License may add
408 | an explicit geographical distribution limitation excluding those countries,
409 | so that distribution is permitted only in or among countries not thus
410 | excluded. In such case, this License incorporates the limitation as if
411 | written in the body of this License.
412 |
413 | 13. The Free Software Foundation may publish revised and/or new
414 | versions of the Lesser General Public License from time to time.
415 | Such new versions will be similar in spirit to the present version,
416 | but may differ in detail to address new problems or concerns.
417 |
418 | Each version is given a distinguishing version number. If the Library
419 | specifies a version number of this License which applies to it and
420 | "any later version", you have the option of following the terms and
421 | conditions either of that version or of any later version published by
422 | the Free Software Foundation. If the Library does not specify a
423 | license version number, you may choose any version ever published by
424 | the Free Software Foundation.
425 |
426 | 14. If you wish to incorporate parts of the Library into other free
427 | programs whose distribution conditions are incompatible with these,
428 | write to the author to ask for permission. For software which is
429 | copyrighted by the Free Software Foundation, write to the Free
430 | Software Foundation; we sometimes make exceptions for this. Our
431 | decision will be guided by the two goals of preserving the free status
432 | of all derivatives of our free software and of promoting the sharing
433 | and reuse of software generally.
434 |
435 | NO WARRANTY
436 |
437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
446 |
447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
456 | DAMAGES.
457 |
458 | END OF TERMS AND CONDITIONS
459 |
460 | How to Apply These Terms to Your New Libraries
461 |
462 | If you develop a new library, and you want it to be of the greatest
463 | possible use to the public, we recommend making it free software that
464 | everyone can redistribute and change. You can do so by permitting
465 | redistribution under these terms (or, alternatively, under the terms of the
466 | ordinary General Public License).
467 |
468 | To apply these terms, attach the following notices to the library. It is
469 | safest to attach them to the start of each source file to most effectively
470 | convey the exclusion of warranty; and each file should have at least the
471 | "copyright" line and a pointer to where the full notice is found.
472 |
473 |
474 | Copyright (C)
475 |
476 | This library is free software; you can redistribute it and/or
477 | modify it under the terms of the GNU Lesser General Public
478 | License as published by the Free Software Foundation; either
479 | version 2.1 of the License, or (at your option) any later version.
480 |
481 | This library is distributed in the hope that it will be useful,
482 | but WITHOUT ANY WARRANTY; without even the implied warranty of
483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
484 | Lesser General Public License for more details.
485 |
486 | You should have received a copy of the GNU Lesser General Public
487 | License along with this library; if not, write to the Free Software
488 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
489 | USA
490 |
491 | Also add information on how to contact you by electronic and paper mail.
492 |
493 | You should also get your employer (if you work as a programmer) or your
494 | school, if any, to sign a "copyright disclaimer" for the library, if
495 | necessary. Here is a sample; alter the names:
496 |
497 | Yoyodyne, Inc., hereby disclaims all copyright interest in the
498 | library `Frob' (a library for tweaking knobs) written by James Random
499 | Hacker.
500 |
501 | , 1 April 1990
502 | Ty Coon, President of Vice
503 |
504 | That's all there is to it!
505 |
--------------------------------------------------------------------------------
/.idea/editor.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 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 |
580 |
--------------------------------------------------------------------------------