diff --git a/ONEMR_Loader-2.113/ONEMR_Loader.dll b/ONEMR_Loader-2.113/ONEMR_Loader.dll new file mode 100644 index 0000000..65039dd Binary files /dev/null and b/ONEMR_Loader-2.113/ONEMR_Loader.dll differ diff --git a/ONEMR_Loader-2.113/ONEMR_Loader_dist.zip b/ONEMR_Loader-2.113/ONEMR_Loader_dist.zip new file mode 100644 index 0000000..93a447a Binary files /dev/null and b/ONEMR_Loader-2.113/ONEMR_Loader_dist.zip differ diff --git a/ONEMR_Loader-2.113/src/Version.rc b/ONEMR_Loader-2.113/src/Version.rc new file mode 100644 index 0000000..5d31204 --- /dev/null +++ b/ONEMR_Loader-2.113/src/Version.rc @@ -0,0 +1,23 @@ +1 VERSIONINFO +FILEVERSION 1, 3, 0, 0 +PRODUCTVERSION 1, 3, 0, 0 +FILEOS 0x40004 +FILETYPE 0x2 +{ + BLOCK "StringFileInfo" + { + BLOCK "040904B0" + { + VALUE "ProductName", "ONEMR_Loader" + VALUE "CompanyName", "user95401" + VALUE "LegalCopyright", "user666's original" + VALUE "FileDescription", "gd 2.1 mod that load dlls in all ur game directory" + VALUE "OriginalFilename", "ONEMR_Loader.dll" + } + } + + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x0409 0x04B0 + } +} diff --git a/ONEMR_Loader-2.200/ONEMR_Loader.dll b/ONEMR_Loader-2.200/ONEMR_Loader.dll new file mode 100644 index 0000000..404f851 Binary files /dev/null and b/ONEMR_Loader-2.200/ONEMR_Loader.dll differ diff --git a/ONEMR_Loader-2.200/ONEMR_Loader_dist.zip b/ONEMR_Loader-2.200/ONEMR_Loader_dist.zip new file mode 100644 index 0000000..874a4b7 Binary files /dev/null and b/ONEMR_Loader-2.200/ONEMR_Loader_dist.zip differ diff --git a/ONEMR_Loader-2.200/src/Version.rc b/ONEMR_Loader-2.200/src/Version.rc new file mode 100644 index 0000000..846ee4d --- /dev/null +++ b/ONEMR_Loader-2.200/src/Version.rc @@ -0,0 +1,23 @@ +1 VERSIONINFO +FILEVERSION 1, 3, 0, 0 +PRODUCTVERSION 1, 3, 0, 0 +FILEOS 0x40004 +FILETYPE 0x2 +{ + BLOCK "StringFileInfo" + { + BLOCK "040904B0" + { + VALUE "ProductName", "ONEMR_Loader" + VALUE "CompanyName", "user95401" + VALUE "LegalCopyright", "user666's original" + VALUE "FileDescription", "gd 2.2 mod that load dlls in all ur game directory" + VALUE "OriginalFilename", "ONEMR_Loader.dll" + } + } + + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x0409 0x04B0 + } +} diff --git a/ONEMR_Loader-Universal/CMakeLists.txt b/ONEMR_Loader-Universal/CMakeLists.txt new file mode 100644 index 0000000..8e16e7a --- /dev/null +++ b/ONEMR_Loader-Universal/CMakeLists.txt @@ -0,0 +1,52 @@ +cmake_minimum_required(VERSION 3.10.0) +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO") +set(LIBRARY_OUTPUT_PATH "${CMAKE_CURRENT_LIST_DIR}") +cmake_policy(SET CMP0057 NEW) + +project ("ONEMR_Loader") +set(developer "user95401") +set(description "gd 2.2 mod that load dlls in all ur game directory") +set(lib_output "D:\\Games\\user666\\Geometry Dash 2.202") # post build copy + +#curly-eureka +set(GAME_VERSION "2.2") +include("C:\\Users\\Lenovo\\source\\curly-eureka\\CURLY-EUREKA-INCL.cmake")# "\" must be escaped by \\ + +#version +set(FILEVERSION "1, 3, 0, 0") +set(LegalCopyright "user666's original") +configure_file("Version.rc" "../../../src/Version.rc") + +#mod +file(GLOB_RECURSE SRC +src/* +) +add_library(${PROJECT_NAME} SHARED ${SRC} ${CURLY_EUREKA_SRC}) + +#POST_BUILD +add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND #POST_BUILD UPDATE USES POWERSHELL! +"${CMAKE_CURRENT_LIST_DIR}/CMakePostBuild.bat" ${developer} ${PROJECT_NAME} ${LIBRARY_OUTPUT_PATH} ${lib_output}) + +#libcurl distributing zip makeup +if(EXISTS ${LIBRARY_OUTPUT_PATH}/${PROJECT_NAME}.dll) #can be deleted so escape "not found" + #ONEMR_Loader + file(COPY ${LIBRARY_OUTPUT_PATH}/${PROJECT_NAME}.dll + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/copy.to.game.folder/) + #libcurl + file(COPY ${CMAKE_CURRENT_LIST_DIR}/libcurl.dll + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/copy.to.game.folder/) + #libcurldist_readme + configure_file(${CMAKE_CURRENT_LIST_DIR}/libcurldist_readme.md ${CMAKE_CURRENT_BINARY_DIR}/libcurldist_readme.md) + #ARCHIVE_CREATE + file(ARCHIVE_CREATE + OUTPUT "${CMAKE_CURRENT_LIST_DIR}/${PROJECT_NAME}_dist.zip" + PATHS + ${CMAKE_CURRENT_BINARY_DIR}/copy.to.game.folder/${PROJECT_NAME}.dll + ${CMAKE_CURRENT_BINARY_DIR}/copy.to.game.folder/libcurl.dll + ${CMAKE_CURRENT_BINARY_DIR}/libcurldist_readme.md + FORMAT "zip") + message("${PROJECT_NAME}_dist makeup done: see at ${CMAKE_CURRENT_LIST_DIR}/${PROJECT_NAME}_dist.zip") +endif() \ No newline at end of file diff --git a/ONEMR_Loader-Universal/CMakePostBuild.bat b/ONEMR_Loader-Universal/CMakePostBuild.bat new file mode 100644 index 0000000..17fd82e --- /dev/null +++ b/ONEMR_Loader-Universal/CMakePostBuild.bat @@ -0,0 +1,27 @@ +::Msg "%username%" developer: %1, PROJECT_NAME: %2, LIBRARY_OUTPUT_PATH: %3, lib_output: %4 + +@echo POST_BUILD_PART + +@set "$Title=Built mod install" +@set "$Message=Done: " + +@echo "working at LIBRARY_OUTPUT_PATH: %3" +@cd "%3" + +@echo "remove minhook built static lib because who needs it even" +@if exist "minhook.x32.lib" del "minhook.x32.lib" + +@echo "copy dll to game: %2.dll => %4" +@if not exist "%2.dll" set "$Message=Can´t found %3/%2.dll to copy dll!" +if exist "%2.dll" copy "%2.dll" %4 + +::BEEEp if smth wrong +@if not "%$Message%" == "Done: " rundll32 user32.dll,MessageBeep +::add warn emoji +@if not "%$Message%" == "Done: " set "$Title=⚠️ Failed to %$Title%" + +@if "%$Message%" == "Done: " set "$Message=%$Message%%4" + +::push notify +@powershell -Command "& {Add-Type -AssemblyName System.Windows.Forms; Add-Type -AssemblyName System.Drawing; $notify = New-Object System.Windows.Forms.NotifyIcon; $notify.Icon = [System.Drawing.SystemIcons]::Information; $notify.Visible = $true; $notify.ShowBalloonTip(0, '%$Title%', '%$Message%', [System.Windows.Forms.ToolTipIcon]::None)}" +@echo [%$Title%]: %$Message% \ No newline at end of file diff --git a/ONEMR_Loader-Universal/CMakeSettings.json b/ONEMR_Loader-Universal/CMakeSettings.json new file mode 100644 index 0000000..18cb380 --- /dev/null +++ b/ONEMR_Loader-Universal/CMakeSettings.json @@ -0,0 +1,15 @@ +{ + "configurations": [ + { + "name": "x86-Release", + "generator": "Ninja", + "configurationType": "Release", + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "", + "ctestCommandArgs": "", + "inheritEnvironments": [ "msvc_x86" ] + } + ] +} \ No newline at end of file diff --git a/ONEMR_Loader-Universal/ONEMR_Loader_dist.zip b/ONEMR_Loader-Universal/ONEMR_Loader_dist.zip new file mode 100644 index 0000000..2db0f3a Binary files /dev/null and b/ONEMR_Loader-Universal/ONEMR_Loader_dist.zip differ diff --git a/ONEMR_Loader-Universal/Version.rc b/ONEMR_Loader-Universal/Version.rc new file mode 100644 index 0000000..a0c9599 --- /dev/null +++ b/ONEMR_Loader-Universal/Version.rc @@ -0,0 +1,23 @@ +1 VERSIONINFO +FILEVERSION ${FILEVERSION} +PRODUCTVERSION ${FILEVERSION} +FILEOS 0x40004 +FILETYPE 0x2 +{ + BLOCK "StringFileInfo" + { + BLOCK "040904B0" + { + VALUE "ProductName", "${PROJECT_NAME}" + VALUE "CompanyName", "${developer}" + VALUE "LegalCopyright", "${LegalCopyright}" + VALUE "FileDescription", "${description}" + VALUE "OriginalFilename", "${PROJECT_NAME}.dll" + } + } + + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x0409 0x04B0 + } +} \ No newline at end of file diff --git a/ONEMR_Loader-Universal/imgui-hook.lib b/ONEMR_Loader-Universal/imgui-hook.lib new file mode 100644 index 0000000..cc5d4d6 Binary files /dev/null and b/ONEMR_Loader-Universal/imgui-hook.lib differ diff --git a/ONEMR_Loader-Universal/libcurl.dll b/ONEMR_Loader-Universal/libcurl.dll new file mode 100644 index 0000000..1dffb49 Binary files /dev/null and b/ONEMR_Loader-Universal/libcurl.dll differ diff --git a/ONEMR_Loader-Universal/libcurldist_readme.md b/ONEMR_Loader-Universal/libcurldist_readme.md new file mode 100644 index 0000000..1ad0ee8 --- /dev/null +++ b/ONEMR_Loader-Universal/libcurldist_readme.md @@ -0,0 +1,6 @@ +# libcurldist +made for installing mod loader to a clear game + +libcurl.dll is file that game loading: +1. game loading libcurl.dll +2. libcurl.dll loading ONEMR_Loader.dll \ No newline at end of file diff --git a/ONEMR_Loader-Universal/src/Version.rc b/ONEMR_Loader-Universal/src/Version.rc new file mode 100644 index 0000000..846ee4d --- /dev/null +++ b/ONEMR_Loader-Universal/src/Version.rc @@ -0,0 +1,23 @@ +1 VERSIONINFO +FILEVERSION 1, 3, 0, 0 +PRODUCTVERSION 1, 3, 0, 0 +FILEOS 0x40004 +FILETYPE 0x2 +{ + BLOCK "StringFileInfo" + { + BLOCK "040904B0" + { + VALUE "ProductName", "ONEMR_Loader" + VALUE "CompanyName", "user95401" + VALUE "LegalCopyright", "user666's original" + VALUE "FileDescription", "gd 2.2 mod that load dlls in all ur game directory" + VALUE "OriginalFilename", "ONEMR_Loader.dll" + } + } + + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x0409 0x04B0 + } +} diff --git a/ONEMR_Loader-Universal/src/_main.cpp b/ONEMR_Loader-Universal/src/_main.cpp new file mode 100644 index 0000000..4dab235 --- /dev/null +++ b/ONEMR_Loader-Universal/src/_main.cpp @@ -0,0 +1,198 @@ +#include "ModUtils.hpp" +#include "HooksUtils.hpp" + +using namespace cocos2d; +using namespace gd; + +#include +#include + +#include + +int ModsLoaded = 0; +std::string ModsLoadedList = ""; +bool afterLoad = false; + +void CreateInfoSettingFile(bool AddInfo) { + std::string fileinfo = ( + "u can delete that file, so message box with confirm appears again" "\n" + "if exists ONEMR_Loader.NoInfo => dont show loaded mods info in corner" "\n" + "if exists ONEMR_Loader.AddInfo => dont show confirm message box" + ); + if (AddInfo) { + std::remove("ONEMR_Loader.NoInfo"); + std::ofstream("ONEMR_Loader.AddInfo") << fileinfo; + } + else { + std::remove("ONEMR_Loader.AddInfo"); + std::ofstream("ONEMR_Loader.NoInfo") << fileinfo; + } +} + +namespace ImGuiMod { + + bool Hiden; + void HideUI() { + Hiden = true; + }; + + namespace ModsLoadedText { + + bool Hiden; + void Show() { + Hiden = false; + }; + void Hide() { + Hiden = true; + }; + + int DelayedHideMs; + int FadeOutRate; + ImColor FadeOutCol; + void FadeOutAnim() { + /// + /// SSSSSSSSSUUUCKKS + /// + //ImGuiStyle* Style = &ImGui::GetStyle(); + for (int io = 255; io > -1; io = io - FadeOutRate) { + Sleep(1); + FadeOutCol = ImColor(255, 255, 255, io); + } + FadeOutCol = ImColor(255, 255, 255, 0); + } + DWORD WINAPI FadeOutInitThread(void* hModule) { + Sleep(DelayedHideMs); + FadeOutAnim(); + return S_OK; + } + void FadeOut(int Delay, int Rate, void* hModule) { + DelayedHideMs = Delay; + FadeOutRate = Rate; + CreateThread(nullptr, 0, FadeOutInitThread, hModule, 0, nullptr); + }; + + void RenderIt() { + if (Hiden) return; + ImGuiIO& io = ImGui::GetIO(); + ImGui::SetNextWindowPos(ImVec2(0, io.DisplaySize.y), ImGuiCond_Always, ImVec2(0.0f, 1.0f)); + ImGui::Begin("BottomRightText", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoBringToFrontOnFocus); + if(!FadeOutCol) FadeOutCol = ImColor(255, 255, 255, 255); + ImGui::PushStyleColor(ImGuiCol_Text, FadeOutCol.Value); + ImGui::Text(std::format("{}: {} libs loaded\n{}", ModUtils::GetModName(), ModsLoaded, ModsLoadedList).c_str()); + ImGui::PopStyleColor(); + ImGui::End(); + }; + } + + namespace ShowInfoDialog { + + bool ShowPopup; + void Show() { + ShowPopup = true; + }; + + void RenderIt() { + + if (ShowPopup) { + ImGui::OpenPopup("Enable showing info?"); + ShowPopup = false; + } + + ImGui::PushStyleColor(ImGuiCol_::ImGuiCol_ModalWindowDimBg, ImColor(0,0,0,120).Value); + if (ImGui::BeginPopupModal( + "Enable showing info?", NULL, + ImGuiWindowFlags_::ImGuiWindowFlags_AlwaysAutoResize | + ImGuiWindowFlags_::ImGuiWindowFlags_NoMove + )) { + std::string info = ( + "Will creaded file:" "\n" + "ONEMR_Loader.AddInfo => don't show confirm message box" "\n" + "ONEMR_Loader.NoInfo => don't show loaded mods info in corner" + ); + ImGui::Text(info.c_str()); + + ImGui::Separator(); + + if (ImGui::Button("Yes", {80, 19})) { + CreateInfoSettingFile(true); + ImGui::CloseCurrentPopup(); + } + + ImGui::SameLine(); + + if (ImGui::Button("No", { 60, 19 })) { + CreateInfoSettingFile(false); + ImGui::CloseCurrentPopup(); + } + + ImGui::EndPopup(); + } + }; + + } + + void RenderUI() { + if (Hiden) return; + ModsLoadedText::RenderIt(); + ShowInfoDialog::RenderIt(); + } + + void Init() { + //setup + ImGuiHook::setRenderFunction(RenderUI); + //hooks + MH_Initialize(); + ImGuiHook::Load([](void* target, void* hook, void** trampoline) { + HooksUtils::CreateHook(target, hook, trampoline); + }); + } + +}; + +DWORD WINAPI LoadMods(void* hModule) { + //ModsLoadedText + if (CCFileUtils::sharedFileUtils()->isFileExist("ONEMR_Loader.NoInfo")) ImGuiMod::ModsLoadedText::Hide(); + else ImGuiMod::ModsLoadedText::FadeOut(5000, 10, hModule); + //ShowInfoDialog + if ( + !CCFileUtils::sharedFileUtils()->isFileExist("ONEMR_Loader.NoInfo") + && + !CCFileUtils::sharedFileUtils()->isFileExist("ONEMR_Loader.AddInfo") + ) + { + ImGuiMod::ShowInfoDialog::Show(); + } + ModUtils::log("Crawling..."); + for (const auto& entry : std::filesystem::recursive_directory_iterator(std::filesystem::current_path())) { + //ModUtils::log(entry.path().extension().string()); .dll + bool loadit = false; + if (entry.path().extension().string() == std::string(".dll")) loadit = true;//is dll + if (strstr(entry.path().string().c_str(), "geode")) loadit = false;//in geode/unzipped + if (strstr(entry.path().string().c_str(), "minhook")) loadit = false;//minhook + if (strstr(entry.path().string().c_str(), "MinHook")) loadit = false;//MinHook + if (strstr(entry.path().string().c_str(), "websockets.dll")) loadit = false;//websockets.dll + if (strstr(entry.path().string().c_str(), "msvcp")) loadit = false;//msvcp + if (strstr(entry.path().string().c_str(), "msvcr")) loadit = false;//msvcr + if (GetModuleHandleA(entry.path().string().c_str())) loadit = false; + if (loadit) { + //Sleep(10);justwhy + HMODULE hModule = LoadLibraryA(entry.path().string().c_str()); + if (!hModule) ModUtils::log("Failed to load library \"" + entry.path().relative_path().string() + "\" ."); + else { + ModUtils::log("Loaded library \"" + entry.path().relative_path().string() + "\"!"); + ++ModsLoaded; + ModsLoadedList = ModsLoadedList + ((ModsLoadedList == "" ? "" : ", ") + entry.path().filename().string()); + } + } + } + ModUtils::log("Loading libs reached end!"); + return S_OK; +} + +BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { + if (ul_reason_for_call == DLL_PROCESS_ATTACH) { + ImGuiMod::Init(); + LoadMods(hModule); + } + return TRUE; +}