diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index 0e35a5c..0000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "label": "curly-eureka: configure", - "type": "shell", - "command": "cmake -B out -A win32", - "problemMatcher": [] - }, - { - "label": "curly-eureka: build", - "type": "shell", - "command": "cmake --build out --config Release", - "problemMatcher": [] - } - ] -} \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index c7ce988..cc82bd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,20 +3,22 @@ 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(version "v1.2.1") set(description "load dlls in all ur game directory") -set(repository "https://github.com/user95401/ONEMR_Loader") -set(issues_url "https://discord.gg/89VGJH6QQg") -set(issues_info "U can write about it on user666's discord...") -set(LIBRARY_OUTPUT_PATH "D:\\Games\\user666\\Geometry Dash 2.2 [modloader, unlock mod, steam crack]\\") # dll output -set(GEODE_MOD_OUTPUT_PATH "D:\\Games\\user666\\Geometry.Dash.v07.24.2021\\geode\\mods") # geode mod output +set(lib_output "D:/Games/user666/2.2 PC GDPS but actually that is lol/") # post build copy #curly-eureka -include("C:\\Users\\Lenovo\\source\\curly-eureka\\CURLY-EUREKA-INCL.cmake") +set(GAME_VERSION "2.200") +include("C:\\Users\\Lenovo\\source\\curly-eureka\\CURLY-EUREKA-INCL.cmake")# "\" must be escaped by \\ + +#version +set(FILEVERSION "1, 2, 2, 0") +set(LegalCopyright "user666's original") +configure_file("Version.rc" "../../../src/Version.rc") #mod file(GLOB_RECURSE SRC @@ -24,13 +26,14 @@ src/* ) add_library(${PROJECT_NAME} SHARED ${SRC} ${CURLY_EUREKA_SRC}) -#geode-makeup -add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/geode geode-build) +#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}/ONEMR_Loader.dll) #can be deleted so escape "not found" +if(EXISTS ${LIBRARY_OUTPUT_PATH}/${PROJECT_NAME}.dll) #can be deleted so escape "not found" #ONEMR_Loader - file(COPY ${LIBRARY_OUTPUT_PATH}/ONEMR_Loader.dll + 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 @@ -41,10 +44,9 @@ if(EXISTS ${LIBRARY_OUTPUT_PATH}/ONEMR_Loader.dll) #can be deleted so escape "no file(ARCHIVE_CREATE OUTPUT "${CMAKE_CURRENT_LIST_DIR}/${PROJECT_NAME}_dist.zip" PATHS - ${CMAKE_CURRENT_BINARY_DIR}/copy.to.game.folder/ONEMR_Loader.dll + ${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 - ${CMAKE_CURRENT_BINARY_DIR}/about.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/CMakePostBuild.bat b/CMakePostBuild.bat new file mode 100644 index 0000000..17fd82e --- /dev/null +++ b/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.dll b/ONEMR_Loader.dll new file mode 100644 index 0000000..dcdcac5 Binary files /dev/null and b/ONEMR_Loader.dll differ diff --git a/ONEMR_Loader_dist.zip b/ONEMR_Loader_dist.zip index 284e440..d399e56 100644 Binary files a/ONEMR_Loader_dist.zip and b/ONEMR_Loader_dist.zip differ diff --git a/Version.rc b/Version.rc new file mode 100644 index 0000000..a0c9599 --- /dev/null +++ b/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/geode/CMakeLists.txt b/geode/CMakeLists.txt deleted file mode 100644 index eeec94a..0000000 --- a/geode/CMakeLists.txt +++ /dev/null @@ -1,77 +0,0 @@ -cmake_minimum_required(VERSION 3.10.0) - -# remove old files -file(REMOVE -${CMAKE_CURRENT_BINARY_DIR}/../mod.json -${CMAKE_CURRENT_BINARY_DIR}/../about.md -${CMAKE_CURRENT_BINARY_DIR}/../changelog.md -${CMAKE_CURRENT_BINARY_DIR}/../support.md -${CMAKE_CURRENT_BINARY_DIR}/../logo.png -${CMAKE_CURRENT_BINARY_DIR}/../${developer}.${PROJECT_NAME}.dll -) - -# remove old Resources folder -file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/../Resources) - -#configure mod.json - requried by geode -configure_file(mod.json ${CMAKE_CURRENT_BINARY_DIR}/../mod.json) - -#configure about.md -if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/about.md) #can be deleted so escape "not found" - set(about ${CMAKE_CURRENT_BINARY_DIR}/../about.md) - configure_file(about.md ${about}) -endif() - -#configure changelog.md -if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/changelog.md) #can be deleted so escape "not found" - set(changelog ${CMAKE_CURRENT_BINARY_DIR}/../changelog.md) - configure_file(changelog.md ${changelog}) -endif() - -#configure support.md -if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/support.md) #can be deleted so escape "not found" - set(support ${CMAKE_CURRENT_BINARY_DIR}/../support.md) - configure_file(support.md ${support}) -endif() - -#configure logo.png -if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/logo.png) #can be deleted so escape "not found" - set(logo ${CMAKE_CURRENT_BINARY_DIR}/../logo.png) - configure_file(logo.png ${logo}) - file(COPY - ${CMAKE_CURRENT_LIST_DIR}/logo.png - DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../) -endif() - -if(EXISTS ${LIBRARY_OUTPUT_PATH}/${PROJECT_NAME}.dll) - file(COPY - ${LIBRARY_OUTPUT_PATH}/${PROJECT_NAME}.dll - DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../) - - if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/Resources) #can be deleted so escape "not found" - file(COPY Resources DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../) - set(Resources "Resources") - endif() - - file(COPY ${LIBRARY_OUTPUT_PATH}/${PROJECT_NAME}.dll DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../) - file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/../${PROJECT_NAME}.dll ${CMAKE_CURRENT_BINARY_DIR}/../${developer}.${PROJECT_NAME}.dll) - - file(ARCHIVE_CREATE - OUTPUT "${CMAKE_CURRENT_LIST_DIR}/release/${developer}.${PROJECT_NAME}.geode" - PATHS - ${CMAKE_CURRENT_BINARY_DIR}/../mod.json - ${about} - ${changelog} - ${support} - ${logo} - ${Resources} - ${developer}.${PROJECT_NAME}.dll - FORMAT "zip") - - file(COPY "${CMAKE_CURRENT_LIST_DIR}/release/${developer}.${PROJECT_NAME}.geode" DESTINATION - ${GEODE_MOD_OUTPUT_PATH}) - - message("geode makeup done: see at ${GEODE_MOD_OUTPUT_PATH} or ${CMAKE_CURRENT_LIST_DIR}/release/${developer}.${PROJECT_NAME}.geode") -else() - message("geode makeup failed: ${LIBRARY_OUTPUT_PATH}/${PROJECT_NAME}.dll isnt exists yet (build is first).") -endif() diff --git a/geode/Resources/Chilipizdrik.png b/geode/Resources/Chilipizdrik.png deleted file mode 100644 index c375f1c..0000000 Binary files a/geode/Resources/Chilipizdrik.png and /dev/null differ diff --git a/geode/about.md b/geode/about.md deleted file mode 100644 index fd7d8c8..0000000 --- a/geode/about.md +++ /dev/null @@ -1,17 +0,0 @@ -# ${PROJECT_NAME} by ${developer} - -${description} - -### Patch Exceptions: -> if contains word in dll root patch -- geode -- minhook -- MinHook - -## Converted for Geode ---- - -This is traditional mod that uses minhook, gd.h, cocos-haders! - -BUT! In general, this mod works, and IN MOST CASES IT is COMPATIBLE. -- Made with curly-eureka diff --git a/geode/logo.png b/geode/logo.png deleted file mode 100644 index b9bff98..0000000 Binary files a/geode/logo.png and /dev/null differ diff --git a/geode/mod.json b/geode/mod.json deleted file mode 100644 index 72fdca7..0000000 --- a/geode/mod.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "geode": "1.0.0-beta.16", - "version": "${version}", - "id": "${developer}.${PROJECT_NAME}", - "name": "${PROJECT_NAME}", - "developer": "${developer}", - "description": "${description}", - "repository": "${repository}", - "early-load": true, - "issues": { - "url": "${issues_url}", - "info": "${issues_info}" - } -} \ No newline at end of file diff --git a/geode/release/user95401.ONEMR_Loader.geode b/geode/release/user95401.ONEMR_Loader.geode deleted file mode 100644 index 7484ede..0000000 Binary files a/geode/release/user95401.ONEMR_Loader.geode and /dev/null differ diff --git a/src/_main.cpp b/src/_main.cpp index ed35f5d..0cfb70b 100644 --- a/src/_main.cpp +++ b/src/_main.cpp @@ -1,5 +1,6 @@ #include "ModUtils.hpp" #include "HooksUtils.hpp" +#include using namespace cocos2d; using namespace gd; @@ -22,7 +23,7 @@ DWORD WINAPI LoadMods(void* hModule) { if (strstr(entry.path().string().c_str(), "msvcr")) loadit = false;//msvcr if (GetModuleHandleA(entry.path().string().c_str())) loadit = false; if (loadit) { - Sleep(10); + //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 { @@ -38,6 +39,16 @@ DWORD WINAPI LoadMods(void* hModule) { //0x272390 void __fastcall LoadingLayer_loadAssets(CCLayer* self, void* edx) { MappedHooks::getOriginal(LoadingLayer_loadAssets)(self, edx); + if (!CCFileUtils::sharedFileUtils()->isFileExist("ONEMR_Loader.NoInfo") && !CCFileUtils::sharedFileUtils()->isFileExist("ONEMR_Loader.AddInfo")) { + if (MessageBoxExA(nullptr, "Enable showing info?", "ONEMR_Loader", MB_ICONQUESTION | MB_YESNO, LANG_ENGLISH) == IDYES) { + std::remove("ONEMR_Loader.NoInfo"); + std::ofstream("ONEMR_Loader.AddInfo"); + } + else { + std::ofstream("ONEMR_Loader.NoInfo"); + std::remove("ONEMR_Loader.AddInfo"); + } + } if (CCFileUtils::sharedFileUtils()->isFileExist("ONEMR_Loader.NoInfo")) return self->removeChildByTag(938); afterLoad = true; self->removeChildByTag(938); @@ -49,7 +60,8 @@ void __fastcall LoadingLayer_loadAssets(CCLayer* self, void* edx) { ModsCountLabel->setHorizontalAlignment(CCTextAlignment::kCCTextAlignmentLeft); ModsCountLabel->setAnchorPoint({-0.01f, -0.1f}); ModsCountLabel->setScale(0.4f); - //ModsCountLabel->setOpacity(28); + ModsCountLabel->setOpacity(68); + ModsCountLabel->setBlendFunc({ GL_SRC_ALPHA, GL_ONE }/*that is additive blend*/); ModsCountLabel->runAction(CCFadeTo::create(0.1f, 32));//wow gd 2.2 have do smth with opacity stuff self->addChild(ModsCountLabel, 10, 938);/**/ } @@ -70,27 +82,11 @@ void __fastcall LoadingLayer_loadAssets(CCLayer* self, void* edx) { // return true; //} -DWORD WINAPI PROCESS_ATTACH(void* hModule) { - MH_Initialize(); - MappedHooks::registerHook(base + 2565008, LoadingLayer_loadAssets); - //MappedHooks::registerHook(base + 0x276700, MenuLayer_init); - LoadMods(hModule); - if (!CCFileUtils::sharedFileUtils()->isFileExist("ONEMR_Loader.NoInfo") && !CCFileUtils::sharedFileUtils()->isFileExist("ONEMR_Loader.AddInfo")) { - if (MessageBoxExA(nullptr, "Enable showing info?", "ONEMR_Loader", MB_ICONQUESTION | MB_YESNO, LANG_ENGLISH) == IDYES) { - std::remove("ONEMR_Loader.NoInfo"); - std::ofstream("ONEMR_Loader.AddInfo"); - } - else { - std::ofstream("ONEMR_Loader.NoInfo"); - std::remove("ONEMR_Loader.AddInfo"); - } - } - return 0; -} - BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { if (ul_reason_for_call == DLL_PROCESS_ATTACH) { - CreateThread(0, 0, PROCESS_ATTACH, hModule, 0, 0); + LoadMods(hModule); + MH_Initialize(); + MappedHooks::registerHook(base + 2565008, LoadingLayer_loadAssets); } return TRUE; } diff --git a/src/version.rc b/src/version.rc index b29a507..e46d595 100644 Binary files a/src/version.rc and b/src/version.rc differ