diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b8f091f8..502430f05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,12 +57,19 @@ else(WIN32) -fno-builtin -w -g3 - -m32 ) - # Link everything 32-bit (until we have a 64-bit option) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32") + # It's 2019 so we compile and link everything 64-bit, unless the host architecture is i368 + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ")") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ") ") + + EXECUTE_PROCESS( COMMAND uname -m '\n' OUTPUT_VARIABLE ARCHITECTURE ) + message( STATUS "Architecture: ${ARCHITECTURE}" ) + if( ${ARCHITECTURE} MATCHES "i368") + add_compile_options(-m32) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32") + endif() # Linker options # Dynamic by default diff --git a/build.sh b/build.sh index e8d5812a0..e4348e1a7 100755 --- a/build.sh +++ b/build.sh @@ -34,14 +34,20 @@ case $LINK in STATIC) CMAKE_OPTS="$CMAKE_OPTS -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON";; esac +#if [[ "$(uname -p)" == "x86_64" ]]; then +# CMAKE_OPTS="$CMAKE_OPTS -DARCH=64"; +#fii + # Prefer ninja over make, if it is available -if which ninja 2>&1 >/dev/null; then - CMAKE_OPTS="-G Ninja $CMAKE_OPTS" - BUILD_FLAGS= -else +#if which ninja 2>&1 >/dev/null; then +# CMAKE_OPTS="-G Ninja $CMAKE_OPTS" +# BUILD_FLAGS= +#else # BUILD_FLAGS="-- -j$(getconf _NPROCESSORS_ONLN)" BUILD_FLAGS= -fi +#fi + + cmake $CMAKE_OPTS .. diff --git a/challenges/Azurad/CMakeLists.txt b/challenges/Azurad/CMakeLists.txt index 3a35022bd..8501ae3b2 100644 --- a/challenges/Azurad/CMakeLists.txt +++ b/challenges/Azurad/CMakeLists.txt @@ -1,6 +1,6 @@ add_compile_options( -fno-exceptions -fno-rtti -DCPLUSPLUS ) set( SERVICE_ID "00119" ) set( AUTHOR_ID "KPRCA" ) -add_compile_options( -Oz -g ) +add_compile_options( -Os -g ) set( VULN_COUNT "1" ) buildCB() diff --git a/challenges/Blubber/CMakeLists.txt b/challenges/Blubber/CMakeLists.txt index 7ead51731..27054fb0c 100644 --- a/challenges/Blubber/CMakeLists.txt +++ b/challenges/Blubber/CMakeLists.txt @@ -1,6 +1,6 @@ add_compile_options( -fno-exceptions -fno-rtti -DCPLUSPLUS ) set( SERVICE_ID "00111" ) set( AUTHOR_ID "KPRCA" ) -add_compile_options( -O1 -g ) +add_compile_options( -O1 -g -fpermissive -fms-extensions) set( VULN_COUNT "1" ) buildCB() diff --git a/challenges/CML/CMakeLists.txt b/challenges/CML/CMakeLists.txt index 42a9d4cda..008a753e9 100644 --- a/challenges/CML/CMakeLists.txt +++ b/challenges/CML/CMakeLists.txt @@ -1,6 +1,6 @@ add_compile_options( -fno-exceptions -fno-rtti -DCPLUSPLUS ) set( SERVICE_ID "00097" ) set( AUTHOR_ID "KPRCA" ) -add_compile_options( -O3 -g ) +add_compile_options( -O3 -g -fpermissive -fms-extensions ) set( VULN_COUNT "1" ) buildCB() diff --git a/challenges/Charter/CMakeLists.txt b/challenges/Charter/CMakeLists.txt index 3d10e1768..8b10305a5 100644 --- a/challenges/Charter/CMakeLists.txt +++ b/challenges/Charter/CMakeLists.txt @@ -1,7 +1,7 @@ set( POLLS_TESTING_SEED "-710644949" ) set( POLLS_RELEASE_MAX_DEPTH "20" ) set( POLLS_RELEASE_SEED "40" ) -add_compile_options( -O0 -g -mno-sse -fblocks ) +add_compile_options( -O0 -g -mno-sse -fblocks -O3 -msse2) set( SERVICE_ID "00006" ) set( AUTHOR_ID "CROMU" ) set( NO_STRIP "1" ) diff --git a/challenges/FailAV/CMakeLists.txt b/challenges/FailAV/CMakeLists.txt index ed717c236..ead5a656e 100644 --- a/challenges/FailAV/CMakeLists.txt +++ b/challenges/FailAV/CMakeLists.txt @@ -1,7 +1,7 @@ set( VULN_COUNT "1" ) add_compile_options( -fno-exceptions -fno-rtti -DCPLUSPLUS ) set( override LDFLAGS "-nostdlib -static -Ttext=0x90000000" ) -add_compile_options( -Oz -g ) +add_compile_options( -Oz -g -fpermissive -fms-extensions) set( SERVICE_ID "00091" ) set( AUTHOR_ID "KPRCA" ) buildCB() diff --git a/challenges/Messaging/CMakeLists.txt b/challenges/Messaging/CMakeLists.txt index 37af7b29b..cba911252 100644 --- a/challenges/Messaging/CMakeLists.txt +++ b/challenges/Messaging/CMakeLists.txt @@ -1,6 +1,6 @@ add_compile_options( -fno-exceptions -fno-rtti -DCPLUSPLUS ) set( SERVICE_ID "00075" ) set( AUTHOR_ID "KPRCA" ) -add_compile_options( -O3 -g -DDISABLE_HEAP_GUARD ) +add_compile_options( -O3 -g -DDISABLE_HEAP_GUARDi -fpermissive -fms-extensions ) set( VULN_COUNT "1" ) buildCB() diff --git a/challenges/PTaaS/CMakeLists.txt b/challenges/PTaaS/CMakeLists.txt index d1cfaa86b..e4ce2caa7 100644 --- a/challenges/PTaaS/CMakeLists.txt +++ b/challenges/PTaaS/CMakeLists.txt @@ -1,6 +1,6 @@ set( SERVICE_ID "00054" ) set( AUTHOR_ID "NRFIN" ) -add_compile_options( -O0 -g -mno-sse ) +add_compile_options( -O0 -g -mno-sse -msse2 -O3 ) set( VULN_COUNT "1" ) buildCB() buildSO() diff --git a/challenges/ValveChecks/CMakeLists.txt b/challenges/ValveChecks/CMakeLists.txt index 93002d65f..29e766a53 100644 --- a/challenges/ValveChecks/CMakeLists.txt +++ b/challenges/ValveChecks/CMakeLists.txt @@ -1,6 +1,6 @@ set( POLLS_TESTING_SEED "1677617456" ) set( POLLS_RELEASE_SEED "1681795162" ) -add_compile_options( -mno-sse -O0 -g -fcommon ) +add_compile_options( -mno-sse -O0 -g -fcommon -msse2 -O3 ) set( SERVICE_ID "00016" ) set( AUTHOR_ID "NRFIN" ) set( POLLS_RELEASE_COUNT "1000" ) diff --git a/challenges/FUN/CMakeLists.txt b/exclude/FUN/CMakeLists.txt similarity index 100% rename from challenges/FUN/CMakeLists.txt rename to exclude/FUN/CMakeLists.txt diff --git a/challenges/FUN/README.md b/exclude/FUN/README.md similarity index 100% rename from challenges/FUN/README.md rename to exclude/FUN/README.md diff --git a/challenges/FUN/lib/calloc.c b/exclude/FUN/lib/calloc.c similarity index 100% rename from challenges/FUN/lib/calloc.c rename to exclude/FUN/lib/calloc.c diff --git a/challenges/FUN/lib/cgc_ctype.h b/exclude/FUN/lib/cgc_ctype.h similarity index 100% rename from challenges/FUN/lib/cgc_ctype.h rename to exclude/FUN/lib/cgc_ctype.h diff --git a/challenges/FUN/lib/cgc_malloc.h b/exclude/FUN/lib/cgc_malloc.h similarity index 100% rename from challenges/FUN/lib/cgc_malloc.h rename to exclude/FUN/lib/cgc_malloc.h diff --git a/challenges/FUN/lib/cgc_stdarg.h b/exclude/FUN/lib/cgc_stdarg.h similarity index 100% rename from challenges/FUN/lib/cgc_stdarg.h rename to exclude/FUN/lib/cgc_stdarg.h diff --git a/challenges/FUN/lib/cgc_stddef.h b/exclude/FUN/lib/cgc_stddef.h similarity index 100% rename from challenges/FUN/lib/cgc_stddef.h rename to exclude/FUN/lib/cgc_stddef.h diff --git a/challenges/FUN/lib/cgc_stdint.h b/exclude/FUN/lib/cgc_stdint.h similarity index 100% rename from challenges/FUN/lib/cgc_stdint.h rename to exclude/FUN/lib/cgc_stdint.h diff --git a/challenges/FUN/lib/cgc_stdlib.h b/exclude/FUN/lib/cgc_stdlib.h similarity index 100% rename from challenges/FUN/lib/cgc_stdlib.h rename to exclude/FUN/lib/cgc_stdlib.h diff --git a/challenges/FUN/lib/cgc_string.h b/exclude/FUN/lib/cgc_string.h similarity index 100% rename from challenges/FUN/lib/cgc_string.h rename to exclude/FUN/lib/cgc_string.h diff --git a/challenges/FUN/lib/ctype.c b/exclude/FUN/lib/ctype.c similarity index 100% rename from challenges/FUN/lib/ctype.c rename to exclude/FUN/lib/ctype.c diff --git a/challenges/FUN/lib/free.c b/exclude/FUN/lib/free.c similarity index 100% rename from challenges/FUN/lib/free.c rename to exclude/FUN/lib/free.c diff --git a/challenges/FUN/lib/malloc.c b/exclude/FUN/lib/malloc.c similarity index 100% rename from challenges/FUN/lib/malloc.c rename to exclude/FUN/lib/malloc.c diff --git a/challenges/FUN/lib/malloc_common.c b/exclude/FUN/lib/malloc_common.c similarity index 100% rename from challenges/FUN/lib/malloc_common.c rename to exclude/FUN/lib/malloc_common.c diff --git a/challenges/FUN/lib/memchr.c b/exclude/FUN/lib/memchr.c similarity index 100% rename from challenges/FUN/lib/memchr.c rename to exclude/FUN/lib/memchr.c diff --git a/challenges/FUN/lib/memcmp.c b/exclude/FUN/lib/memcmp.c similarity index 100% rename from challenges/FUN/lib/memcmp.c rename to exclude/FUN/lib/memcmp.c diff --git a/challenges/FUN/lib/memcpy.c b/exclude/FUN/lib/memcpy.c similarity index 100% rename from challenges/FUN/lib/memcpy.c rename to exclude/FUN/lib/memcpy.c diff --git a/challenges/FUN/lib/memmove.c b/exclude/FUN/lib/memmove.c similarity index 100% rename from challenges/FUN/lib/memmove.c rename to exclude/FUN/lib/memmove.c diff --git a/challenges/FUN/lib/memset.c b/exclude/FUN/lib/memset.c similarity index 100% rename from challenges/FUN/lib/memset.c rename to exclude/FUN/lib/memset.c diff --git a/challenges/FUN/lib/printf.c b/exclude/FUN/lib/printf.c similarity index 100% rename from challenges/FUN/lib/printf.c rename to exclude/FUN/lib/printf.c diff --git a/challenges/FUN/lib/realloc.c b/exclude/FUN/lib/realloc.c similarity index 100% rename from challenges/FUN/lib/realloc.c rename to exclude/FUN/lib/realloc.c diff --git a/challenges/FUN/lib/strcasecmp.c b/exclude/FUN/lib/strcasecmp.c similarity index 100% rename from challenges/FUN/lib/strcasecmp.c rename to exclude/FUN/lib/strcasecmp.c diff --git a/challenges/FUN/lib/strcat.c b/exclude/FUN/lib/strcat.c similarity index 100% rename from challenges/FUN/lib/strcat.c rename to exclude/FUN/lib/strcat.c diff --git a/challenges/FUN/lib/strchr.c b/exclude/FUN/lib/strchr.c similarity index 100% rename from challenges/FUN/lib/strchr.c rename to exclude/FUN/lib/strchr.c diff --git a/challenges/FUN/lib/strcmp.c b/exclude/FUN/lib/strcmp.c similarity index 100% rename from challenges/FUN/lib/strcmp.c rename to exclude/FUN/lib/strcmp.c diff --git a/challenges/FUN/lib/strcpy.c b/exclude/FUN/lib/strcpy.c similarity index 100% rename from challenges/FUN/lib/strcpy.c rename to exclude/FUN/lib/strcpy.c diff --git a/challenges/FUN/lib/strdup.c b/exclude/FUN/lib/strdup.c similarity index 100% rename from challenges/FUN/lib/strdup.c rename to exclude/FUN/lib/strdup.c diff --git a/challenges/FUN/lib/strlen.c b/exclude/FUN/lib/strlen.c similarity index 100% rename from challenges/FUN/lib/strlen.c rename to exclude/FUN/lib/strlen.c diff --git a/challenges/FUN/lib/strncasecmp.c b/exclude/FUN/lib/strncasecmp.c similarity index 100% rename from challenges/FUN/lib/strncasecmp.c rename to exclude/FUN/lib/strncasecmp.c diff --git a/challenges/FUN/lib/strncmp.c b/exclude/FUN/lib/strncmp.c similarity index 100% rename from challenges/FUN/lib/strncmp.c rename to exclude/FUN/lib/strncmp.c diff --git a/challenges/FUN/lib/strncpy.c b/exclude/FUN/lib/strncpy.c similarity index 100% rename from challenges/FUN/lib/strncpy.c rename to exclude/FUN/lib/strncpy.c diff --git a/challenges/FUN/lib/strsep.c b/exclude/FUN/lib/strsep.c similarity index 100% rename from challenges/FUN/lib/strsep.c rename to exclude/FUN/lib/strsep.c diff --git a/challenges/FUN/lib/strtol.c b/exclude/FUN/lib/strtol.c similarity index 100% rename from challenges/FUN/lib/strtol.c rename to exclude/FUN/lib/strtol.c diff --git a/challenges/FUN/poller/for-release/POLL_00001.xml b/exclude/FUN/poller/for-release/POLL_00001.xml similarity index 100% rename from challenges/FUN/poller/for-release/POLL_00001.xml rename to exclude/FUN/poller/for-release/POLL_00001.xml diff --git a/challenges/FUN/poller/for-testing/POLL_00001.xml b/exclude/FUN/poller/for-testing/POLL_00001.xml similarity index 100% rename from challenges/FUN/poller/for-testing/POLL_00001.xml rename to exclude/FUN/poller/for-testing/POLL_00001.xml diff --git a/challenges/FUN/poller/for-testing/machine.py b/exclude/FUN/poller/for-testing/machine.py similarity index 100% rename from challenges/FUN/poller/for-testing/machine.py rename to exclude/FUN/poller/for-testing/machine.py diff --git a/challenges/FUN/poller/for-testing/state-graph.yaml b/exclude/FUN/poller/for-testing/state-graph.yaml similarity index 100% rename from challenges/FUN/poller/for-testing/state-graph.yaml rename to exclude/FUN/poller/for-testing/state-graph.yaml diff --git a/challenges/FUN/pov_1/pov.c b/exclude/FUN/pov_1/pov.c similarity index 100% rename from challenges/FUN/pov_1/pov.c rename to exclude/FUN/pov_1/pov.c diff --git a/challenges/FUN/src/cgc_text.h b/exclude/FUN/src/cgc_text.h similarity index 100% rename from challenges/FUN/src/cgc_text.h rename to exclude/FUN/src/cgc_text.h diff --git a/challenges/FUN/src/cgc_words_r.h b/exclude/FUN/src/cgc_words_r.h similarity index 100% rename from challenges/FUN/src/cgc_words_r.h rename to exclude/FUN/src/cgc_words_r.h diff --git a/challenges/FUN/src/main.c b/exclude/FUN/src/main.c similarity index 100% rename from challenges/FUN/src/main.c rename to exclude/FUN/src/main.c diff --git a/challenges/FUN/src/tornado.c b/exclude/FUN/src/tornado.c similarity index 100% rename from challenges/FUN/src/tornado.c rename to exclude/FUN/src/tornado.c