diff --git a/UGP.gmx/UGP.project.gmx b/UGP.gmx/UGP.project.gmx index 3c42893..7a8e546 100644 --- a/UGP.gmx/UGP.project.gmx +++ b/UGP.gmx/UGP.project.gmx @@ -4,7 +4,7 @@ libeay32.dll libeay32.dll - C:\Users\User\Documents\git\UGP\UGP.gmx\\\datafiles\libeay32.dll + C:\Users\Li\Documents\git\UGP\UGP.gmx\\\datafiles\libeay32.dll -1 1207808 2 @@ -18,7 +18,7 @@ UGP.dll UGP.dll - C:\Users\User\Documents\git\UGP\UGP.gmx\\\datafiles\UGP.dll + C:\Users\Li\Documents\git\UGP\UGP.gmx\\\datafiles\UGP.dll -1 97280 2 @@ -32,7 +32,7 @@ ModuleDownloader.exe ModuleDownloader.exe - C:\Users\User\Documents\git\UGP\UGP.gmx\\\datafiles\ModuleDownloader.exe + C:\Users\Li\Documents\git\UGP\UGP.gmx\\\datafiles\ModuleDownloader.exe -1 2146816 2 diff --git a/UGP.gmx/datafiles/ModuleDownloader.exe b/UGP.gmx/datafiles/ModuleDownloader.exe index cb6940a..2429757 100644 Binary files a/UGP.gmx/datafiles/ModuleDownloader.exe and b/UGP.gmx/datafiles/ModuleDownloader.exe differ diff --git a/UGP.gmx/datafiles/UGP.dll b/UGP.gmx/datafiles/UGP.dll index 4fbc8c3..3a667f6 100644 Binary files a/UGP.gmx/datafiles/UGP.dll and b/UGP.gmx/datafiles/UGP.dll differ diff --git a/UGP.gmx/objects/obj_main.object.gmx b/UGP.gmx/objects/obj_main.object.gmx index 6ad9b8a..7d42fe5 100644 --- a/UGP.gmx/objects/obj_main.object.gmx +++ b/UGP.gmx/objects/obj_main.object.gmx @@ -91,6 +91,13 @@ global.MD5 = external_define("UGP.dll","MD5",dll_cdecl,ty_string,1,ty_string); global.setBinKey = external_define("UGP.dll","SetBinKey",dll_cdecl,ty_real,3,ty_string, ty_string, ty_string); global.generateGM6Key = external_define("UGP.dll","GenerateGM6Key",dll_cdecl,ty_string,1,ty_string); + +global.getAppDataFolder = external_define("UGP.dll","GetAppDataFolder",dll_cdecl,ty_string,0); +global.getLocalAppDataFolder = external_define("UGP.dll","GetLocalAppDataFolder",dll_cdecl,ty_string,0); + +global.APPDATA = external_call(global.getAppDataFolder); +global.LOCALAPPDATA = external_call(global.getLocalAppDataFolder); + global.download_exports = false; instance_create((room_width-(44/2))-10, (room_height-(44/2))-10, obj_mute); diff --git a/UGP.gmx/scripts/license_gm81.gml b/UGP.gmx/scripts/license_gm81.gml index f2552c0..760f7c2 100644 --- a/UGP.gmx/scripts/license_gm81.gml +++ b/UGP.gmx/scripts/license_gm81.gml @@ -9,7 +9,7 @@ key = argument1; if(argument2) { - dll_path = environment_get_variable("APPDATA")+"\GameMaker\libeay32.dll"; + dll_path = global.APPDATA+"\GameMaker\libeay32.dll"; if(file_exists(dll_path)) file_delete(dll_path); //export_include_file_location("libeay32.dll", dll_path); @@ -28,7 +28,7 @@ xmlData[0] = name; xmlData[1] = key; xmlData[2] = "GameMaker for Windows"; xmlData[3] = chr($0a)+chr($09)+'rvunnwPVsFRMqCuuQ0u3cifBmlwEdRNvZZW3G6gYYEb1/Qs4p3PTUPmewyVck8YrhLZA'+chr($0a)+chr($09)+'Dc70u0IEX03KrCwz8RsQLITCa4iDJ6bkn+PjtUQeGNAr3haNpmPw0/v/v9K6haLXMaVy'+chr($0a)+chr($09)+'4QbSG4+JX5uqefP12xCvJGMMI+dkHDEgOBk='+chr($0a)+chr($09); -plistPath = environment_get_variable("LOCALAPPDATA")+"\GameMaker8.1\license.plist"; +plistPath = global.LOCALAPPDATA+"\GameMaker8.1\license.plist"; plistFile = file_text_open_write(plistPath); //datetime_str = string_replace(string_format(current_day,2,0)," ","0")+"/"+string_replace(string_format(current_month,2,0)," ","0")+"/"+string(current_year mod 100); diff --git a/UGP.gmx/scripts/license_gmhtml5.gml b/UGP.gmx/scripts/license_gmhtml5.gml index 21ed045..66ec60e 100644 --- a/UGP.gmx/scripts/license_gmhtml5.gml +++ b/UGP.gmx/scripts/license_gmhtml5.gml @@ -9,7 +9,7 @@ key = argument1; if(argument2) { - dll_path = environment_get_variable("APPDATA")+"\GameMaker-HTML5\libeay32.dll"; + dll_path = global.APPDATA+"\GameMaker-HTML5\libeay32.dll"; if(file_exists(dll_path)) file_delete(dll_path); //export_include_file_location("libeay32.dll", dll_path); @@ -29,7 +29,7 @@ xmlData[0] = name; xmlData[1] = key; xmlData[2] = "GameMaker for HTML5"; xmlData[3] = chr($0a)+chr($09)+'rvunnwPVsFRMqCuuQ0u3cifBmlwEdRNvZZW3G6gYYEb1/Qs4p3PTUPmewyVck8YrhLZA'+chr($0a)+chr($09)+'Dc70u0IEX03KrCwz8RsQLITCa4iDJ6bkn+PjtUQeGNAr3haNpmPw0/v/v9K6haLXMaVy'+chr($0a)+chr($09)+'4QbSG4+JX5uqefP12xCvJGMMI+dkHDEgOBk='+chr($0a)+chr($09); -plistPath = environment_get_variable("LOCALAPPDATA")+"\GameMaker-HTML5\license.plist"; +plistPath = global.LOCALAPPDATA+"\GameMaker-HTML5\license.plist"; plistFile = file_text_open_write(plistPath); //datetime_str = string_replace(string_format(current_day,2,0)," ","0")+"/"+string_replace(string_format(current_month,2,0)," ","0")+"/"+string(current_year mod 100); diff --git a/UGP.gmx/scripts/license_studio.gml b/UGP.gmx/scripts/license_studio.gml index bcca1b4..b6a4c8a 100644 --- a/UGP.gmx/scripts/license_studio.gml +++ b/UGP.gmx/scripts/license_studio.gml @@ -21,7 +21,7 @@ old_version = argument8 if(do_libeay32) { - dll_path = environment_get_variable("APPDATA")+"\GameMaker-Studio\libeay32.dll"; + dll_path = global.APPDATA+"\GameMaker-Studio\libeay32.dll"; if(file_exists(dll_path)) file_delete(dll_path); //export_include_file_location("libeay32.dll", dll_path); @@ -73,7 +73,7 @@ xmlData[5] = key; xmlData[6] = "GameMaker:Studio"; xmlData[7] = chr($0a)+chr($09)+'rvunnwPVsFRMqCuuQ0u3cifBmlwEdRNvZZW3G6gYYEb1/Qs4p3PTUPmewyVck8YrhLZA'+chr($0a)+chr($09)+'Dc70u0IEX03KrCwz8RsQLITCa4iDJ6bkn+PjtUQeGNAr3haNpmPw0/v/v9K6haLXMaVy'+chr($0a)+chr($09)+'4QbSG4+JX5uqefP12xCvJGMMI+dkHDEgOBk='+chr($0a)+chr($09); -plistPath = environment_get_variable("LOCALAPPDATA")+"\GameMaker-Studio\license.plist"; +plistPath = global.LOCALAPPDATA+"\GameMaker-Studio\license.plist"; plistFile = file_text_open_write(plistPath); file_text_write_string(plistFile,''+chr($0a)); diff --git a/UGP.gmx/sound/snd_mus.sound.gmx b/UGP.gmx/sound/snd_mus.sound.gmx index 575fa12..fbd7333 100644 --- a/UGP.gmx/sound/snd_mus.sound.gmx +++ b/UGP.gmx/sound/snd_mus.sound.gmx @@ -2,7 +2,7 @@ 1 .mid - C:\Users\User\Documents\git\UGP\UGP.gmx\\\sound\audio\snd_mus.mid + C:\Users\Li\Documents\git\UGP\UGP.gmx\\\sound\audio\snd_mus.mid 0 1 0 diff --git a/Visual Studio Projects/UniversalGameMakerPatcher.dll/Test/Test.cpp b/Visual Studio Projects/UniversalGameMakerPatcher.dll/Test/Test.cpp index 16e83b9..abe0b3d 100644 --- a/Visual Studio Projects/UniversalGameMakerPatcher.dll/Test/Test.cpp +++ b/Visual Studio Projects/UniversalGameMakerPatcher.dll/Test/Test.cpp @@ -3,6 +3,8 @@ #include #include +#include +#include char* GetMachineGuid() { @@ -19,7 +21,12 @@ char* GetMachineGuid() int main() { - printf("Hello World!"); + char szPath[MAX_PATH]; + + SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA, NULL, 0, szPath); + printf("local %s\n", szPath); + SHGetFolderPathA(NULL, CSIDL_APPDATA, NULL, 0, szPath); + printf("common %s\n", szPath); GetMachineGuid(); } diff --git a/Visual Studio Projects/UniversalGameMakerPatcher.dll/Test/Test.vcxproj b/Visual Studio Projects/UniversalGameMakerPatcher.dll/Test/Test.vcxproj index bf881f5..7fc2317 100644 --- a/Visual Studio Projects/UniversalGameMakerPatcher.dll/Test/Test.vcxproj +++ b/Visual Studio Projects/UniversalGameMakerPatcher.dll/Test/Test.vcxproj @@ -42,7 +42,7 @@ Application true - v143 + v141_xp Unicode diff --git a/Visual Studio Projects/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll.sln b/Visual Studio Projects/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll.sln index 2b4622c..d756859 100644 --- a/Visual Studio Projects/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll.sln +++ b/Visual Studio Projects/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll.sln @@ -9,25 +9,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test", "Test\Test.vcxproj", EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 - Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F1AB918F-7AF0-4536-A779-286A3A709558}.Debug|x64.ActiveCfg = Debug|x64 - {F1AB918F-7AF0-4536-A779-286A3A709558}.Debug|x64.Build.0 = Debug|x64 {F1AB918F-7AF0-4536-A779-286A3A709558}.Debug|x86.ActiveCfg = Debug|Win32 {F1AB918F-7AF0-4536-A779-286A3A709558}.Debug|x86.Build.0 = Debug|Win32 - {F1AB918F-7AF0-4536-A779-286A3A709558}.Release|x64.ActiveCfg = Release|Win32 - {F1AB918F-7AF0-4536-A779-286A3A709558}.Release|x64.Build.0 = Release|Win32 {F1AB918F-7AF0-4536-A779-286A3A709558}.Release|x86.ActiveCfg = Release|Win32 {F1AB918F-7AF0-4536-A779-286A3A709558}.Release|x86.Build.0 = Release|Win32 - {3B3E009B-BCEF-4259-AAAC-B7CD9DEEFD86}.Debug|x64.ActiveCfg = Debug|x64 - {3B3E009B-BCEF-4259-AAAC-B7CD9DEEFD86}.Debug|x64.Build.0 = Debug|x64 {3B3E009B-BCEF-4259-AAAC-B7CD9DEEFD86}.Debug|x86.ActiveCfg = Debug|Win32 - {3B3E009B-BCEF-4259-AAAC-B7CD9DEEFD86}.Release|x64.ActiveCfg = Release|Win32 - {3B3E009B-BCEF-4259-AAAC-B7CD9DEEFD86}.Release|x64.Build.0 = Release|Win32 {3B3E009B-BCEF-4259-AAAC-B7CD9DEEFD86}.Release|x86.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution diff --git a/Visual Studio Projects/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll.vcxproj b/Visual Studio Projects/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll.vcxproj index b9a6b1d..b8f83bd 100644 --- a/Visual Studio Projects/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll.vcxproj +++ b/Visual Studio Projects/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll.vcxproj @@ -43,7 +43,7 @@ DynamicLibrary true - v143 + v141_xp Unicode @@ -92,8 +92,8 @@ Level3 - true - WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;UNIVERSALGAMEMAKERPATCHERDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + false + _CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;UNIVERSALGAMEMAKERPATCHERDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true NotUsing pch.h @@ -111,7 +111,7 @@ true true true - WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;UNIVERSALGAMEMAKERPATCHERDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;UNIVERSALGAMEMAKERPATCHERDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true NotUsing @@ -130,9 +130,9 @@ Level3 true - _DEBUG;UNIVERSALGAMEMAKERPATCHERDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;_DEBUG;UNIVERSALGAMEMAKERPATCHERDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true - Use + NotUsing pch.h @@ -147,9 +147,9 @@ true true true - NDEBUG;UNIVERSALGAMEMAKERPATCHERDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;NDEBUG;UNIVERSALGAMEMAKERPATCHERDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true - Use + NotUsing pch.h diff --git a/Visual Studio Projects/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll.vcxproj.user b/Visual Studio Projects/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll.vcxproj.user deleted file mode 100644 index 6a9252f..0000000 --- a/Visual Studio Projects/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll.vcxproj.user +++ /dev/null @@ -1,13 +0,0 @@ - - - - WindowsLocalDebugger - C:\Users\User\Desktop\UGP\UGP\UGP.exe - C:\Users\User\Desktop\UGP\UGP - - - C:\Users\User\Desktop\UGP\UGP\UGP.exe - C:\Users\User\Desktop\UGP\UGP - WindowsLocalDebugger - - \ No newline at end of file diff --git a/Visual Studio Projects/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll/dllmain.c b/Visual Studio Projects/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll/dllmain.c index 9099eac..5080421 100644 --- a/Visual Studio Projects/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll/dllmain.c +++ b/Visual Studio Projects/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll/dllmain.c @@ -2,14 +2,32 @@ #include #include "md5.h" #include "gm6.h" +#include +#include #define GMSTR __declspec(dllexport) char* __cdecl #define GMREAL __declspec(dllexport) double __cdecl +static char appdata[MAX_PATH]; +static char appdatalocal[MAX_PATH]; static char md5str[33]; static BYTE guid[0x1028]; static char gm6key[31]; +GMSTR GetAppDataFolder(void) +{ + memset(appdata, 0, sizeof(appdata)); + SHGetFolderPathA(NULL, CSIDL_APPDATA, NULL, 0, appdata); + return appdata; +} + +GMSTR GetLocalAppDataFolder(void) +{ + memset(appdatalocal, 0, sizeof(appdatalocal)); + SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA, NULL, 0, appdatalocal); + return appdatalocal; +} + GMSTR GetMachineGuid(void) { HKEY hk; diff --git a/Visual Studio Projects/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll/gm6.h b/Visual Studio Projects/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll/gm6.h index 6505abd..444e37f 100644 --- a/Visual Studio Projects/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll/gm6.h +++ b/Visual Studio Projects/UniversalGameMakerPatcher.dll/UniversalGameMakerPatcher.dll/gm6.h @@ -4,7 +4,6 @@ #include #include - #define KEY_LEN (0xC) //#define STANDALONE 1