From cb94d18dd1235d2cc7a7216fe14f223e5c4cbda4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=CD=85=CD=88=CC=A4=CC=96=CC=AA=CC=AA=CC=B1l=CC=AF=CC=AF?= =?UTF-8?q?=CC=AE=CC=BC=CD=8E=CC=AC=CD=9A=CC=B3=CC=A9=CC=96=CC=B2u=CC=9C?= =?UTF-8?q?=CC=BC=CD=89=CD=88=CC=A0b=CD=99=CC=AC=CC=98=CC=99=CC=B1=CC=97?= =?UTF-8?q?=CC=B2=CD=99b=CD=8D=CC=9E=CC=AC=CC=AC=CD=93=CC=BCl=CC=B0=CC=AA?= =?UTF-8?q?=CD=96=CC=AF=CC=BC=CC=9F=CD=85=CC=9F=CD=88=CC=96=CD=95=CC=9C?= =?UTF-8?q?=CC=B1=CC=9Cl=CC=BB=CC=97=CD=94=CC=9D=CC=AD=CC=B0=CD=9A=CD=87?= =?UTF-8?q?=CC=AF=CC=A5?= <34196146+blubbll@users.noreply.github.com> Date: Sat, 12 Oct 2019 23:18:14 +0200 Subject: [PATCH 1/2] store filename of modloader-dll in variable --- CubeModLauncher/main.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CubeModLauncher/main.cpp b/CubeModLauncher/main.cpp index 0a7c3fc..344b921 100644 --- a/CubeModLauncher/main.cpp +++ b/CubeModLauncher/main.cpp @@ -12,6 +12,7 @@ #define MODLOADER_CRC 0x39D18E98 char* CUBE_EXECUTABLE = "cubeworld.exe"; +char* MODLOADER_DLL = "CubeModLoader.dll"; using namespace std; @@ -65,19 +66,19 @@ int main(int argc, char** argv) { } //Inject our dll - if ( !FileExists("CubeModLoader.dll") ) { - printf("CubeModLoader.dll not found.\n"); + if ( !FileExists(MODLOADER_DLL) ) { + printf("%dll not found.\n", MODLOADER_DLL); return Bail(1); } - unsigned int loaderChecksum = crc32_file("CubeModLoader.dll"); + unsigned int loaderChecksum = crc32_file(MODLOADER_DLL); if (loaderChecksum != MODLOADER_CRC && !testMode) { - printf("CubeModLoader.dll is the wrong version (%08X)\n", loaderChecksum); + printf("%dll is the wrong version (%08X)\n", MODLOADER_DLL, loaderChecksum); return Bail(1); } if (testMode) { - printf("CubeModLoader.dll CRC: %08X\n", loaderChecksum); + printf("%dll CRC: %08X\n", MODLOADER_DLL, loaderChecksum); } Process process(CUBE_EXECUTABLE); @@ -91,7 +92,7 @@ int main(int argc, char** argv) { printf("%s was successfully started.\n\n", CUBE_EXECUTABLE); } - process.InjectDLL( std::string("CubeModLoader.dll") ); + process.InjectDLL( std::string(MODLOADER_DLL) ); // Need to give the loader some time to work // This is a horrible thing and probably will result in a race condition please help me From 2c3598aff1b668bcac49b4c249a3fd63eaaa5861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=CD=85=CD=88=CC=A4=CC=96=CC=AA=CC=AA=CC=B1l=CC=AF=CC=AF?= =?UTF-8?q?=CC=AE=CC=BC=CD=8E=CC=AC=CD=9A=CC=B3=CC=A9=CC=96=CC=B2u=CC=9C?= =?UTF-8?q?=CC=BC=CD=89=CD=88=CC=A0b=CD=99=CC=AC=CC=98=CC=99=CC=B1=CC=97?= =?UTF-8?q?=CC=B2=CD=99b=CD=8D=CC=9E=CC=AC=CC=AC=CD=93=CC=BCl=CC=B0=CC=AA?= =?UTF-8?q?=CD=96=CC=AF=CC=BC=CC=9F=CD=85=CC=9F=CD=88=CC=96=CD=95=CC=9C?= =?UTF-8?q?=CC=B1=CC=9Cl=CC=BB=CC=97=CD=94=CC=9D=CC=AD=CC=B0=CD=9A=CD=87?= =?UTF-8?q?=CC=AF=CC=A5?= <34196146+blubbll@users.noreply.github.com> Date: Sun, 13 Oct 2019 19:28:23 +0200 Subject: [PATCH 2/2] Use %s to display strings correctly --- CubeModLauncher/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CubeModLauncher/main.cpp b/CubeModLauncher/main.cpp index 344b921..c61f8d5 100644 --- a/CubeModLauncher/main.cpp +++ b/CubeModLauncher/main.cpp @@ -67,18 +67,18 @@ int main(int argc, char** argv) { //Inject our dll if ( !FileExists(MODLOADER_DLL) ) { - printf("%dll not found.\n", MODLOADER_DLL); + printf("%s not found.\n", MODLOADER_DLL); return Bail(1); } unsigned int loaderChecksum = crc32_file(MODLOADER_DLL); if (loaderChecksum != MODLOADER_CRC && !testMode) { - printf("%dll is the wrong version (%08X)\n", MODLOADER_DLL, loaderChecksum); + printf("%s is the wrong version (%08X)\n", MODLOADER_DLL, loaderChecksum); return Bail(1); } if (testMode) { - printf("%dll CRC: %08X\n", MODLOADER_DLL, loaderChecksum); + printf("%s CRC: %08X\n", MODLOADER_DLL, loaderChecksum); } Process process(CUBE_EXECUTABLE);