Merge pull request #6 from blubbll/patch-1
store filename of modloader-dll in variable
This commit is contained in:
commit
fe2c8b7a9d
|
@ -12,6 +12,7 @@
|
||||||
#define MODLOADER_CRC 0x39D18E98
|
#define MODLOADER_CRC 0x39D18E98
|
||||||
|
|
||||||
char* CUBE_EXECUTABLE = "cubeworld.exe";
|
char* CUBE_EXECUTABLE = "cubeworld.exe";
|
||||||
|
char* MODLOADER_DLL = "CubeModLoader.dll";
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
@ -65,19 +66,19 @@ int main(int argc, char** argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//Inject our dll
|
//Inject our dll
|
||||||
if ( !FileExists("CubeModLoader.dll") ) {
|
if ( !FileExists(MODLOADER_DLL) ) {
|
||||||
printf("CubeModLoader.dll not found.\n");
|
printf("%s not found.\n", MODLOADER_DLL);
|
||||||
return Bail(1);
|
return Bail(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int loaderChecksum = crc32_file("CubeModLoader.dll");
|
unsigned int loaderChecksum = crc32_file(MODLOADER_DLL);
|
||||||
if (loaderChecksum != MODLOADER_CRC && !testMode) {
|
if (loaderChecksum != MODLOADER_CRC && !testMode) {
|
||||||
printf("CubeModLoader.dll is the wrong version (%08X)\n", loaderChecksum);
|
printf("%s is the wrong version (%08X)\n", MODLOADER_DLL, loaderChecksum);
|
||||||
return Bail(1);
|
return Bail(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (testMode) {
|
if (testMode) {
|
||||||
printf("CubeModLoader.dll CRC: %08X\n", loaderChecksum);
|
printf("%s CRC: %08X\n", MODLOADER_DLL, loaderChecksum);
|
||||||
}
|
}
|
||||||
|
|
||||||
Process process(CUBE_EXECUTABLE);
|
Process process(CUBE_EXECUTABLE);
|
||||||
|
@ -91,7 +92,7 @@ int main(int argc, char** argv) {
|
||||||
printf("%s was successfully started.\n\n", CUBE_EXECUTABLE);
|
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
|
// 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
|
// This is a horrible thing and probably will result in a race condition please help me
|
||||||
|
|
Loading…
Reference in New Issue