From de7909eb34a8edbe72cce9a4e4a3516c194dcf17 Mon Sep 17 00:00:00 2001 From: Maschell Date: Wed, 10 Apr 2019 19:59:56 +0200 Subject: [PATCH] Throw on IOException if the FST length is not aligned to 16 before decrypting. --- src/de/mas/wiiu/jnus/NUSTitleLoader.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/de/mas/wiiu/jnus/NUSTitleLoader.java b/src/de/mas/wiiu/jnus/NUSTitleLoader.java index 6363848..e71b213 100644 --- a/src/de/mas/wiiu/jnus/NUSTitleLoader.java +++ b/src/de/mas/wiiu/jnus/NUSTitleLoader.java @@ -72,6 +72,9 @@ public class NUSTitleLoader { if (fstContent.isEncrypted()) { AESDecryption aesDecryption = new AESDecryption(ticket.getDecryptedKey(), new byte[0x10]); + if (fstBytes.length % 0x10 != 0) { + throw new IOException("FST length is not align to 16"); + } fstBytes = aesDecryption.decrypt(fstBytes); }