-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
94 lines (86 loc) · 3.74 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.18)
project(navicat-keygen)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(fmt REQUIRED)
find_package(RapidJSON REQUIRED)
find_package(OpenSSL REQUIRED)
include(FetchContent)
set(KEYSTONE_BUILD_STATIC_RUNTIME ON CACHE BOOL "" FORCE)
set(BUILD_LIBS_ONLY ON CACHE BOOL "" FORCE)
set(UNICORN_ARCH "x86" CACHE STRING "" FORCE)
set(UNICORN_INSTALL OFF CACHE BOOL "" FORCE)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
set(UNICORN_BUILD_TESTS OFF CACHE BOOL "" FORCE)
FetchContent_Declare(
keystone
GIT_REPOSITORY "https://github.com/keystone-engine/keystone.git"
GIT_TAG "1475885daa7e566c064ae9754706e1a0ba24be3b"
)
FetchContent_Declare(
unicorn
URL "https://github.com/unicorn-engine/unicorn/archive/refs/tags/2.0.0.tar.gz"
URL_HASH "SHA256=67b445c760e2bbac663e8c8bc410e43311c7fc92df4dfa8d90e06a021d07f634"
)
FetchContent_MakeAvailable(keystone unicorn)
set(
NKG_COMMON_SOURCE
./common/exception.hpp
./common/exceptions/index_exception.hpp
./common/exceptions/key_exception.hpp
./common/exceptions/operation_canceled_exception.hpp
./common/exceptions/unix_exception.hpp
./common/resource_wrapper.hpp
./common/resource_traits/cxx_object_traits.hpp
./common/resource_traits/cxx_dynamic_array_traits.hpp
./common/resource_traits/keystone/keystone_alloc.hpp
./common/resource_traits/keystone/keystone_handle.hpp
./common/resource_traits/openssl/bignum.hpp
./common/resource_traits/openssl/bio.hpp
./common/resource_traits/openssl/bio_chain.hpp
./common/resource_traits/openssl/rsa.hpp
./common/resource_traits/openssl/evp_pkey.hpp
./common/resource_traits/openssl/evp_pkey_ctx.hpp
./common/resource_traits/openssl/evp_cipher_ctx.hpp
./common/resource_traits/openssl/encoder_ctx.hpp
./common/resource_traits/openssl/decoder_ctx.hpp
./common/resource_traits/unicorn/unicorn_handle.hpp
./common/resource_traits/unicorn/unicorn_alloc.hpp
./common/resource_traits/unix_os/file_descriptor.hpp
./common/resource_traits/unix_os/map_view.hpp
./common/rsa_cipher.hpp
./common/rsa_cipher.cpp
)
set(
NKG_KEYGEN_SOURCE
./navicat-keygen/base32_rfc4648.hpp
./navicat-keygen/base32_rfc4648.cpp
./navicat-keygen/base64_rfc4648.hpp
./navicat-keygen/base64_rfc4648.cpp
./navicat-keygen/navicat_serial_generator.hpp
./navicat-keygen/navicat_serial_generator.cpp
./navicat-keygen/CollectInformation.cpp
./navicat-keygen/GenerateLicense.cpp
./navicat-keygen/main.cpp
)
set(
NKG_PATCHER_SOURCE
./navicat-patcher/amd64_emulator.hpp
./navicat-patcher/amd64_emulator.cpp
./navicat-patcher/keystone_assembler.hpp
./navicat-patcher/keystone_assembler.cpp
./navicat-patcher/elf64_interpreter.hpp
./navicat-patcher/elf64_interpreter.cpp
./navicat-patcher/patch_solution.hpp
./navicat-patcher/patch_solution_since.hpp
./navicat-patcher/patch_solution_since_16.0.7.0.hpp
./navicat-patcher/patch_solution_since_16.0.7.0.cpp
./navicat-patcher/memory_utility.hpp
./navicat-patcher/main.cpp
)
add_executable(navicat-keygen ${NKG_COMMON_SOURCE} ${NKG_KEYGEN_SOURCE})
target_include_directories(navicat-keygen PRIVATE ./common ${RAPIDJSON_INCLUDE_DIRS})
target_link_libraries(navicat-keygen fmt::fmt OpenSSL::Crypto)
add_executable(navicat-patcher ${NKG_COMMON_SOURCE} ${NKG_PATCHER_SOURCE})
target_include_directories(navicat-patcher PRIVATE ./common ${keystone_SOURCE_DIR}/include)
target_link_libraries(navicat-patcher fmt::fmt OpenSSL::Crypto keystone unicorn pthread stdc++fs)