Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(SOURCES xpmgr.cpp)
set(LIB_SOURCES xpmgr_lib.cpp)

# ==== x86 build ====

# Static library for x86
add_library(xpmgr_static_x86 STATIC ${LIB_SOURCES})
target_compile_options(xpmgr_static_x86 PRIVATE -m32)
target_link_libraries(xpmgr_static_x86 PRIVATE ole32 oleaut32 uuid)

set(RES_X86 ${CMAKE_BINARY_DIR}/icon_x86.res)

# Create a custom target for the x86 resource compilation
Expand All @@ -26,11 +33,17 @@ add_dependencies(xpmgr_x86 xpmgr_x86_res)
target_compile_options(xpmgr_x86 PRIVATE -m32)
target_link_options(xpmgr_x86 PRIVATE -m32)

# Link .res file as a resource
target_link_libraries(xpmgr_x86 PRIVATE ole32 oleaut32 uuid)
# Link .res file and static library
target_link_libraries(xpmgr_x86 PRIVATE ole32 oleaut32 uuid xpmgr_static_x86)
target_link_options(xpmgr_x86 PRIVATE -Wl,--subsystem,console ${RES_X86})

# ==== x64 build ====

# Static library for x64
add_library(xpmgr_static_x64 STATIC ${LIB_SOURCES})
target_compile_options(xpmgr_static_x64 PRIVATE -m64)
target_link_libraries(xpmgr_static_x64 PRIVATE ole32 oleaut32 uuid)

set(RES_X64 ${CMAKE_BINARY_DIR}/icon_x64.res)

# Create a custom target for the x64 resource compilation
Expand All @@ -50,6 +63,13 @@ add_dependencies(xpmgr_x64 xpmgr_x64_res)
target_compile_options(xpmgr_x64 PRIVATE -m64)
target_link_options(xpmgr_x64 PRIVATE -m64)

# Link .res file as a resource
target_link_libraries(xpmgr_x64 PRIVATE ole32 oleaut32 uuid)
# Link .res file and static library
target_link_libraries(xpmgr_x64 PRIVATE ole32 oleaut32 uuid xpmgr_static_x64)
target_link_options(xpmgr_x64 PRIVATE -Wl,--subsystem,console ${RES_X64})

# Install targets
install(TARGETS xpmgr_static_x86 xpmgr_static_x64
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)

install(FILES xpmgr.h DESTINATION include)
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ If you have an Itanium version of Windows XP or Server 2003, Windows Product Act

`/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).

This can also be used as a library; see the xpmgr.h file for details.

## Releases
https://github.com/UMSKT/xpmgr/releases

Expand Down
Loading