Skip to content

Instantly share code, notes, and snippets.

@Ailothaen
Created April 2, 2023 13:42
Show Gist options
  • Save Ailothaen/2407e5eec122fd1feb4a33cde04eb4c7 to your computer and use it in GitHub Desktop.
Save Ailothaen/2407e5eec122fd1feb4a33cde04eb4c7 to your computer and use it in GitHub Desktop.
Powershell script (not from me, keeping it here for preservation purposes) that helps "un-softlocking" OATBF savefiles. Does NOT work on Definitive Edition.
##########################################################################
# This Script was created by #
# http://steamcommunity.com/id/MartinLenord #
# For more info or if you have any questions see #
# http://steamcommunity.com/app/261570/discussions/0/618456760272262183/ #
##########################################################################
########################################################################
# WARNING: This script could damage your save file please back them up #
########################################################################
# Check save location
if (Test-Path -Path ($env:LOCALAPPDATA + "\Ori and the Blind Forest\")) {
$saveLocation = $env:LOCALAPPDATA + "\Ori and the Blind Forest\"
} else {
$saveLocation = $env:USERPROFILE + "\Ori and the Blind Forest\"
}
# Default to non existant save
$saveNumber = 100
# Keep asking for save file until a valid number is entered
while(1 -eq 1) {
# Prompt for save file
$saveNumberRaw = Read-Host 'Which save do you want to modify? (A number from 1 to 10) '
$saveNumber = 0 + $saveNumberRaw - 1
if (Test-Path -Path ($saveLocation + "saveFile" + $saveNumber + ".sav")) {
break
}
"Failed to find save slot " + $saveNumberRaw + ". Try another slot"
}
" "
# Open save file
$bytes = [System.IO.File]::ReadAllBytes($saveLocation + "saveFile" + $saveNumber + ".sav")
# Backup save file
"Backing up save file to: " + $saveLocation + "saveFile" + $saveNumber + ".backup.sav"
[System.IO.File]::WriteAllBytes($saveLocation + "saveFile" + $saveNumber + ".backup.sav", $bytes)
"Backup success!"
# Location GUID
$locationGUID = @(0xE9,0x54,0xCA,0x55,0xA3,0x74,0xA6,0x4A,0x99,0x55,0x4E,0x8E,0xB7,0xEA,0x1A,0x32)
# Locations
$grove = @(0x08,0xC8,0x1D,0xB9,0x80,0x41,0x7F,0xB6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xDA,0xDB,0xBE,0xC2,0xF7,0xBC,0xEF,0xC2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xBF,0x00,0x00,0x00,0x00,0x01,0x00,0x01,
0x01,0x01,0xA0,0x34,0xD0,0xBC,0xD5,0xEA,0x7F,0x3F,0x00,0x00,0x00,0x00,0x01,0x00,0xAB,0x31,0xD0,0x3C,0xD6,0xEA,0x7F,
0xBF,0x00,0x00,0x00,0x80,0x00,0x00,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x80,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)
$fire = @(0x9C,0x5A,0x51,0x3A,0xB0,0x29,0x0D,0xB9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x42,0xDD,0x85,0x43,0x39,0xDD,0x29,0xC1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xBF,0x00,0x00,0x00,0x00,0x01,0x00,0x01,
0x01,0x01,0x05,0x37,0x2A,0x3E,0x40,0x70,0x7C,0x3F,0x00,0x00,0x00,0x00,0x01,0x00,0x30,0x37,0x2A,0xBE,0x3E,0x70,0x7C,
0xBF,0x00,0x00,0x00,0x80,0x00,0x00,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,
0x80,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)
$swamp = @(0xF1,0xD4,0x63,0xBA,0xD0,0x84,0xA6,0xB7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xEB,0x06,0xF7,0x43,0xBD,0x9F,0x94,0xC2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xBF,0x00,0x00,0x00,0x00,0x01,0x00,0x01,
0x01,0x01,0x2A,0xB8,0xBA,0xBC,0xFA,0xEE,0x7F,0x3F,0x00,0x00,0x00,0x00,0x01,0x00,0x2E,0xED,0xBA,0x3C,0xF1,0xEE,0x7F,
0xBF,0x00,0x00,0x00,0x80,0x00,0x00,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,
0x80,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)
$tree = @(0x37,0xC9,0x7E,0x3A,0x00,0xF4,0xB3,0xBA,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xAD,0xA6,0x0E,0x44,0xB0,0xAF,0x06,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xBF,0x00,0x00,0x00,0x00,0x01,0x00,0x01,
0x01,0x01,0x7C,0x7B,0xBB,0xBC,0xD6,0xEE,0x7F,0x3F,0x00,0x00,0x00,0x00,0x01,0x00,0x2E,0xED,0xBA,0x3C,0xF1,0xEE,0x7F,
0xBF,0x00,0x00,0x00,0x80,0x00,0x00,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x80,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)
$glades = @(0xAE,0x24,0x8C,0x38,0x00,0x0A,0xCB,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x12,0x0B,0xDB,0x42,0x5A,0xD8,0x80,0xC3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xBF,0x00,0x00,0x00,0x00,0x01,0x00,0x01,
0x01,0x01,0x24,0xEA,0xBA,0xBC,0xF1,0xEE,0x7F,0x3F,0x00,0x00,0x00,0x00,0x01,0x00,0x2E,0xED,0xBA,0x3C,0xF1,0xEE,0x7F,
0xBF,0x00,0x00,0x00,0x80,0x00,0x00,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,
0x80,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)
$valey = @(0xDF,0xD0,0x64,0xBA,0x92,0xF5,0xA6,0xB7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x20,0xF6,0xD9,0xC3,0xC6,0xC8,0x76,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xBF,0x00,0x00,0x00,0x00,0x01,0x00,0x01,
0x01,0x01,0x0F,0xB8,0xBA,0xBC,0xFA,0xEE,0x7F,0x3F,0x00,0x00,0x00,0x00,0x01,0x00,0x2E,0xED,0xBA,0x3C,0xF1,0xEE,0x7F,
0xBF,0x00,0x00,0x00,0x80,0x00,0x00,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x80,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)
$sorrow = @(0x75,0x71,0x76,0x3A,0x34,0xBF,0xB3,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xA7,0x94,0x14,0xC4,0x01,0x8D,0xF7,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xBF,0x00,0x00,0x00,0x00,0x01,0x00,0x01,
0x01,0x01,0x10,0x80,0xBB,0xBC,0xD5,0xEE,0x7F,0x3F,0x00,0x00,0x00,0x00,0x01,0x00,0x2E,0xED,0xBA,0x3C,0xF1,0xEE,0x7F,
0xBF,0x00,0x00,0x00,0x80,0x00,0x00,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x80,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)
$ruins = @(0xB7,0xE7,0x76,0x3A,0xFC,0xFF,0x69,0xB8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xBD,0xF1,0x63,0xC4,0x3C,0xD4,0x96,0xC3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xBF,0x00,0x00,0x00,0x00,0x01,0x00,0x01,
0x01,0x01,0x10,0x80,0xBB,0xBC,0xD5,0xEE,0x7F,0x3F,0x00,0x00,0x00,0x00,0x01,0x00,0x2E,0xED,0xBA,0x3C,0xF1,0xEE,0x7F,
0xBF,0x00,0x00,0x00,0x80,0x00,0x00,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x80,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)
$grotto = @(0x70,0xE2,0x7C,0x3A,0x00,0x70,0x12,0xB9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x86,0xB1,0x01,0x44,0xD4,0xB4,0x30,0xC3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xBF,0x00,0x00,0x00,0x00,0x01,0x00,0x01,
0x01,0x01,0x10,0x80,0xBB,0xBC,0xD5,0xEE,0x7F,0x3F,0x00,0x00,0x00,0x00,0x01,0x00,0x2E,0xED,0xBA,0x3C,0xF1,0xEE,0x7F,
0xBF,0x00,0x00,0x00,0x80,0x00,0x00,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x80,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)
$horu = @(0x2B,0x14,0xB4,0xB8,0x00,0x40,0x20,0xB8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x59,0xFF,0x87,0x42,0x18,0x36,0x28,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xBF,0x00,0x00,0x00,0x00,0x01,0x00,0x01,
0x01,0x01,0x7F,0x88,0xA9,0x3B,0x20,0xFF,0x7F,0x3F,0x00,0x00,0x00,0x00,0x01,0x00,0x21,0x27,0xAA,0xBB,0x1E,0xFF,0x7F,
0xBF,0x00,0x00,0x00,0x80,0x00,0x00,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,
0x80,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)
$basement = @(0x5B,0xEA,0x05,0xB9,0x1E,0xC4,0x16,0xB8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x69,0x0C,0x8B,0x42,0x6A,0x9A,0xBB,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x01,0x01,0xDA,0xAC,0xB4,0x3E,0xF3,0x87,0x6F,0x3F,0x00,0x00,0x00,0x00,0x01,0x00,0x74,0xAC,0xB4,0xBE,0x06,0x88,0x6F,
0xBF,0x00,0x00,0x00,0x80,0x00,0x00,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x80,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)
$swallow = @(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x2E,0x0C,0xC5,0xA5,0x05,0x38,0xC3,0xE8,0x42,0xA3,0xBD,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x01,0x01,0x67,0xAB,0x68,0x3E,0xDD,0x4D,0x79,0x3F,0x00,0x00,0x00,0x00,0x01,0x00,0x97,0xC1,0x68,0xBE,0x91,0x4C,0x79,
0xBF,0x00,0x00,0x00,0x80,0x00,0x00,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x80,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)
$inswallow = @(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x80,0xCF,0x10,0xC5,0xAF,0x23,0x1D,0xC4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x01,0x01,0xDD,0x0C,0xA6,0x3D,0x3D,0x28,0x7F,0x3F,0x00,0x00,0x00,0x00,0x01,0x00,0x6C,0x4F,0xA5,0xBD,0x28,0x2A,0x7F,
0xBF,0x00,0x00,0x00,0x80,0x00,0x00,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,
0x80,0xBF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)
# Prompt for location to warp to
" "
"Warp to location:"
"0 - Don't Warp (Stay where you are)"
"1 - Hollow Grove"
"2 - Hollow Grove (Mount Horu)"
"3 - Thornfelt Swamp"
"4 - Ginso Tree"
"5 - Sunken Glades"
"6 - Valey Of The Wind"
"7 - Sorrow Pass"
"8 - Forlorn Ruins"
"9 - Moon Grotto"
"10 - Mount Horu (Entrance)"
"11 - Mount Horu (Basement - Skip broken door)"
"12 - Swallows Nest (Prologue - Hilltop)"
"13 - Swallows Nest (Prologue - Naru's House)"
$locationNumberRaw = Read-Host 'Where would you like to be warped to? (A number from 0 to 13) '
# Prepare correct location data to be inserted
switch($locationNumberRaw) {
1 { $newLocationData = $grove; break }
2 { $newLocationData = $fire; break }
3 { $newLocationData = $swamp; break }
4 { $newLocationData = $tree; break }
5 { $newLocationData = $glades; break }
6 { $newLocationData = $valey; break }
7 { $newLocationData = $sorrow; break }
8 { $newLocationData = $ruins; break }
9 { $newLocationData = $grotto; break }
10 { $newLocationData = $horu; break }
11 {
$newLocationData = $basement;
# GUID for mount horu basement door object
$doorGUID = @(0xA6,0x2E,0xD4,0xB3,0x41,0xDE,0x25,0x46,0x88,0xDD,0x5F,0xA4,0xF5,0x41,0x0D,0x9E)
" "
"Searching for door flag..."
# Loop through file to find door object
for ($i = 0; $i -lt $bytes.length - $doorGUID.length; $i++) {
# Check first byte to speed up search
if ($bytes[$i] -ne $doorGUID[0]) {
continue;
}
# Compare current bytes with the debug object GUID
$chunk = $bytes[$i..($i+0x0F)]
$diff = @(Compare-Object -ReferenceObject $doorGUID -DifferenceObject $chunk)
#Check for a match
if ($diff.count -eq 0) {
"Door found"
$i = $i + 0x14
" "
"Would you like to open the door at the bottom of mount horu?"
# Prompt for debug selection
$doorFlagRaw = Read-Host 'To open enter 1, otherwise enter 0 '
switch($doorFlagRaw) {
0 { $bytes[$i] = 0x01; break }
1 {
$bytes[$i] = 0x00
"Open sesame!"
break
}
default { $bytes[$i] = 0x01; break }
}
break
}
}
break
}
12 { $newLocationData = $swallow; break }
13 { $newLocationData = $inswallow; break }
default { $newLocationData = 0; break }
}
" "
# Check if we need to warp
if ($newLocationData -ne 0) {
"Searching for location data..."
# Loop through file to find location
for ($i = 0; $i -lt $bytes.length - $locationGUID.length; $i++) {
# Check first byte to speed up search
if ($bytes[$i] -ne $locationGUID[0]) {
continue;
}
# Compare current bytes with the location object GUID
$chunk = $bytes[$i..($i+0x0F)]
$diff = @(Compare-Object -ReferenceObject $locationGUID -DifferenceObject $chunk)
#Check for a match
if ($diff.count -eq 0) {
"Location data found"
$i = $i + 0x10
# Work out length of location object data
$objLength = [bitconverter]::ToInt32($bytes[$i..($i+3)],0)
$i = $i + 0x4
"Updating location"
# Replace location data with new location data
$bytes = $bytes[0..($i - 1)] + $newLocationData + $bytes[($i+$newLocationData.length)..($bytes.length - 1)]
"Location updated"
break
}
}
} else {
"Skipping Warp"
}
# GUID for debug flag object
$debugGUID = @(0xDC,0xD2,0xE1,0x24,0x23,0xE0,0x6E,0x4F,0xBF,0xD0,0x54,0xD1,0x22,0x62,0x66,0x6E)
" "
"Searching for debug flag..."
# Loop through file to find debug object
for ($i = 0; $i -lt $bytes.length - $debugGUID.length; $i++) {
# Check first byte to speed up search
if ($bytes[$i] -ne $debugGUID[0]) {
continue;
}
# Compare current bytes with the debug object GUID
$chunk = $bytes[$i..($i+0x0F)]
$diff = @(Compare-Object -ReferenceObject $debugGUID -DifferenceObject $chunk)
#Check for a match
if ($diff.count -eq 0) {
"Debug data found"
$i = $i + 0x14
if ($bytes[$i] -eq 0) {
"Debug is off"
} else {
"Debug is on"
}
" "
"Warning: Turning debug mode on disables steam achivements!"
"0 - Off"
"1 - On"
# Prompt for debug selection
$debugFlagRaw = Read-Host 'Toggle Debug Mode (Enter 0 or 1) '
switch($debugFlagRaw) {
0 { $bytes[$i] = 0x00; break }
1 { $bytes[$i] = 0x01; break }
default { $bytes[$i] = 0x00; break }
}
if ($bytes[$i] -eq 0) {
"Debug is now off"
} else {
"Debug is now on"
}
break
}
}
# Fix crouch saves
$crouchGUID = @(0x41,0x5E,0x87,0xF4,0xC9,0x4E,0x3E,0x40,0xA8,0x95,0xD3,0x1B,0xE5,0xE2,0xB7,0xFC)
" "
"Searching for broken position data..."
# Loop through file to find the crouch object
for ($i = 0; $i -lt $bytes.length - $crouchGUID.length; $i++) {
# Check first byte to speed up search
if ($bytes[$i] -ne $crouchGUID[0]) {
continue;
}
# Compare current bytes with the debug object GUID
$chunk = $bytes[$i..($i+0x0F)]
$diff = @(Compare-Object -ReferenceObject $crouchGUID -DifferenceObject $chunk)
#Check for a match
if ($diff.count -ne 0) {
continue
}
# Move past GUID and length bytes
$i = $i + 0x14
"Position data found"
" "
"Do you want to try and fix broken position data? (Cant jump out of water / move objects)"
"0 - No"
"1 - Yes"
# Prompt for debug selection
$fixFlagRaw = Read-Host 'Attempt to fix position (Enter 0 or 1) '
if ($fixFlagRaw -eq 1) {
"Replacing broken position data"
# Replace position data with known good position data
$newPos = @(0x33,0x33,0x93,0x3F,0x00,0x00,0x00,0x00,0xCD,0xCC,0x4C,0x3D,0x00,0x00,0x00,0x00,0x7B,0x14,0xAE,0x3E)
$bytes = $bytes[0..($i -1)] + $newPos + $bytes[($i+$newPos.length)..($bytes.length -1)]
"Broken position data replaced"
}
break
}
# Work out the offset of the completed toggle
$nameLength = $bytes[0x0C]
$completeOffset = 0x0C + $nameLength + 0x25
# Set completed toggle to 0
$bytes[$completeOffset] = 0x00
" "
"Removing completed flag"
" "
# Save updated save file
"Resaving save file: " + $saveLocation + "saveFile" + $saveNumber + ".sav"
[System.IO.File]::WriteAllBytes($saveLocation + "saveFile" + $saveNumber + ".sav", $bytes)
"Save success!"
" "
"Press space to close..."
$ending = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment