FromDarkHell / BL3SaveEditor

A desktop based save and profile editor for Borderlands 3
GNU General Public License v3.0
249 stars 48 forks source link

Crashed on save of character & cannot re-open - save parse "startIndex" out of range #20

Open lewisandrew opened 2 years ago

lewisandrew commented 2 years ago

I didn't make any changes to my character (1.sav) and clicked Save. The app then crashed, and I cannot re-open the character save and get dialog error pop:

Error parsing save: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex

Here's a zip of my two files

I started up BL3 and my character got wiped :(. Any way this could be restored?

lewisandrew commented 2 years ago

Output of the debug


Reading new file: "O:\OneDrive\Documents\My Games\Borderlands 3\Saved\SaveGames\76561198030071306\1.sav"
Header: GVAS
Save Game Version: 2
Package version: 516
Engine version: 4.20.3.2150113183
Build ID: OAK-PATCHWIN640-293
Custom Format Version: 3
Custom Format Data Count: 59
Save Game Type: OakSaveGame
Failed to load save (O:\OneDrive\Documents\My Games\Borderlands 3\Saved\SaveGames\76561198030071306\1.sav) :: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.BitConverter.ToInt32(Byte[] value, Int32 startIndex)
   at IOTools.IOWrapper.ReadInt32() in J:\Coding Projecties\BL3SaveEditor\IOTools\IOWrapper.cs:line 399
   at BL3Tools.BL3Tools.LoadFileFromDisk(String filePath, Platform platform, Boolean bBackup) in J:\Coding Projecties\BL3SaveEditor\BL3Tools\BL3Tools.cs:line 63
   at BL3SaveEditor.MainWindow.OpenSave(String filePath, Platform platform) in J:\Coding Projecties\BL3SaveEditor\BL3SaveEditor\MainWindow.xaml.cs:line 337
lewisandrew commented 2 years ago

I fortunately had a backup save that was only 2 levels behind, so I just had to replay to gain that progress back. From the looks of it, the file that I'm seeing written to disk when I do a Save or a Save As is 2KB, where the original file I am editing is 658KB. I had the debugger open when I clicked save but the entire apps crashes/closes immediately, so I can't capture any info on it. Any other way I can debug or retrieve logs of the Save attempt to help diagnose the issue?

FromDarkHell commented 2 years ago

I can't really debug it without having the correct (uncorrupted) save so I've got to have that. If it's erroring during saving, of course the file is going to end up corrupted; When I save a file, I reload it in the GUI to try and point out issues like that more easily.

Also as a note, the editor comes with a backup option, I suggest you use that anytime you're doing editing on a save you really treasure.

lewisandrew commented 2 years ago

Here is my uncorrupted file.

1_backup.zip