From db80c89639d1aeba8fd78676f19f9298a2d94614 Mon Sep 17 00:00:00 2001 From: Dmitry Isaenko Date: Fri, 27 Sep 2019 05:08:10 +0300 Subject: [PATCH] bugfix for PFS0EncryptedProvider --- .../java/konogonka/Tools/PFS0/PFS0EncryptedProvider.java | 3 ++- src/main/resources/FXML/NPDM/FSAccessHeaderTable.fxml | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/konogonka/Tools/PFS0/PFS0EncryptedProvider.java b/src/main/java/konogonka/Tools/PFS0/PFS0EncryptedProvider.java index d36a215..990ad67 100644 --- a/src/main/java/konogonka/Tools/PFS0/PFS0EncryptedProvider.java +++ b/src/main/java/konogonka/Tools/PFS0/PFS0EncryptedProvider.java @@ -201,6 +201,8 @@ public class PFS0EncryptedProvider implements IPFS0Provider{ // If we have extra-small file that is less then a block and even more if ((0x200 - skipBytes) > pfs0subFiles[subFileNumber].getSize()){ streamOut.write(dectyptedBlock, skipBytes, (int) pfs0subFiles[subFileNumber].getSize()); // safe cast + bis.close(); + streamOut.close(); return; } else @@ -212,7 +214,6 @@ public class PFS0EncryptedProvider implements IPFS0Provider{ } startBlock++; } - long endBlock = pfs0subFiles[subFileNumber].getSize() / 0x200 + startBlock; // <- pointing to place where any data related to this media-block ends //----------------------------- Step 2: Detect if we have junk data on the end of the final block -------------------------------- diff --git a/src/main/resources/FXML/NPDM/FSAccessHeaderTable.fxml b/src/main/resources/FXML/NPDM/FSAccessHeaderTable.fxml index 2060d0e..a22847d 100644 --- a/src/main/resources/FXML/NPDM/FSAccessHeaderTable.fxml +++ b/src/main/resources/FXML/NPDM/FSAccessHeaderTable.fxml @@ -49,7 +49,7 @@ - + - + - + - +