diff --git a/.gitignore b/.gitignore index 2f1229f8..45b824ec 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,8 @@ x86/ [Aa][Rr][Mm]64/ bld/ [Bb]in/ +[Bb]uild/ +[Ii]nstall/ [Oo]bj/ [Ll]og/ [Ll]ogs/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..ecea057e --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 3.0) +project(UnrealEngineModLoader) + +set(CMAKE_CXX_STANDARD 17) # required by i.e. #include +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +# TODO: optimize: avoid restricted default folder "C:/Program Files (x86)/..." +set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/install" CACHE FILEPATH "Install path prefix, prependen onto install directories." FORCE) + +add_subdirectory(UnrealEngineModLoader) +add_subdirectory(UnrealEngineModLauncher) +add_subdirectory(LoaderAutoInjector) # xinput1_3.dll +add_subdirectory(ExampleMod) + +# ADD YOUR MODS HERE +#add_subdirectory(MyMod1) +#add_subdirectory(MyMod2) +# ... + +# install +install(FILES "ModLoaderInfo.ini" + DESTINATION $/Binaries/Win64 +) + +install(DIRECTORY "Profiles" + DESTINATION $/Binaries/Win64 +) + +#if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../WindowsNoEditor/Arise/Content/Paks/pakchunk32-WindowsNoEditor.pak") +# install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../WindowsNoEditor/Arise/Content/Paks/pakchunk32-WindowsNoEditor.pak" +# DESTINATION $/Content/Paks/LogicMods RENAME MultiplayerMod.pak +# ) +#endif() diff --git a/ExampleMod/CMakeLists.txt b/ExampleMod/CMakeLists.txt new file mode 100644 index 00000000..46b7c8ae --- /dev/null +++ b/ExampleMod/CMakeLists.txt @@ -0,0 +1,42 @@ +# CONFIG: Choose a proper project/target name +project(ExampleMod) + +# CONFIG: Set bigobj files (*.cpp) with thousands of functions to export +set(EXAMPLEMOD_BIGOBJ_FILES + # ... +) + +# CONFIG: Set other header/source files (*.h/*.hpp/*.cpp) here +set(EXAMPLEMOD_FILES + ${EXAMPLEMOD_BIGOBJ_FILES} # bigobj from above are also source code files + ../UnrealEngineModLoader/UE4/Basic.cpp + ../UnrealEngineModLoader/UE4/CoreUObject_functions.cpp + ../UnrealEngineModLoader/UE4/Ue4.hpp + dllmain.cpp + ExampleMod.cpp + ExampleMod.h +) +set_source_files_properties(${EXAMPLEMOD_BIGOBJ_FILES} PROPERTIES COMPILE_OPTIONS "/bigobj") + +add_library(${PROJECT_NAME} SHARED ${EXAMPLEMOD_FILES}) +target_link_libraries(${PROJECT_NAME} PUBLIC UnrealEngineModLoader) + +# definitions +target_compile_definitions(${PROJECT_NAME} PRIVATE _UNICODE) + +# includes +# CONFIG: set your include directories here +#target_include_directories(${PROJECT_NAME} PUBLIC PATH_TO_INCLUDE_FOLDER) + +# linking +# CONFIG: set folders with libraries here +#target_link_directories(${PROJECT_NAME} PUBLIC YOUR_PATH_TO_LIBRARY) +# CONFIG: set library names only here (no folders) +#target_link_libraries(${PROJECT_NAME} PUBLIC UnrealEngineModLoader YOUR_LIBRARY_NAME) + +# install +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION $/Content/CoreMods +) + +install(FILES $ DESTINATION $/Content/CoreMods OPTIONAL) diff --git a/LoaderAutoInjector/CMakeLists.txt b/LoaderAutoInjector/CMakeLists.txt new file mode 100644 index 00000000..967cb20f --- /dev/null +++ b/LoaderAutoInjector/CMakeLists.txt @@ -0,0 +1,32 @@ +project(LoaderAutoInjector LANGUAGES CXX ASM_MASM) + +set(LOADERAUTOINJECTOR_FILES + Loader/Loader.cpp + Loader/Loader.h + xinput1_3/xinput1_3.cpp + xinput1_3/xinput1_3.def + xinput1_3/xinput1_3_asm.asm +) + + +add_library(${PROJECT_NAME} SHARED ${LOADERAUTOINJECTOR_FILES}) + +# change output name from LoaderAutoInjector to xinput1_3 +set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME xinput1_3) + +# definitions +target_compile_definitions(${PROJECT_NAME} PRIVATE LOADERAUTOINJECTOR_EXPORTS _UNICODE) # work-around, 'LoaderAutoInjector_EXPORTS' should be used in source code +target_compile_definitions(${PROJECT_NAME} PUBLIC _USRDLL _CRT_SECURE_NO_WARNINGS) + +# includes +target_include_directories(${PROJECT_NAME} PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/../UnrealEngineModLoader + ${CMAKE_CURRENT_SOURCE_DIR} +) + +# install +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION $/Binaries/Win64 +) + +install(FILES $ DESTINATION $/Binaries/Win64 OPTIONAL) diff --git a/UnrealEngineModLauncher/CMakeLists.txt b/UnrealEngineModLauncher/CMakeLists.txt new file mode 100644 index 00000000..4191f5ad --- /dev/null +++ b/UnrealEngineModLauncher/CMakeLists.txt @@ -0,0 +1,14 @@ +project(UnrealEngineModLauncher) + +add_executable(${PROJECT_NAME} resource.h UnrealEngineModLauncher.cpp u4mdl_logo_ZfM_icon.ico) +target_sources(${PROJECT_NAME} PRIVATE UnrealEngineModLauncher.rc) + +# definitions +target_compile_definitions(${PROJECT_NAME} PRIVATE _UNICODE) + +# install +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION $/Binaries/Win64 +) + +install(FILES $ DESTINATION $/Binaries/Win64 OPTIONAL) diff --git a/UnrealEngineModLoader/CMakeLists.txt b/UnrealEngineModLoader/CMakeLists.txt new file mode 100644 index 00000000..4b8238ea --- /dev/null +++ b/UnrealEngineModLoader/CMakeLists.txt @@ -0,0 +1,88 @@ +project(UnrealEngineModLoader) + +set(IMGUI_FILES + ImGui/imconfig.h + ImGui/imgui.cpp + ImGui/imgui.h + ImGui/imgui_demo.cpp + ImGui/imgui_draw.cpp + ImGui/imgui_impl_dx11.cpp + ImGui/imgui_impl_dx11.h + ImGui/imgui_impl_win32.cpp + ImGui/imgui_impl_win32.h + ImGui/imgui_internal.h + ImGui/imgui_tables.cpp + ImGui/imgui_widgets.cpp + ImGui/imstb_rectpack.h + ImGui/imstb_textedit.h + ImGui/imstb_truetype.h +) + +set(INI_FILES + INI/INI.h +) + +set(MINHOOK_FILES + MinHook/include/MinHook.h +) + +set(UE4_FILES + UE4/Basic.cpp + UE4/Basic.hpp + UE4/CoreUObject_classes.hpp + UE4/CoreUObject_functions.cpp + UE4/CoreUObject_parameters.hpp + UE4/CoreUObject_structs.hpp + UE4/Ue4.hpp +) + +set(UNREALENGINEMODLOADER_FILES + EventSystem.h + Hooks.cpp + Hooks.h + LoaderUI.cpp + LoaderUI.h + PakLoader.cpp + PakLoader.h + UMLDefs.h + UnrealEngineModLoader/GameInfo/GameInfo.cpp + UnrealEngineModLoader/GameInfo/GameInfo.h + UnrealEngineModLoader/Memory/CoreModLoader.cpp + UnrealEngineModLoader/Memory/CoreModLoader.h + UnrealEngineModLoader/Memory/mem.cpp + UnrealEngineModLoader/Memory/mem.h + UnrealEngineModLoader/Mod/Mod.cpp + UnrealEngineModLoader/Mod/Mod.h + UnrealEngineModLoader/Utilities/Dumper.cpp + UnrealEngineModLoader/Utilities/Dumper.h + UnrealEngineModLoader/Utilities/EngineDefFinder.cpp + UnrealEngineModLoader/Utilities/EngineDefFinder.h + UnrealEngineModLoader/Utilities/Globals.cpp + UnrealEngineModLoader/Utilities/Globals.h + UnrealEngineModLoader/Utilities/Logger.cpp + UnrealEngineModLoader/Utilities/Logger.h + UnrealEngineModLoader/Utilities/MinHook.h + UnrealEngineModLoader/Utilities/Pattern.h + UnrealEngineModLoader/Utilities/Version.h + UnrealEngineModLoader/dllmain.cpp +) + + +add_library(${PROJECT_NAME} SHARED ${IMGUI_FILES} ${INI_FILES} ${MINHOOK_FILES} ${UE4_FILES} ${UNREALENGINEMODLOADER_FILES}) + +# definitions +target_compile_definitions(${PROJECT_NAME} PRIVATE UNREALENGINEMODLOADER_EXPORTS _UNICODE) # work-around, 'UnrealEngineModLoader_EXPORTS' should be used in source code +target_compile_definitions(${PROJECT_NAME} PUBLIC _USRDLL _CRT_SECURE_NO_WARNINGS) + +target_include_directories(${PROJECT_NAME} PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/INI + ${CMAKE_CURRENT_SOURCE_DIR}/MinHook + ${CMAKE_CURRENT_SOURCE_DIR}/UE4 + ${CMAKE_CURRENT_SOURCE_DIR}/ + ${CMAKE_CURRENT_SOURCE_DIR}/UnrealEngineModLoader +) + +target_link_directories(${PROJECT_NAME} PUBLIC MinHook/lib) +target_link_libraries(${PROJECT_NAME} libMinHook-x64-v141-mtd) + +# TODO: install