$Display = Get-PrimaryDisplay
$Width = [System.BitConverter]::GetBytes($Display.Bounds.Width)
$Height = [System.BitConverter]::GetBytes($Display.Bounds.Height)
Edit-PatchBinary -FilePath "$InstallDirectory\Savegame\device.cfg" -Offset 0x78 -Data $Width
Edit-PatchBinary -FilePath "$InstallDirectory\Savegame\device.cfg" -Offset 0x7C -Data $Height
Edit-PatchBinary -FilePath "$InstallDirectory\Savegame\device.cfg" -Offset 0x64 -Data ([byte[]]@( 0x02, 0x00, 0x00, 0x00, 0x66, 0x8E, 0xB7, 0xD7, 0x56, 0x5A, 0xCF, 0x11, 0x45, 0x66, 0xE8, 0x10, 0xBB, 0xC2, 0xD9, 0x35 ))
The game stores the player name (with a maximum of 8 characters) in the Savegame\player001.sav binary file. This script will patch the file and separate each character with a value of 0x00.
# Converts a string to a UTF16-encoded byte array. This looks like ASCII characters separated by 0x00 in most cases.
$bytes = ConvertTo-StringBytes -Input $NewPlayerAlias -Utf16 1 -MaxLength 8 -MinLength 8
# Writes byte[] to a file at an offset
Edit-PatchBinary -FilePath "$InstallDirectory\Savegame\player001.sav" -Offset 0x04 -Data $bytes
Edit-PatchBinary -FilePath "$InstallDirectory\Savegame\player001.sav" -Offset 0x62 -Data $bytes