diff --git a/src/de/mas/wiiu/jnus/utils/cryptography/NUSDecryption.java b/src/de/mas/wiiu/jnus/utils/cryptography/NUSDecryption.java index b9dc0ae..00ad9b0 100644 --- a/src/de/mas/wiiu/jnus/utils/cryptography/NUSDecryption.java +++ b/src/de/mas/wiiu/jnus/utils/cryptography/NUSDecryption.java @@ -189,6 +189,9 @@ public class NUSDecryption extends AESDecryption { } finally { StreamUtils.closeAll(inputStream, outputStream); } + if(written < filesize) { + throw new IOException("Failed to read. Missing " + (filesize - written)); + } } public void decryptFileStreamHashed(InputStream inputStream, OutputStream outputStream, long fileoffset, long filesize, short contentIndex, byte[] h3Hash)