Skip to content

Commit

Permalink
Update to 1.1.16
Browse files Browse the repository at this point in the history
* Fixed a critical security vulnerability related to Log4j ([CVE-2021-44228](https://nvd.nist.gov/vuln/detail/CVE-2021-44228)).
* Added handling of two new Minecraft arguments (clientId and xuid).
* Added handling of spaces in the path to the game directory.
  • Loading branch information
Kron4ek committed Dec 12, 2021
1 parent 3f9ccf5 commit 188dae7
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 14 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v1.1.16
* Fixed a critical security vulnerability related to Log4j ([CVE-2021-44228](https://nvd.nist.gov/vuln/detail/CVE-2021-44228)).
* Added handling of two new Minecraft arguments (clientId and xuid).
* Added handling of spaces in the path to the game directory.
---------------------------------------------------------------------
v1.1.15
* Fixed launching new Fabric versions.
---------------------------------------------------------------------
Expand Down
47 changes: 42 additions & 5 deletions vlauncher_linux.pb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ Define.i saveLaunchString, versionsTypeGadget, saveLaunchStringGadget, launchStr
Define.i argsTextGadget, javaBinaryPathTextGadget, downloadThreadsTextGadget, downloadAllFilesGadget
Define.i gadgetsWidth, gadgetsHeight, gadgetsIndent, windowWidth, windowHeight
Define.i listOfFiles, jsonFile, jsonObject, jsonObjectObjects, fileSize, jsonJarMember, jsonArgumentsArray, jsonArrayElement, inheritsJson, clientSize
Define.i releaseTimeMember, releaseTime, jsonJvmArray
Define.i releaseTimeMember, releaseTime, jsonJvmArray, loggingMember, loggingClientMember, loggingFileMember, logConfSize

Define.s playerName, ramAmount, clientVersion, javaBinaryPath, fullLaunchString, assetsIndex, clientUrl, fileHash, versionToDownload
Define.s assetsIndex, clientMainClass, clientArguments, inheritsClientJar, customLaunchArguments, clientJarFile, nativesPath, librariesString
Define.s uuid, jvmArguments
Define.s uuid, jvmArguments, logConfId, logConfUrl, logConfArgument

Define.i downloadThread, downloadMissingLibraries, jsonArgumentsMember, jsonArgumentsModernMember, jsonInheritsFromMember
Define.i downloadMissingLibrariesGadget, downloadThreadsGadget, asyncDownloadGadget, saveSettingsButton, useCustomJavaGadget, useCustomParamsGadget, keepLauncherOpenGadget
Expand All @@ -42,7 +42,7 @@ Define.i useCustomJavaDefault = 0
Define.i useCustomParamsDefault = 0
Define.i keepLauncherOpenDefault = 0

Define.s launcherVersion = "1.1.15"
Define.s launcherVersion = "1.1.16"
Define.s launcherDeveloper = "Kron4ek"

Declare assetsToResources(assetsIndex.s)
Expand Down Expand Up @@ -116,6 +116,7 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
librariesString = ""
clientArguments = ""
jvmArguments = ""
logConfArgument = ""

If FindString(clientVersion, " ")
clientVersion = removeSpacesFromVersionName(clientVersion)
Expand Down Expand Up @@ -259,6 +260,20 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
EndIf
EndIf

loggingMember = GetJSONMember(jsonObject, "logging")

If loggingMember
loggingClientMember = GetJSONMember(loggingMember, "client")

If loggingClientMember
loggingFileMember = GetJSONMember(loggingClientMember, "file")

If loggingFileMember
logConfArgument = "-Dlog4j.configurationFile=assets/log_configs/" + GetJSONString(GetJSONMember(loggingFileMember, "id"))
EndIf
EndIf
EndIf

If FileSize(clientJarFile) > 0
librariesString = parseLibraries(clientVersion, downloadMissingLibraries) + librariesString
clientMainClass = GetJSONString(GetJSONMember(jsonObject, "mainClass"))
Expand Down Expand Up @@ -290,14 +305,16 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
customLaunchArguments = ReadPreferenceString("LaunchArguments", customLaunchArgumentsDefault)
EndIf

fullLaunchString = "-Xmx" + ramAmount + "M " + customLaunchArguments + " " + jvmArguments + " " + clientMainClass + " " + clientArguments
fullLaunchString = "-Xmx" + ramAmount + "M " + customLaunchArguments + " -Dlog4j2.formatMsgNoLookups=true " + logConfArgument + " " + jvmArguments + " " + clientMainClass + " " + clientArguments

fullLaunchString = ReplaceString(fullLaunchString, "${auth_player_name}", playerName)
fullLaunchString = ReplaceString(fullLaunchString, "${version_name}", clientVersion)
fullLaunchString = ReplaceString(fullLaunchString, "${game_directory}", workingDirectory)
fullLaunchString = ReplaceString(fullLaunchString, "${game_directory}", ".")
fullLaunchString = ReplaceString(fullLaunchString, "${assets_root}", "assets")
fullLaunchString = ReplaceString(fullLaunchString, "${auth_uuid}", uuid)
fullLaunchString = ReplaceString(fullLaunchString, "${auth_access_token}", "00000000000000000000000000000000")
fullLaunchString = ReplaceString(fullLaunchString, "${clientid}", "0000")
fullLaunchString = ReplaceString(fullLaunchString, "${auth_xuid}", "0000")
fullLaunchString = ReplaceString(fullLaunchString, "${user_properties}", "{}")
fullLaunchString = ReplaceString(fullLaunchString, "${user_type}", "mojang")
fullLaunchString = ReplaceString(fullLaunchString, "${version_type}", "release")
Expand Down Expand Up @@ -396,6 +413,26 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
CreateDirectoryRecursive("assets/indexes")
ReceiveHTTPFile(GetJSONString(GetJSONMember(GetJSONMember(jsonObject, "assetIndex"), "url")), "assets/indexes/" + assetsIndex + ".json")

loggingMember = GetJSONMember(jsonObject, "logging")

If loggingMember
loggingClientMember = GetJSONMember(loggingMember, "client")

If loggingClientMember
loggingFileMember = GetJSONMember(loggingClientMember, "file")

If loggingFileMember
logConfId = GetJSONString(GetJSONMember(loggingFileMember, "id"))
logConfUrl = GetJSONString(GetJSONMember(loggingFileMember, "url"))
logConfSize = GetJSONInteger(GetJSONMember(loggingFileMember, "size"))

WriteStringN(listOfFiles, logConfUrl + "::" + "assets/log_configs/" + logConfId + "::" + logConfSize)

CreateDirectoryRecursive("assets/log_configs")
EndIf
EndIf
EndIf

clientUrl = GetJSONString(GetJSONMember(GetJSONMember(GetJSONMember(jsonObject, "downloads"), "client"), "url"))
clientSize = GetJSONInteger(GetJSONMember(GetJSONMember(GetJSONMember(jsonObject, "downloads"), "client"), "size"))

Expand Down
45 changes: 41 additions & 4 deletions vlauncher_macos.pb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ Define.i saveLaunchString, versionsTypeGadget, saveLaunchStringGadget, launchStr
Define.i argsTextGadget, javaBinaryPathTextGadget, downloadThreadsTextGadget, downloadAllFilesGadget
Define.i gadgetsWidth, gadgetsHeight, gadgetsIndent, windowWidth, windowHeight
Define.i listOfFiles, jsonFile, jsonObject, jsonObjectObjects, fileSize, jsonJarMember, jsonArgumentsArray, jsonArrayElement, inheritsJson, clientSize
Define.i releaseTimeMember, releaseTime, jsonJvmArray
Define.i releaseTimeMember, releaseTime, jsonJvmArray, loggingMember, loggingClientMember, loggingFileMember, logConfSize

Define.s playerName, ramAmount, clientVersion, javaBinaryPath, fullLaunchString, assetsIndex, clientUrl, fileHash, versionToDownload
Define.s assetsIndex, clientMainClass, clientArguments, inheritsClientJar, customLaunchArguments, clientJarFile, nativesPath, librariesString
Define.s uuid, jvmArguments
Define.s uuid, jvmArguments, logConfId, logConfUrl, logConfArgument

Define.i downloadThread, downloadMissingLibraries, jsonArgumentsMember, jsonArgumentsModernMember, jsonInheritsFromMember
Define.i downloadMissingLibrariesGadget, downloadThreadsGadget, asyncDownloadGadget, saveSettingsButton, useCustomJavaGadget, useCustomParamsGadget, keepLauncherOpenGadget
Expand All @@ -42,7 +42,7 @@ Define.i useCustomJavaDefault = 0
Define.i useCustomParamsDefault = 0
Define.i keepLauncherOpenDefault = 0

Define.s launcherVersion = "1.1.15"
Define.s launcherVersion = "1.1.16"
Define.s launcherDeveloper = "Kron4ek"

Declare assetsToResources(assetsIndex.s)
Expand Down Expand Up @@ -119,6 +119,7 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
librariesString = ""
clientArguments = ""
jvmArguments = ""
logConfArgument = ""

If FileSize("/Library/Internet Plug-ins/JavaAppletPlugin.plugin/Contents/Home/bin/java") > 0
javaBinaryPath = "/Library/Internet Plug-ins/JavaAppletPlugin.plugin/Contents/Home/bin/java"
Expand Down Expand Up @@ -268,6 +269,20 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
EndIf
EndIf

loggingMember = GetJSONMember(jsonObject, "logging")

If loggingMember
loggingClientMember = GetJSONMember(loggingMember, "client")

If loggingClientMember
loggingFileMember = GetJSONMember(loggingClientMember, "file")

If loggingFileMember
logConfArgument = "-Dlog4j.configurationFile=assets/log_configs/" + GetJSONString(GetJSONMember(loggingFileMember, "id"))
EndIf
EndIf
EndIf

If FileSize(clientJarFile) > 0
librariesString = parseLibraries(clientVersion, downloadMissingLibraries) + librariesString
clientMainClass = GetJSONString(GetJSONMember(jsonObject, "mainClass"))
Expand Down Expand Up @@ -299,14 +314,16 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
customLaunchArguments = ReadPreferenceString("LaunchArguments", customLaunchArgumentsDefault)
EndIf

fullLaunchString = "-Xmx" + ramAmount + "M " + customLaunchArguments + " " + jvmArguments + " " + clientMainClass + " " + clientArguments
fullLaunchString = "-Xmx" + ramAmount + "M " + customLaunchArguments + " -Dlog4j2.formatMsgNoLookups=true " + logConfArgument + " " + jvmArguments + " " + clientMainClass + " " + clientArguments

fullLaunchString = ReplaceString(fullLaunchString, "${auth_player_name}", playerName)
fullLaunchString = ReplaceString(fullLaunchString, "${version_name}", clientVersion)
fullLaunchString = ReplaceString(fullLaunchString, "${game_directory}", Chr(34) + workingDirectory + Chr(34))
fullLaunchString = ReplaceString(fullLaunchString, "${assets_root}", "assets")
fullLaunchString = ReplaceString(fullLaunchString, "${auth_uuid}", uuid)
fullLaunchString = ReplaceString(fullLaunchString, "${auth_access_token}", "00000000000000000000000000000000")
fullLaunchString = ReplaceString(fullLaunchString, "${clientid}", "0000")
fullLaunchString = ReplaceString(fullLaunchString, "${auth_xuid}", "0000")
fullLaunchString = ReplaceString(fullLaunchString, "${user_properties}", "{}")
fullLaunchString = ReplaceString(fullLaunchString, "${user_type}", "mojang")
fullLaunchString = ReplaceString(fullLaunchString, "${version_type}", "release")
Expand Down Expand Up @@ -405,6 +422,26 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
CreateDirectoryRecursive("assets/indexes")
ReceiveHTTPFile(GetJSONString(GetJSONMember(GetJSONMember(jsonObject, "assetIndex"), "url")), "assets/indexes/" + assetsIndex + ".json")

loggingMember = GetJSONMember(jsonObject, "logging")

If loggingMember
loggingClientMember = GetJSONMember(loggingMember, "client")

If loggingClientMember
loggingFileMember = GetJSONMember(loggingClientMember, "file")

If loggingFileMember
logConfId = GetJSONString(GetJSONMember(loggingFileMember, "id"))
logConfUrl = GetJSONString(GetJSONMember(loggingFileMember, "url"))
logConfSize = GetJSONInteger(GetJSONMember(loggingFileMember, "size"))

WriteStringN(listOfFiles, logConfUrl + "::" + "assets/log_configs/" + logConfId + "::" + logConfSize)

CreateDirectoryRecursive("assets/log_configs")
EndIf
EndIf
EndIf

clientUrl = GetJSONString(GetJSONMember(GetJSONMember(GetJSONMember(jsonObject, "downloads"), "client"), "url"))
clientSize = GetJSONInteger(GetJSONMember(GetJSONMember(GetJSONMember(jsonObject, "downloads"), "client"), "size"))

Expand Down
47 changes: 42 additions & 5 deletions vlauncher_windows.pb
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ Define.i saveLaunchString, versionsTypeGadget, saveLaunchStringGadget, launchStr
Define.i argsTextGadget, javaBinaryPathTextGadget, downloadThreadsTextGadget, downloadAllFilesGadget, javaPathGadget
Define.i gadgetsWidth, gadgetsHeight, gadgetsIndent, windowWidth, windowHeight
Define.i listOfFiles, jsonFile, jsonObject, jsonObjectObjects, fileSize, jsonJarMember, jsonArgumentsArray, jsonArrayElement, inheritsJson, clientSize
Define.i releaseTimeMember, releaseTime, jsonJvmArray
Define.i releaseTimeMember, releaseTime, jsonJvmArray, loggingMember, loggingClientMember, loggingFileMember, logConfSize

Define.s playerName, ramAmount, clientVersion, javaBinaryPath, fullLaunchString, assetsIndex, clientUrl, fileHash, versionToDownload
Define.s assetsIndex, clientMainClass, clientArguments, inheritsClientJar, customLaunchArguments, clientJarFile, nativesPath, librariesString
Define.s uuid, jvmArguments
Define.s uuid, jvmArguments, logConfId, logConfUrl, logConfArgument

Define.i downloadMissingLibraries, jsonArgumentsMember, jsonArgumentsModernMember, jsonInheritsFromMember
Define.i downloadMissingLibrariesGadget, downloadThreadsGadget, asyncDownloadGadget, saveSettingsButton, useCustomJavaGadget, useCustomParamsGadget, keepLauncherOpenGadget
Expand All @@ -45,7 +45,7 @@ Define.i keepLauncherOpenDefault = 0
Global.i useCustomJavaDefault = 0
Global.s javaBinaryPathDefault = "C:\jre8\bin\javaw.exe"

Define.s launcherVersion = "1.1.15"
Define.s launcherVersion = "1.1.16"
Define.s launcherDeveloper = "Kron4ek"

Declare assetsToResources(assetsIndex.s)
Expand Down Expand Up @@ -125,6 +125,7 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
librariesString = ""
clientArguments = ""
jvmArguments = ""
logConfArgument = ""

If FindString(clientVersion, " ")
clientVersion = removeSpacesFromVersionName(clientVersion)
Expand Down Expand Up @@ -272,6 +273,20 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
EndIf
EndIf

loggingMember = GetJSONMember(jsonObject, "logging")

If loggingMember
loggingClientMember = GetJSONMember(loggingMember, "client")

If loggingClientMember
loggingFileMember = GetJSONMember(loggingClientMember, "file")

If loggingFileMember
logConfArgument = "-Dlog4j.configurationFile=assets\log_configs\" + GetJSONString(GetJSONMember(loggingFileMember, "id"))
EndIf
EndIf
EndIf

If FileSize(clientJarFile) > 0
librariesString = parseLibraries(clientVersion, downloadMissingLibraries) + librariesString
clientMainClass = GetJSONString(GetJSONMember(jsonObject, "mainClass"))
Expand Down Expand Up @@ -303,14 +318,16 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
customLaunchArguments = ReadPreferenceString("LaunchArguments", customLaunchArgumentsDefault)
EndIf

fullLaunchString = "-Xmx" + ramAmount + "M " + customLaunchArguments + " " + jvmArguments + " " + clientMainClass + " " + clientArguments
fullLaunchString = "-Xmx" + ramAmount + "M " + customLaunchArguments + " -Dlog4j2.formatMsgNoLookups=true " + logConfArgument + " " + jvmArguments + " " + clientMainClass + " " + clientArguments

fullLaunchString = ReplaceString(fullLaunchString, "${auth_player_name}", playerName)
fullLaunchString = ReplaceString(fullLaunchString, "${version_name}", clientVersion)
fullLaunchString = ReplaceString(fullLaunchString, "${game_directory}", workingDirectory)
fullLaunchString = ReplaceString(fullLaunchString, "${game_directory}", ".")
fullLaunchString = ReplaceString(fullLaunchString, "${assets_root}", "assets")
fullLaunchString = ReplaceString(fullLaunchString, "${auth_uuid}", uuid)
fullLaunchString = ReplaceString(fullLaunchString, "${auth_access_token}", "00000000000000000000000000000000")
fullLaunchString = ReplaceString(fullLaunchString, "${clientid}", "0000")
fullLaunchString = ReplaceString(fullLaunchString, "${auth_xuid}", "0000")
fullLaunchString = ReplaceString(fullLaunchString, "${user_properties}", "{}")
fullLaunchString = ReplaceString(fullLaunchString, "${user_type}", "mojang")
fullLaunchString = ReplaceString(fullLaunchString, "${version_type}", "release")
Expand Down Expand Up @@ -409,6 +426,26 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
CreateDirectoryRecursive("assets\indexes")
ReceiveHTTPFile(GetJSONString(GetJSONMember(GetJSONMember(jsonObject, "assetIndex"), "url")), "assets\indexes\" + assetsIndex + ".json")

loggingMember = GetJSONMember(jsonObject, "logging")

If loggingMember
loggingClientMember = GetJSONMember(loggingMember, "client")

If loggingClientMember
loggingFileMember = GetJSONMember(loggingClientMember, "file")

If loggingFileMember
logConfId = GetJSONString(GetJSONMember(loggingFileMember, "id"))
logConfUrl = GetJSONString(GetJSONMember(loggingFileMember, "url"))
logConfSize = GetJSONInteger(GetJSONMember(loggingFileMember, "size"))

WriteStringN(listOfFiles, logConfUrl + "::" + "assets\log_configs\" + logConfId + "::" + logConfSize)

CreateDirectoryRecursive("assets\log_configs")
EndIf
EndIf
EndIf

clientUrl = GetJSONString(GetJSONMember(GetJSONMember(GetJSONMember(jsonObject, "downloads"), "client"), "url"))
clientSize = GetJSONInteger(GetJSONMember(GetJSONMember(GetJSONMember(jsonObject, "downloads"), "client"), "size"))

Expand Down

0 comments on commit 188dae7

Please sign in to comment.