-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
86 lines (74 loc) · 2.18 KB
/
CMakeLists.txt
File metadata and controls
86 lines (74 loc) · 2.18 KB
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
###############################################################################
# PLUG X
###############################################################################
cmake_minimum_required (VERSION 3.26)
project("Plug X" DESCRIPTION "Plug X Implant" LANGUAGES CXX C)
message("Compiler ID: ${CMAKE_CXX_COMPILER_ID}")
message("Compiler Version: ${CMAKE_CXX_COMPILER_VERSION}")
# Set up Google Tests
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker
# settings.
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
# So that GoogleTest does not get installed with this project
option(INSTALL_GTEST "Enable installation of googletest." OFF)
FetchContent_MakeAvailable(googletest)
include(GoogleTest)
enable_testing()
# For building and testing position-independent code
FetchContent_Declare(
assemblyline
GIT_REPOSITORY
"git@github.com:attackevals/assemblyline.git"
GIT_TAG
"a1ee49a9bd61955a738ef9a17d83a63bf310edff"
)
FetchContent_MakeAvailable(assemblyline)
# Subdirectories
add_subdirectory("tests")
add_subdirectory("src")
add_subdirectory("PlugxMSI")
# Installation Bundle
install(
TARGETS
shellcode-pe
test5shellcode-pe
rcdll
DESTINATION $<CONFIG>
)
install(
FILES
"$<TARGET_FILE_DIR:shellcode-pe>/WinGUpdate.dat"
"$<TARGET_FILE_DIR:test5shellcode-pe>/resinfo.dat"
"${CMAKE_SOURCE_DIR}/src/loader/GUP.exe"
"${CMAKE_SOURCE_DIR}/src/loader/gup.xml"
"${CMAKE_SOURCE_DIR}/src/test5/rcdll/rc.exe"
DESTINATION $<CONFIG>
)
get_property(NIM_LIB_PATH GLOBAL PROPERTY NIM_LIB_PATH)
get_property(NIM_NAME GLOBAL PROPERTY NIM_NAME)
install(
FILES
"${NIM_LIB_PATH}" RENAME "${NIM_NAME}.dll"
DESTINATION $<CONFIG>
)
# PDB and other files
install(
FILES
$<TARGET_PDB_FILE:shellcode-pe>
$<TARGET_PDB_FILE:test5shellcode-pe>
$<TARGET_PDB_FILE:rcdll>
DESTINATION $<CONFIG>
OPTIONAL
)
get_property(NIM_PDB_PATH GLOBAL PROPERTY NIM_PDB_PATH)
install(
FILES
"${NIM_PDB_PATH}" RENAME "${NIM_NAME}.pdb"
DESTINATION $<CONFIG>
OPTIONAL
)