diff --git a/CMakeLists.txt b/CMakeLists.txt index 612c599..2fdadb7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,10 @@ include_directories("./include") # Settings set(MBE_FLAGS "-m32 -O0 -fno-inline-functions") -set(NO_MITS_FLAGS "-z execstack -z norelro -fno-stack-protector") +set(DISABLE_DEP_FLAG "-z execstack") +set(DISABLE_RELRO_FLAG "-z norelro") +set(DISABLE_CANARY_FLAG "-fno-stack-protector") +set(NO_MITS_FLAGS "${DISABLE_DEP_FLAG} ${DISABLE_RELRO_FLAG} ${DISABLE_CANARIES_FLAG}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MBE_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MBE_FLAGS}") diff --git a/src/lecture/rop/CMakeLists.txt b/src/lecture/rop/CMakeLists.txt index ec5c73f..c826b08 100644 --- a/src/lecture/rop/CMakeLists.txt +++ b/src/lecture/rop/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.8) # Adds an executable target add_executable(rop_exit rop_exit.c) +SET_FLAGS(rop_exit "${DISABLE_CANARY_FLAG}") add_executable(rop_pivot rop_pivot.c) SET_FLAGS(rop_pivot "-static")