-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
66 lines (60 loc) · 1.77 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
cmake_minimum_required(VERSION 3.2)
set(CMAKE_CXX_STANDARD 20)
project(gadgify)
add_subdirectory(deps/argparse)
include_directories(
deps/capstone/include
deps/argparse/include/argparse
src/
)
add_compile_definitions(CAPSTONE_USE_SYS_DYN_MEM CAPSTONE_HAS_X86, CAPSTONE_HAS_ARM, CAPSTONE_HAS_AARCH64, CAPSTONE_HAS_MIPS)
file(GLOB
capstoneSource
deps/capstone/*.h
deps/capstone/arch/X86/*.h
deps/capstone/arch/ARM/*.h
deps/capstone/arch/AArch64/*.h
deps/capstone/arch/Mips/*.h
deps/capstone/*.c
deps/capstone/arch/X86/*.c
deps/capstone/arch/ARM/*.c
deps/capstone/arch/AArch64/*.c
deps/capstone/arch/Mips/*.c
)
add_library(capstone ${capstoneSource})
target_compile_options(capstone PRIVATE -w)
add_executable(gadgify
src/main.cpp
src/File.cpp
src/File.h
src/PEFile.cpp
src/PEFile.h
src/Gadgify.cpp
src/Gadgify.h
src/ExecutableBinary.cpp
src/ExecutableBinary.h
src/ThreadPool.cpp
src/ThreadPool.h
)
install(TARGETS gadgify)
target_link_libraries(gadgify PRIVATE capstone)
target_link_options(gadgify PRIVATE --static)
IF(DEFINED FUZZER)
add_executable(fuzzer
fuzzer/fuzzer.cpp
src/File.cpp
src/File.h
src/PEFile.cpp
src/PEFile.h
src/Gadgify.cpp
src/Gadgify.h
src/ExecutableBinary.cpp
src/ExecutableBinary.h
src/ThreadPool.cpp
src/ThreadPool.h
)
target_link_libraries(fuzzer PRIVATE capstone)
target_compile_options(fuzzer PRIVATE /DEBUG /fsanitize=address /fsanitize=fuzzer)
target_link_options(fuzzer PRIVATE /DEBUG /fsanitize=address /fsanitize=fuzzer)
install(TARGETS fuzzer)
ENDIF(DEFINED FUZZER)