Skip to content

Commit

Permalink
Workaround for Sekiro Data5.bdt crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Atvaark committed Mar 23, 2019
1 parent 8b368c6 commit d379d93
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions BinderTool.Core.Kraken/NativeOodleKraken.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace BinderTool.Core.Kraken
Expand Down Expand Up @@ -104,10 +105,11 @@ public static byte[] Decompress(byte[] buffer, int size, int uncompressedSize)

if (decompressedSize == 0)
{
throw new ApplicationException("Failed to decompress buffer");
// Fails on Sekiro Data5.bdt > 7052488_Data5.bnd, yet {decompressedBuffer} contains a valid .bnd file
Debug.WriteLine($"Failed to decompress buffer of size {size} to {uncompressedSize}.");
//throw new ApplicationException("Failed to decompress buffer");
}

if (decompressedSize != uncompressedSize)
else if (decompressedSize != uncompressedSize)
{
Array.Resize(ref decompressedBuffer, decompressedSize);
}
Expand Down

0 comments on commit d379d93

Please sign in to comment.