Clear issue description for PFS0 (non-encrypted)

This commit is contained in:
Dmitry Isaenko 2020-04-01 13:30:44 +03:00
parent 3c191c42e1
commit d917d4c22f
6 changed files with 70 additions and 31 deletions

View file

@ -86,7 +86,7 @@ public class MainController implements Initializable {
else
fileChooser.setInitialDirectory(new File(System.getProperty("user.home")));
fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("NS files", "*.nsp", "*.xci", "*.nca", "*.tik", "*.xml", "*.npdm"));
fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("NS files", "*.nsp", "*.nsz", "*.xci", "*.nca", "*.tik", "*.xml", "*.npdm"));
this.selectedFile = fileChooser.showOpenDialog(analyzeBtn.getScene().getWindow());
// todo: fix
@ -102,18 +102,28 @@ public class MainController implements Initializable {
filenameSelected.setText(this.selectedFile.getAbsolutePath());
previouslyOpenedPath = this.selectedFile.getParent();
analyzeBtn.setDisable(false);
if (this.selectedFile.getName().toLowerCase().endsWith(".nsp"))
tabPane.getSelectionModel().select(0);
else if (this.selectedFile.getName().toLowerCase().endsWith(".xci"))
tabPane.getSelectionModel().select(1);
else if (this.selectedFile.getName().toLowerCase().endsWith(".nca"))
tabPane.getSelectionModel().select(2);
else if (this.selectedFile.getName().toLowerCase().endsWith(".tik"))
tabPane.getSelectionModel().select(3);
else if (this.selectedFile.getName().toLowerCase().endsWith(".xml"))
tabPane.getSelectionModel().select(4);
else if (this.selectedFile.getName().toLowerCase().endsWith(".npdm"))
tabPane.getSelectionModel().select(5);
String fileExtension = this.selectedFile.getName().toLowerCase().replaceAll("^.*\\.", "");
switch (fileExtension){
case "nsp":
case "nsz":
tabPane.getSelectionModel().select(0);
break;
case "xci":
tabPane.getSelectionModel().select(1);
break;
case "nca":
tabPane.getSelectionModel().select(2);
break;
case "tic":
tabPane.getSelectionModel().select(3);
break;
case "xml":
tabPane.getSelectionModel().select(4);
break;
case "npdm":
tabPane.getSelectionModel().select(5);
break;
}
}
logArea.clear();
@ -122,18 +132,28 @@ public class MainController implements Initializable {
* Start analyze
* */
private void analyzeFile(){
if (selectedFile.getName().toLowerCase().endsWith("nsp"))
NSPTabController.analyze(selectedFile); // TODO: NSP OR XCI
else if (selectedFile.getName().toLowerCase().endsWith("xci"))
XCITabController.analyze(selectedFile);
else if (selectedFile.getName().toLowerCase().endsWith("nca"))
NCATabController.analyze(selectedFile);
else if (selectedFile.getName().toLowerCase().endsWith("tik"))
TIKTabController.analyze(selectedFile);
else if (selectedFile.getName().toLowerCase().endsWith("xml"))
XMLTabController.analyze(selectedFile);
else if (selectedFile.getName().toLowerCase().endsWith("npdm"))
NPDMTabController.analyze(selectedFile);
final String fileExtension = selectedFile.getName().toLowerCase().replaceAll("^.*\\.", "");
switch (fileExtension){
case "nsp":
case "nsz":
NSPTabController.analyze(selectedFile); // TODO: NSP OR XCI
break;
case "xci":
XCITabController.analyze(selectedFile);
break;
case "nca":
NCATabController.analyze(selectedFile);
break;
case "tic":
TIKTabController.analyze(selectedFile);
break;
case "xml":
XMLTabController.analyze(selectedFile);
break;
case "npdm":
NPDMTabController.analyze(selectedFile);
break;
}
}
@FXML
private void showHideLogs(){

View file

@ -193,8 +193,27 @@ public class NCAProvider {
decryptedKey2 = cipher.doFinal(encryptedKey2);
decryptedKey3 = cipher.doFinal(encryptedKey3);
}
else
throw new Exception("key_are_key_[UNKNOWN] requested ("+keyIndex+"). Not supported.");
else{
StringBuilder exceptionStringBuilder = new StringBuilder("key_area_key_");
switch (keyIndex){
case 0:
exceptionStringBuilder.append("application_");
break;
case 1:
exceptionStringBuilder.append("ocean_");
break;
case 2:
exceptionStringBuilder.append("system_");
break;
default:
exceptionStringBuilder.append(keyIndex);
exceptionStringBuilder.append("[UNKNOWN]_");
}
exceptionStringBuilder.append(String.format("%02d", cryptoTypeReal));
exceptionStringBuilder.append(" requested. Not supported or not found.");
throw new Exception(exceptionStringBuilder.toString());
}
}
tableEntry0 = new NCAHeaderTableEntry(tableBytes);

View file

@ -1,4 +1,4 @@
btnFileOpen=Select NSP/XCI/NCA/TIK/XML
btnFileOpen=Select
btnAnalyze=Analyze
lblNoFileSelected=No files selected.
tableNumberLbl=#

View file

@ -1,4 +1,4 @@
btnFileOpen=Selectionner NSP/XCI/NCA/TIK/XML
btnFileOpen=Selectionner
btnAnalyze=Analyser
lblNoFileSelected=Aucuns fichiers s\u00E9lectionn\u00E9s.
tableUploadLbl=Extraire ?

View file

@ -1,4 +1,4 @@
btnFileOpen=\u0412\u044B\u0431\u0440\u0430\u0442\u044C NSP/XCI/NCA/TIK/XML
btnFileOpen=\u0412\u044B\u0431\u0440\u0430\u0442\u044C
btnAnalyze=\u0410\u043D\u0430\u043B\u0438\u0437\u0438\u0440\u043E\u0432\u0430\u0442\u044C
lblNoFileSelected=\u0424\u0430\u0439\u043B\u044B \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u044B.
tableUploadLbl=\u0420\u0430\u0441\u043F\u0430\u043A\u043E\u0432\u0430\u0442\u044C?

View file

@ -1,4 +1,4 @@
btnFileOpen=\u0412\u0438\u0431\u0440\u0430\u0442\u0438 NSP/XCI/NCA/TIK/XML
btnFileOpen=\u0412\u0438\u0431\u0440\u0430\u0442\u0438
btnAnalyze=\u0410\u043D\u0430\u043B\u0456\u0437\u0443\u0432\u0430\u0442\u0438
lblNoFileSelected=\u0424\u0430\u0439\u043B\u0438 \u043D\u0435 \u0432\u0438\u0431\u0440\u0430\u043D\u0456.
tableNumberLbl=\u2116