Skip to content

Instantly share code, notes, and snippets.

@thaddeusc1
Last active October 21, 2023 19:50
Show Gist options
  • Save thaddeusc1/d02aaf1270ef8bd3bdfa43e43baebade to your computer and use it in GitHub Desktop.
Save thaddeusc1/d02aaf1270ef8bd3bdfa43e43baebade to your computer and use it in GitHub Desktop.
Export and Import player progression/save data for Deep Rock Galactic: Survivor Demo
# Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
param(
[string]$ExportPath = "$pwd"
)
$lastPlayedTimestamp = $(Get-ItemProperty "${HOME}\AppData\LocalLow\Funday Games\DRG Survivor\Player.log" -Name LastWriteTime).LastWriteTime.ToString("yyyy-MM-ddTHHmmsszz00")
$exportFilePath = "${ExportPath}\DRG Survivor Demo progress ${lastPlayedTimestamp}.json"
$progressValue = Get-ItemProperty -Path 'HKCU:Software\Funday Games\DRG Survivor' -Name drg_nextfest_h1212463016
$progressCString = [System.Text.Encoding]::UTF8.GetString($progressValue.drg_nextfest_h1212463016)
$progressString = $progressCString.Substring(0, $progressCString.Length-1) # Remove the null-terminator from the C-style String.
ConvertFrom-Json -InputObject "$progressString" | ConvertTo-Json > "$exportFilePath"
Write-Output "DRG Survivor Demo progress exported to '$exportFilePath'"
# Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
param(
[Parameter(Mandatory=$true)]
[string]$ImportFilePath
)
$progress = Get-Content -Path "$ImportFilePath" | ConvertFrom-Json
$progressString = ConvertTo-Json -Compress $progress
$progressValue = [Byte[]]::new($progressString.Length + 1)
[System.Text.Encoding]::UTF8.GetBytes($progressString, 0, $progressString.Length, $progressValue, 0)
$progressValue[$progressValue.length-1] = 0 # Initialize null terminator to create a C-style String.
Set-ItemProperty -Path 'HKCU:Software\Funday Games\DRG Survivor' -Name drg_nextfest_h1212463016 -Value $progressValue
Write-Output "DRG Survivor Demo progress import complete."
@thaddeusc1
Copy link
Author

Usage

Export progression/save data from the DRG Survivor Demo

The file name of the exported data will be timestamped with the last time the game was played.

  1. Export the progress/save data to the current working directory:

Export-DrgSurvivorDemo-Progress.ps1

  1. Specify a directory to export the progress/save data to—e.g., the user's Downloads folder:

Export-DrgSurvivorDemo-Progress.ps1 "${HOME}\Downloads"

Import progression/save data that's been exported—e.g., from another computer

Import-DrgSurvivorDemo-Progress.ps1 '\path\to\import\DRG Survivor Demo progress 2023-10-21T150819-0400.json'

Tested With

Deep Rock Galactic: Survivor Demo v0.2.48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment