diff --git a/CMakeLists.txt b/CMakeLists.txt index d1113184..92c10865 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,7 @@ momo_add_subdirectory_and_get_targets("src" OWN_TARGETS) ########################################## -momo_targets_set_folder("External Dependencies" ${EXTERNAL_TARGETS}) +momo_targets_set_folder("dependencies" ${EXTERNAL_TARGETS}) momo_targets_exclude_from_all(${EXTERNAL_TARGETS}) momo_targets_disable_warnings(${EXTERNAL_TARGETS}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 77aef22b..72d8caa8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,14 +3,18 @@ add_subdirectory(emulator) add_subdirectory(gdb-stub) add_subdirectory(unicorn-emulator) add_subdirectory(windows-emulator) +add_subdirectory(windows-gdb-stub) + if (NOT MOMO_BUILD_AS_LIBRARY) add_subdirectory(analyzer) add_subdirectory(fuzzing-engine) add_subdirectory(fuzzer) - if(WIN32) - add_subdirectory(bad-sample) - add_subdirectory(test-sample) - endif() add_subdirectory(windows-emulator-test) - add_subdirectory(tools) + if(WIN32) + momo_add_subdirectory_and_get_targets("tools" TOOL_TARGETS) + momo_targets_set_folder("tools" ${TOOL_TARGETS}) + + momo_add_subdirectory_and_get_targets("samples" SAMPLE_TARGETS) + momo_targets_set_folder("samples" ${SAMPLE_TARGETS}) + endif() endif() diff --git a/src/analyzer/CMakeLists.txt b/src/analyzer/CMakeLists.txt index 2fbf8005..2a550be4 100644 --- a/src/analyzer/CMakeLists.txt +++ b/src/analyzer/CMakeLists.txt @@ -15,7 +15,7 @@ target_precompile_headers(analyzer PRIVATE std_include.hpp) target_link_libraries(analyzer PRIVATE reflect windows-emulator - gdb-stub + windows-gdb-stub ) set_property(GLOBAL PROPERTY VS_STARTUP_PROJECT analyzer) diff --git a/src/analyzer/main.cpp b/src/analyzer/main.cpp index ef180990..9b9adea2 100644 --- a/src/analyzer/main.cpp +++ b/src/analyzer/main.cpp @@ -1,7 +1,7 @@ #include "std_include.hpp" #include -#include +#include #include "object_watching.hpp" diff --git a/src/emulator/CMakeLists.txt b/src/emulator/CMakeLists.txt index f4990045..15e1395a 100644 --- a/src/emulator/CMakeLists.txt +++ b/src/emulator/CMakeLists.txt @@ -8,6 +8,4 @@ list(SORT SRC_FILES) add_library(emulator ${SRC_FILES}) -target_include_directories(emulator INTERFACE - "${CMAKE_CURRENT_LIST_DIR}" -) +target_include_directories(emulator INTERFACE "${CMAKE_CURRENT_LIST_DIR}") diff --git a/src/fuzzing-engine/CMakeLists.txt b/src/fuzzing-engine/CMakeLists.txt index 90ecd42b..00d49892 100644 --- a/src/fuzzing-engine/CMakeLists.txt +++ b/src/fuzzing-engine/CMakeLists.txt @@ -14,8 +14,6 @@ target_link_libraries(fuzzing-engine PRIVATE emulator-common ) -target_include_directories(fuzzing-engine INTERFACE - "${CMAKE_CURRENT_LIST_DIR}" -) +target_include_directories(fuzzing-engine INTERFACE "${CMAKE_CURRENT_LIST_DIR}") momo_strip_target(fuzzing-engine) diff --git a/src/gdb-stub/CMakeLists.txt b/src/gdb-stub/CMakeLists.txt index 2b3e2d80..acf44296 100644 --- a/src/gdb-stub/CMakeLists.txt +++ b/src/gdb-stub/CMakeLists.txt @@ -10,12 +10,10 @@ add_library(gdb-stub ${SRC_FILES}) momo_assign_source_group(${SRC_FILES}) -target_link_libraries(gdb-stub PRIVATE +target_link_libraries(gdb-stub PUBLIC emulator-common ) -target_include_directories(gdb-stub INTERFACE - "${CMAKE_CURRENT_LIST_DIR}" -) +target_include_directories(gdb-stub INTERFACE "${CMAKE_CURRENT_LIST_DIR}") momo_strip_target(gdb-stub) diff --git a/src/samples/CMakeLists.txt b/src/samples/CMakeLists.txt new file mode 100644 index 00000000..b9067a51 --- /dev/null +++ b/src/samples/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(bad-sample) +add_subdirectory(test-sample) diff --git a/src/bad-sample/CMakeLists.txt b/src/samples/bad-sample/CMakeLists.txt similarity index 100% rename from src/bad-sample/CMakeLists.txt rename to src/samples/bad-sample/CMakeLists.txt diff --git a/src/bad-sample/bad.cpp b/src/samples/bad-sample/bad.cpp similarity index 100% rename from src/bad-sample/bad.cpp rename to src/samples/bad-sample/bad.cpp diff --git a/src/test-sample/CMakeLists.txt b/src/samples/test-sample/CMakeLists.txt similarity index 100% rename from src/test-sample/CMakeLists.txt rename to src/samples/test-sample/CMakeLists.txt diff --git a/src/test-sample/test.cpp b/src/samples/test-sample/test.cpp similarity index 100% rename from src/test-sample/test.cpp rename to src/samples/test-sample/test.cpp diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index d6d59c3a..0b8d9913 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -1,4 +1 @@ -if(WIN32) - add_subdirectory(dump-apiset) -endif() - +add_subdirectory(dump-apiset) diff --git a/src/unicorn-emulator/CMakeLists.txt b/src/unicorn-emulator/CMakeLists.txt index f86f2870..ad781b7e 100644 --- a/src/unicorn-emulator/CMakeLists.txt +++ b/src/unicorn-emulator/CMakeLists.txt @@ -12,9 +12,7 @@ else() add_library(unicorn-emulator SHARED ${SRC_FILES}) endif() -target_include_directories(unicorn-emulator INTERFACE - "${CMAKE_CURRENT_LIST_DIR}" -) +target_include_directories(unicorn-emulator INTERFACE "${CMAKE_CURRENT_LIST_DIR}") target_link_libraries(unicorn-emulator PUBLIC emulator) target_link_libraries(unicorn-emulator PRIVATE unicorn emulator-common) diff --git a/src/windows-emulator-test/CMakeLists.txt b/src/windows-emulator-test/CMakeLists.txt index 0bffacc1..5f755e01 100644 --- a/src/windows-emulator-test/CMakeLists.txt +++ b/src/windows-emulator-test/CMakeLists.txt @@ -21,4 +21,6 @@ endif() add_test(NAME windows-emulator-test COMMAND windows-emulator-test - WORKING_DIRECTORY "$") \ No newline at end of file + WORKING_DIRECTORY "$") + +momo_targets_set_folder("tests" windows-emulator-test) \ No newline at end of file diff --git a/src/windows-emulator/CMakeLists.txt b/src/windows-emulator/CMakeLists.txt index 90cb3af8..b0510952 100644 --- a/src/windows-emulator/CMakeLists.txt +++ b/src/windows-emulator/CMakeLists.txt @@ -21,8 +21,6 @@ target_link_libraries(windows-emulator PUBLIC emulator ) -target_include_directories(windows-emulator INTERFACE - "${CMAKE_CURRENT_LIST_DIR}" -) +target_include_directories(windows-emulator INTERFACE "${CMAKE_CURRENT_LIST_DIR}") momo_strip_target(windows-emulator) diff --git a/src/windows-gdb-stub/CMakeLists.txt b/src/windows-gdb-stub/CMakeLists.txt new file mode 100644 index 00000000..1b943484 --- /dev/null +++ b/src/windows-gdb-stub/CMakeLists.txt @@ -0,0 +1,20 @@ +file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS + *.cpp + *.hpp + *.rc +) + +list(SORT SRC_FILES) + +add_library(windows-gdb-stub ${SRC_FILES}) + +momo_assign_source_group(${SRC_FILES}) + +target_link_libraries(windows-gdb-stub PUBLIC + gdb-stub + windows-emulator +) + +target_include_directories(windows-gdb-stub INTERFACE "${CMAKE_CURRENT_LIST_DIR}") + +momo_strip_target(windows-gdb-stub) diff --git a/src/windows-gdb-stub/empty.cpp b/src/windows-gdb-stub/empty.cpp new file mode 100644 index 00000000..e69de29b diff --git a/src/windows-emulator/debugging/win_x64_gdb_stub_handler.hpp b/src/windows-gdb-stub/win_x64_gdb_stub_handler.hpp similarity index 98% rename from src/windows-emulator/debugging/win_x64_gdb_stub_handler.hpp rename to src/windows-gdb-stub/win_x64_gdb_stub_handler.hpp index ea77d3dd..e3855b6c 100644 --- a/src/windows-emulator/debugging/win_x64_gdb_stub_handler.hpp +++ b/src/windows-gdb-stub/win_x64_gdb_stub_handler.hpp @@ -1,7 +1,7 @@ #pragma once #include "x64_gdb_stub_handler.hpp" -#include "../windows_emulator.hpp" +#include class win_x64_gdb_stub_handler : public x64_gdb_stub_handler { diff --git a/src/windows-emulator/debugging/x64_gdb_stub_handler.hpp b/src/windows-gdb-stub/x64_gdb_stub_handler.hpp similarity index 99% rename from src/windows-emulator/debugging/x64_gdb_stub_handler.hpp rename to src/windows-gdb-stub/x64_gdb_stub_handler.hpp index 8adf56e3..64dea478 100644 --- a/src/windows-emulator/debugging/x64_gdb_stub_handler.hpp +++ b/src/windows-gdb-stub/x64_gdb_stub_handler.hpp @@ -1,10 +1,9 @@ #pragma once +#include +#include #include #include -#include - -#include "scoped_hook.hpp" #include "x64_register_mapping.hpp" #include "x64_target_descriptions.hpp" diff --git a/src/windows-emulator/debugging/x64_register_mapping.hpp b/src/windows-gdb-stub/x64_register_mapping.hpp similarity index 100% rename from src/windows-emulator/debugging/x64_register_mapping.hpp rename to src/windows-gdb-stub/x64_register_mapping.hpp diff --git a/src/windows-emulator/debugging/x64_target_descriptions.hpp b/src/windows-gdb-stub/x64_target_descriptions.hpp similarity index 100% rename from src/windows-emulator/debugging/x64_target_descriptions.hpp rename to src/windows-gdb-stub/x64_target_descriptions.hpp