﻿$bytes  = [System.IO.File]::ReadAllBytes([String](Get-Location) + '\pqSave.exe'); $offset = [Convert]::ToInt32('515780', 16); $sKey = (Read-Host 'Enter your Key'); $KeyBytes = $sKey.ToCharArray(); for ($i = 0; $i -lt 16; $i++) { $bytes[$offset + 2*$i] = [Byte]$sKey[$i] }; $hex = [Convert]::FromBase64String($sKey); $hex = -join ($hex | foreach {'{0:x}' -f $_}); $WriteOut = [String](Get-Location) + '\PqSave_' + $hex + '.exe'; [System.IO.File]::WriteAllBytes($WriteOut, $bytes); Write-Host 'Written file to' ('PqSave_' + $hex + '.exe'); (cat Scripts\Script2.txt).replace('{0}', $hex) | Out-File 'SaveConverter.bat';