Bugfix for dumb issue with key_area_key_[all] to support Lockpick dump: hex representation instead of dec %)
This commit is contained in:
parent
0f49812e5f
commit
ce4c5d9870
6 changed files with 104 additions and 108 deletions
|
@ -77,7 +77,7 @@ public class AppPreferences {
|
||||||
public void setKAKAppCount(int number){
|
public void setKAKAppCount(int number){
|
||||||
if (this.kakAppCount > number){
|
if (this.kakAppCount > number){
|
||||||
for (int i = number; i < this.kakAppCount; i++) {
|
for (int i = number; i < this.kakAppCount; i++) {
|
||||||
preferences.remove(String.format("key_area_key_application_%02d", number));
|
preferences.remove(String.format("key_area_key_application_%02x", number));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
preferences.putInt("key_area_key_application_count", number);
|
preferences.putInt("key_area_key_application_count", number);
|
||||||
|
@ -86,7 +86,7 @@ public class AppPreferences {
|
||||||
public void setKAKOceanCount(int number){
|
public void setKAKOceanCount(int number){
|
||||||
if (this.kakOceanCount > number){
|
if (this.kakOceanCount > number){
|
||||||
for (int i = number; i < this.kakOceanCount; i++) {
|
for (int i = number; i < this.kakOceanCount; i++) {
|
||||||
preferences.remove(String.format("key_area_key_ocean_%02d", number));
|
preferences.remove(String.format("key_area_key_ocean_%02x", number));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
preferences.putInt("key_area_key_ocean_count", number);
|
preferences.putInt("key_area_key_ocean_count", number);
|
||||||
|
@ -95,7 +95,7 @@ public class AppPreferences {
|
||||||
public void setKAKSysCount(int number){
|
public void setKAKSysCount(int number){
|
||||||
if (this.kakSysCount > number){
|
if (this.kakSysCount > number){
|
||||||
for (int i = number; i < this.kakSysCount; i++) {
|
for (int i = number; i < this.kakSysCount; i++) {
|
||||||
preferences.remove(String.format("key_area_key_system_%02d", number));
|
preferences.remove(String.format("key_area_key_system_%02x", number));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
preferences.putInt("key_area_key_system_count", number);
|
preferences.putInt("key_area_key_system_count", number);
|
||||||
|
@ -105,7 +105,7 @@ public class AppPreferences {
|
||||||
public void setTitleKeksCount(int number){
|
public void setTitleKeksCount(int number){
|
||||||
if (this.titleKeksCount > number){
|
if (this.titleKeksCount > number){
|
||||||
for (int i = number; i < this.titleKeksCount; i++) {
|
for (int i = number; i < this.titleKeksCount; i++) {
|
||||||
preferences.remove(String.format("titlekek_%02d", number));
|
preferences.remove(String.format("titlekek_%02x", number));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
preferences.putInt("titlekek_count", number);
|
preferences.putInt("titlekek_count", number);
|
||||||
|
@ -117,17 +117,17 @@ public class AppPreferences {
|
||||||
public int getKAKSysCount(){ return preferences.getInt("key_area_key_system_count", 0); }
|
public int getKAKSysCount(){ return preferences.getInt("key_area_key_system_count", 0); }
|
||||||
public int getTitleKeksCount(){ return preferences.getInt("titlekek_count", 0); }
|
public int getTitleKeksCount(){ return preferences.getInt("titlekek_count", 0); }
|
||||||
|
|
||||||
public String getApplicationKey(int number){ return preferences.get(String.format("key_area_key_application_%02d", number), "");}
|
public String getApplicationKey(int number){ return preferences.get(String.format("key_area_key_application_%02x", number), "");}
|
||||||
public void setApplicationKey(int number, String key){ preferences.put(String.format("key_area_key_application_%02d", number), key); }
|
public void setApplicationKey(int number, String key){ preferences.put(String.format("key_area_key_application_%02x", number), key); }
|
||||||
|
|
||||||
public String getOceanKey(int number){ return preferences.get(String.format("key_area_key_ocean_%02d", number), "");}
|
public String getOceanKey(int number){ return preferences.get(String.format("key_area_key_ocean_%02x", number), "");}
|
||||||
public void setOceanKey(int number, String key){ preferences.put(String.format("key_area_key_ocean_%02d", number), key); }
|
public void setOceanKey(int number, String key){ preferences.put(String.format("key_area_key_ocean_%02x", number), key); }
|
||||||
|
|
||||||
public String getSystemKey(int number){ return preferences.get(String.format("key_area_key_system_%02d", number), "");}
|
public String getSystemKey(int number){ return preferences.get(String.format("key_area_key_system_%02x", number), "");}
|
||||||
public void setSystemKey(int number, String key){ preferences.put(String.format("key_area_key_system_%02d", number), key); }
|
public void setSystemKey(int number, String key){ preferences.put(String.format("key_area_key_system_%02x", number), key); }
|
||||||
|
|
||||||
public String getTitleKek(int number){ return preferences.get(String.format("titlekek_%02d", number), "");}
|
public String getTitleKek(int number){ return preferences.get(String.format("titlekek_%02x", number), "");}
|
||||||
public void setTitleKek(int number, String key){ preferences.put(String.format("titlekek_%02d", number), key); }
|
public void setTitleKek(int number, String key){ preferences.put(String.format("titlekek_%02x", number), key); }
|
||||||
|
|
||||||
|
|
||||||
// Title keys
|
// Title keys
|
||||||
|
|
|
@ -101,13 +101,13 @@ public class NCAController implements ITabController {
|
||||||
keysMap.put("header_key", AppPreferences.getInstance().getHeaderKey());
|
keysMap.put("header_key", AppPreferences.getInstance().getHeaderKey());
|
||||||
|
|
||||||
for (int i = 0; i < AppPreferences.getInstance().getKAKAppCount(); i++)
|
for (int i = 0; i < AppPreferences.getInstance().getKAKAppCount(); i++)
|
||||||
keysMap.put(String.format("key_area_key_application_%02d", i), AppPreferences.getInstance().getApplicationKey(i));
|
keysMap.put(String.format("key_area_key_application_%02x", i), AppPreferences.getInstance().getApplicationKey(i));
|
||||||
for (int i = 0; i < AppPreferences.getInstance().getKAKOceanCount(); i++)
|
for (int i = 0; i < AppPreferences.getInstance().getKAKOceanCount(); i++)
|
||||||
keysMap.put(String.format("key_area_key_ocean_%02d", i), AppPreferences.getInstance().getOceanKey(i));
|
keysMap.put(String.format("key_area_key_ocean_%02x", i), AppPreferences.getInstance().getOceanKey(i));
|
||||||
for (int i = 0; i < AppPreferences.getInstance().getKAKSysCount(); i++)
|
for (int i = 0; i < AppPreferences.getInstance().getKAKSysCount(); i++)
|
||||||
keysMap.put(String.format("key_area_key_system_%02d", i), AppPreferences.getInstance().getSystemKey(i));
|
keysMap.put(String.format("key_area_key_system_%02x", i), AppPreferences.getInstance().getSystemKey(i));
|
||||||
for (int i = 0; i < AppPreferences.getInstance().getTitleKeksCount(); i++)
|
for (int i = 0; i < AppPreferences.getInstance().getTitleKeksCount(); i++)
|
||||||
keysMap.put(String.format("titlekek_%02d", i), AppPreferences.getInstance().getTitleKek(i));
|
keysMap.put(String.format("titlekek_%02x", i), AppPreferences.getInstance().getTitleKek(i));
|
||||||
for (int i = 0; i < AppPreferences.getInstance().getTitleKeysCount(); i++){
|
for (int i = 0; i < AppPreferences.getInstance().getTitleKeysCount(); i++){
|
||||||
String[] pair = AppPreferences.getInstance().getTitleKeyPair(i);
|
String[] pair = AppPreferences.getInstance().getTitleKeyPair(i);
|
||||||
if ( ! pair[0].equals("0") && ! pair[1].equals("0"))
|
if ( ! pair[0].equals("0") && ! pair[1].equals("0"))
|
||||||
|
@ -180,59 +180,59 @@ public class NCAController implements ITabController {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populateFields(NCAProvider ncaProvider){
|
private void populateFields(NCAProvider ncaProvider){
|
||||||
if (ncaProvider != null){
|
if (ncaProvider == null)
|
||||||
rsa2048oneTF.setText(byteArrToHexString(ncaProvider.getRsa2048one()));
|
return;
|
||||||
rsa2048twoTF.setText(byteArrToHexString(ncaProvider.getRsa2048two()));
|
rsa2048oneTF.setText(byteArrToHexString(ncaProvider.getRsa2048one()));
|
||||||
magicnumLbl.setText(ncaProvider.getMagicnum());
|
rsa2048twoTF.setText(byteArrToHexString(ncaProvider.getRsa2048two()));
|
||||||
systemOrGcIndLbl.setText(Byte.toString(ncaProvider.getSystemOrGcIndicator()));
|
magicnumLbl.setText(ncaProvider.getMagicnum());
|
||||||
contentTypeLbl.setText(Byte.toString(ncaProvider.getContentType()));
|
systemOrGcIndLbl.setText(Byte.toString(ncaProvider.getSystemOrGcIndicator()));
|
||||||
cryptoType1Lbl.setText(Byte.toString(ncaProvider.getCryptoType1()));
|
contentTypeLbl.setText(Byte.toString(ncaProvider.getContentType()));
|
||||||
keyIndexLbl.setText(Byte.toString(ncaProvider.getKeyIndex()));
|
cryptoType1Lbl.setText(Byte.toString(ncaProvider.getCryptoType1()));
|
||||||
ncaSizeLbl.setText(Long.toString(ncaProvider.getNcaSize()));
|
keyIndexLbl.setText(Byte.toString(ncaProvider.getKeyIndex()));
|
||||||
titleIdLbl.setText(byteArrToHexString(ncaProvider.getTitleId()));
|
ncaSizeLbl.setText(Long.toString(ncaProvider.getNcaSize()));
|
||||||
contentIndexLbl.setText(byteArrToHexString(ncaProvider.getContentIndx())); //
|
titleIdLbl.setText(byteArrToHexString(ncaProvider.getTitleId()));
|
||||||
sdkVersionLbl.setText(ncaProvider.getSdkVersion()[3]
|
contentIndexLbl.setText(byteArrToHexString(ncaProvider.getContentIndx())); //
|
||||||
+"."+ncaProvider.getSdkVersion()[2]
|
sdkVersionLbl.setText(ncaProvider.getSdkVersion()[3]
|
||||||
+"."+ncaProvider.getSdkVersion()[1]
|
+"."+ncaProvider.getSdkVersion()[2]
|
||||||
+"."+ncaProvider.getSdkVersion()[0]);
|
+"."+ncaProvider.getSdkVersion()[1]
|
||||||
cryptoType2Lbl.setText(Byte.toString(ncaProvider.getCryptoType2()));
|
+"."+ncaProvider.getSdkVersion()[0]);
|
||||||
header1SignatureKeyGenerationLbl.setText(Byte.toString(ncaProvider.getHeader1SignatureKeyGeneration()));
|
cryptoType2Lbl.setText(Byte.toString(ncaProvider.getCryptoType2()));
|
||||||
keyGenerationReservedLbl.setText(byteArrToHexString(ncaProvider.getKeyGenerationReserved()));
|
header1SignatureKeyGenerationLbl.setText(Byte.toString(ncaProvider.getHeader1SignatureKeyGeneration()));
|
||||||
ticketLbl.setText(byteArrToHexString(ncaProvider.getRightsId()));
|
keyGenerationReservedLbl.setText(byteArrToHexString(ncaProvider.getKeyGenerationReserved()));
|
||||||
sha256section1TF.setText(byteArrToHexString(ncaProvider.getSha256hash0()));
|
ticketLbl.setText(byteArrToHexString(ncaProvider.getRightsId()));
|
||||||
sha256section2TF.setText(byteArrToHexString(ncaProvider.getSha256hash1()));
|
sha256section1TF.setText(byteArrToHexString(ncaProvider.getSha256hash0()));
|
||||||
sha256section3TF.setText(byteArrToHexString(ncaProvider.getSha256hash2()));
|
sha256section2TF.setText(byteArrToHexString(ncaProvider.getSha256hash1()));
|
||||||
sha256section4TF.setText(byteArrToHexString(ncaProvider.getSha256hash3()));
|
sha256section3TF.setText(byteArrToHexString(ncaProvider.getSha256hash2()));
|
||||||
keyAreaEnKey0TF.setText(byteArrToHexString(ncaProvider.getEncryptedKey0()));
|
sha256section4TF.setText(byteArrToHexString(ncaProvider.getSha256hash3()));
|
||||||
keyAreaEnKey1TF.setText(byteArrToHexString(ncaProvider.getEncryptedKey1()));
|
keyAreaEnKey0TF.setText(byteArrToHexString(ncaProvider.getEncryptedKey0()));
|
||||||
keyAreaEnKey2TF.setText(byteArrToHexString(ncaProvider.getEncryptedKey2()));
|
keyAreaEnKey1TF.setText(byteArrToHexString(ncaProvider.getEncryptedKey1()));
|
||||||
keyAreaEnKey3TF.setText(byteArrToHexString(ncaProvider.getEncryptedKey3()));
|
keyAreaEnKey2TF.setText(byteArrToHexString(ncaProvider.getEncryptedKey2()));
|
||||||
|
keyAreaEnKey3TF.setText(byteArrToHexString(ncaProvider.getEncryptedKey3()));
|
||||||
|
|
||||||
keyAreaDecKey0TF.setText(byteArrToHexString(ncaProvider.getDecryptedKey0()));
|
keyAreaDecKey0TF.setText(byteArrToHexString(ncaProvider.getDecryptedKey0()));
|
||||||
keyAreaDecKey1TF.setText(byteArrToHexString(ncaProvider.getDecryptedKey1()));
|
keyAreaDecKey1TF.setText(byteArrToHexString(ncaProvider.getDecryptedKey1()));
|
||||||
keyAreaDecKey2TF.setText(byteArrToHexString(ncaProvider.getDecryptedKey2()));
|
keyAreaDecKey2TF.setText(byteArrToHexString(ncaProvider.getDecryptedKey2()));
|
||||||
keyAreaDecKey3TF.setText(byteArrToHexString(ncaProvider.getDecryptedKey3()));
|
keyAreaDecKey3TF.setText(byteArrToHexString(ncaProvider.getDecryptedKey3()));
|
||||||
// Tables
|
// Tables
|
||||||
NCATable1Controller.populateTab(ncaProvider.getTableEntry0());
|
NCATable1Controller.populateTab(ncaProvider.getTableEntry0());
|
||||||
NCATable2Controller.populateTab(ncaProvider.getTableEntry1());
|
NCATable2Controller.populateTab(ncaProvider.getTableEntry1());
|
||||||
NCATable3Controller.populateTab(ncaProvider.getTableEntry2());
|
NCATable3Controller.populateTab(ncaProvider.getTableEntry2());
|
||||||
NCATable4Controller.populateTab(ncaProvider.getTableEntry3());
|
NCATable4Controller.populateTab(ncaProvider.getTableEntry3());
|
||||||
// Table blocks
|
// Table blocks
|
||||||
NCASectionHeaderFirstController.populateTab(ncaProvider.getSectionBlock0());
|
NCASectionHeaderFirstController.populateTab(ncaProvider.getSectionBlock0());
|
||||||
NCASectionHeaderSecondController.populateTab(ncaProvider.getSectionBlock1());
|
NCASectionHeaderSecondController.populateTab(ncaProvider.getSectionBlock1());
|
||||||
NCASectionHeaderThirdController.populateTab(ncaProvider.getSectionBlock2());
|
NCASectionHeaderThirdController.populateTab(ncaProvider.getSectionBlock2());
|
||||||
NCASectionHeaderFourthController.populateTab(ncaProvider.getSectionBlock3());
|
NCASectionHeaderFourthController.populateTab(ncaProvider.getSectionBlock3());
|
||||||
// Section content blocks
|
// Section content blocks
|
||||||
// TODO: FIX: This code executes getNCAContentPFS0() method twice
|
// TODO: FIX: This code executes getNCAContentPFS0() method twice
|
||||||
NCAContentPFS0 ncaContentPFS0;
|
NCAContentPFS0 ncaContentPFS0;
|
||||||
ncaContentPFS0 = ncaProvider.getNCAContentPFS0(0);
|
ncaContentPFS0 = ncaProvider.getNCAContentPFS0(0);
|
||||||
NCASectionContentFirstController.populateFields(ncaContentPFS0.getPfs0(), ncaContentPFS0.getSHA256hashes());
|
NCASectionContentFirstController.populateFields(ncaContentPFS0.getPfs0(), ncaContentPFS0.getSHA256hashes());
|
||||||
ncaContentPFS0 = ncaProvider.getNCAContentPFS0(1);
|
ncaContentPFS0 = ncaProvider.getNCAContentPFS0(1);
|
||||||
NCASectionContentSecondController.populateFields(ncaContentPFS0.getPfs0(), ncaContentPFS0.getSHA256hashes());
|
NCASectionContentSecondController.populateFields(ncaContentPFS0.getPfs0(), ncaContentPFS0.getSHA256hashes());
|
||||||
ncaContentPFS0 = ncaProvider.getNCAContentPFS0(2);
|
ncaContentPFS0 = ncaProvider.getNCAContentPFS0(2);
|
||||||
NCASectionContentThirdController.populateFields(ncaContentPFS0.getPfs0(), ncaContentPFS0.getSHA256hashes());
|
NCASectionContentThirdController.populateFields(ncaContentPFS0.getPfs0(), ncaContentPFS0.getSHA256hashes());
|
||||||
ncaContentPFS0 = ncaProvider.getNCAContentPFS0(3);
|
ncaContentPFS0 = ncaProvider.getNCAContentPFS0(3);
|
||||||
NCASectionContentFourthController.populateFields(ncaContentPFS0.getPfs0(), ncaContentPFS0.getSHA256hashes());
|
NCASectionContentFourthController.populateFields(ncaContentPFS0.getPfs0(), ncaContentPFS0.getSHA256hashes());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class ListSelectorController implements Initializable {
|
||||||
|
|
||||||
newRecordName.setText(predictionPattern);
|
newRecordName.setText(predictionPattern);
|
||||||
newRecordName.setTextFormatter(new TextFormatter<Object>(change -> {
|
newRecordName.setTextFormatter(new TextFormatter<Object>(change -> {
|
||||||
if (change.getControlNewText().matches("^"+predictionPattern+"[0-9]{0,2}$"))
|
if (change.getControlNewText().matches("^"+predictionPattern+"[a-fA-F0-9]{0,2}$"))
|
||||||
return change;
|
return change;
|
||||||
return null;
|
return null;
|
||||||
}));
|
}));
|
||||||
|
@ -110,7 +110,7 @@ public class ListSelectorController implements Initializable {
|
||||||
newRecordValue.clear();
|
newRecordValue.clear();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (newRecordName.getText().matches("^"+predictionPattern+"[0-9]{2}$")){
|
if (newRecordName.getText().matches("^"+predictionPattern+"[a-fA-F0-9]{2}$")){
|
||||||
validateAndAdd(newRecordName.getText() + " = " + newRecordValue.getText());
|
validateAndAdd(newRecordName.getText() + " = " + newRecordValue.getText());
|
||||||
newRecordName.setText(predictionPattern);
|
newRecordName.setText(predictionPattern);
|
||||||
newRecordValue.clear();
|
newRecordValue.clear();
|
||||||
|
|
|
@ -78,25 +78,25 @@ public class SettingsController implements Initializable {
|
||||||
LinkedHashMap<String, String> preparedPairsMapInit = new LinkedHashMap<>();
|
LinkedHashMap<String, String> preparedPairsMapInit = new LinkedHashMap<>();
|
||||||
|
|
||||||
for (int i = 0; i < AppPreferences.getInstance().getKAKAppCount(); i++){
|
for (int i = 0; i < AppPreferences.getInstance().getKAKAppCount(); i++){
|
||||||
preparedPairsMapInit.put(String.format("key_area_key_application_%02d", i), AppPreferences.getInstance().getApplicationKey(i));
|
preparedPairsMapInit.put(String.format("key_area_key_application_%02x", i), AppPreferences.getInstance().getApplicationKey(i));
|
||||||
}
|
}
|
||||||
ListSelectorKAEKAppController.setList(preparedPairsMapInit);
|
ListSelectorKAEKAppController.setList(preparedPairsMapInit);
|
||||||
preparedPairsMapInit.clear();
|
preparedPairsMapInit.clear();
|
||||||
|
|
||||||
for (int i = 0; i < AppPreferences.getInstance().getKAKOceanCount(); i++){
|
for (int i = 0; i < AppPreferences.getInstance().getKAKOceanCount(); i++){
|
||||||
preparedPairsMapInit.put(String.format("key_area_key_ocean_%02d", i), AppPreferences.getInstance().getOceanKey(i));
|
preparedPairsMapInit.put(String.format("key_area_key_ocean_%02x", i), AppPreferences.getInstance().getOceanKey(i));
|
||||||
}
|
}
|
||||||
ListSelectorKAEKOceanController.setList(preparedPairsMapInit);
|
ListSelectorKAEKOceanController.setList(preparedPairsMapInit);
|
||||||
preparedPairsMapInit.clear();
|
preparedPairsMapInit.clear();
|
||||||
|
|
||||||
for (int i = 0; i < AppPreferences.getInstance().getKAKSysCount(); i++){
|
for (int i = 0; i < AppPreferences.getInstance().getKAKSysCount(); i++){
|
||||||
preparedPairsMapInit.put(String.format("key_area_key_system_%02d", i), AppPreferences.getInstance().getSystemKey(i));
|
preparedPairsMapInit.put(String.format("key_area_key_system_%02x", i), AppPreferences.getInstance().getSystemKey(i));
|
||||||
}
|
}
|
||||||
ListSelectorKAEKSysController.setList(preparedPairsMapInit);
|
ListSelectorKAEKSysController.setList(preparedPairsMapInit);
|
||||||
preparedPairsMapInit.clear();
|
preparedPairsMapInit.clear();
|
||||||
|
|
||||||
for (int i = 0; i < AppPreferences.getInstance().getTitleKeksCount(); i++){
|
for (int i = 0; i < AppPreferences.getInstance().getTitleKeksCount(); i++){
|
||||||
preparedPairsMapInit.put(String.format("titlekek_%02d", i), AppPreferences.getInstance().getTitleKek(i));
|
preparedPairsMapInit.put(String.format("titlekek_%02x", i), AppPreferences.getInstance().getTitleKek(i));
|
||||||
}
|
}
|
||||||
ListSelectorTitleKeksController.setList(preparedPairsMapInit);
|
ListSelectorTitleKeksController.setList(preparedPairsMapInit);
|
||||||
preparedPairsMapInit.clear();
|
preparedPairsMapInit.clear();
|
||||||
|
@ -143,32 +143,32 @@ public class SettingsController implements Initializable {
|
||||||
|
|
||||||
String keyParsed;
|
String keyParsed;
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
while ((keyParsed = fileMap.get(String.format("key_area_key_application_%02d", counter))) != null){
|
while ((keyParsed = fileMap.get(String.format("key_area_key_application_%02x", counter))) != null){
|
||||||
kaekSingle.put(String.format("key_area_key_application_%02d", counter), keyParsed);
|
kaekSingle.put(String.format("key_area_key_application_%02x", counter), keyParsed);
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
ListSelectorKAEKAppController.setList(kaekSingle);
|
ListSelectorKAEKAppController.setList(kaekSingle);
|
||||||
|
|
||||||
kaekSingle.clear();
|
kaekSingle.clear();
|
||||||
counter = 0;
|
counter = 0;
|
||||||
while ((keyParsed = fileMap.get(String.format("key_area_key_ocean_%02d", counter))) != null){
|
while ((keyParsed = fileMap.get(String.format("key_area_key_ocean_%02x", counter))) != null){
|
||||||
kaekSingle.put(String.format("key_area_key_ocean_%02d", counter), keyParsed);
|
kaekSingle.put(String.format("key_area_key_ocean_%02x", counter), keyParsed);
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
ListSelectorKAEKOceanController.setList(kaekSingle);
|
ListSelectorKAEKOceanController.setList(kaekSingle);
|
||||||
|
|
||||||
kaekSingle.clear();
|
kaekSingle.clear();
|
||||||
counter = 0;
|
counter = 0;
|
||||||
while ((keyParsed = fileMap.get(String.format("key_area_key_system_%02d", counter))) != null){
|
while ((keyParsed = fileMap.get(String.format("key_area_key_system_%02x", counter))) != null){
|
||||||
kaekSingle.put(String.format("key_area_key_system_%02d", counter), keyParsed);
|
kaekSingle.put(String.format("key_area_key_system_%02x", counter), keyParsed);
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
ListSelectorKAEKSysController.setList(kaekSingle);
|
ListSelectorKAEKSysController.setList(kaekSingle);
|
||||||
|
|
||||||
kaekSingle.clear();
|
kaekSingle.clear();
|
||||||
counter = 0;
|
counter = 0;
|
||||||
while ((keyParsed = fileMap.get(String.format("titlekek_%02d", counter))) != null){
|
while ((keyParsed = fileMap.get(String.format("titlekek_%02x", counter))) != null){
|
||||||
kaekSingle.put(String.format("titlekek_%02d", counter), keyParsed);
|
kaekSingle.put(String.format("titlekek_%02x", counter), keyParsed);
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
ListSelectorTitleKeksController.setList(kaekSingle);
|
ListSelectorTitleKeksController.setList(kaekSingle);
|
||||||
|
|
|
@ -194,13 +194,13 @@ public class NCAProvider {
|
||||||
String keyAreaKey;
|
String keyAreaKey;
|
||||||
switch (keyIndex){
|
switch (keyIndex){
|
||||||
case 0:
|
case 0:
|
||||||
keyAreaKey = keys.get(String.format("key_area_key_application_%02d", cryptoTypeReal));
|
keyAreaKey = keys.get(String.format("key_area_key_application_%02x", cryptoTypeReal));
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
keyAreaKey = keys.get(String.format("key_area_key_ocean_%02d", cryptoTypeReal));
|
keyAreaKey = keys.get(String.format("key_area_key_ocean_%02x", cryptoTypeReal));
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
keyAreaKey = keys.get(String.format("key_area_key_system_%02d", cryptoTypeReal));
|
keyAreaKey = keys.get(String.format("key_area_key_system_%02x", cryptoTypeReal));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
keyAreaKey = null;
|
keyAreaKey = null;
|
||||||
|
@ -231,7 +231,7 @@ public class NCAProvider {
|
||||||
exceptionStringBuilder.append(keyIndex);
|
exceptionStringBuilder.append(keyIndex);
|
||||||
exceptionStringBuilder.append("[UNKNOWN]_");
|
exceptionStringBuilder.append("[UNKNOWN]_");
|
||||||
}
|
}
|
||||||
exceptionStringBuilder.append(String.format("%02d", cryptoTypeReal));
|
exceptionStringBuilder.append(String.format("%02x", cryptoTypeReal));
|
||||||
exceptionStringBuilder.append(" requested. Not supported or not found.");
|
exceptionStringBuilder.append(" requested. Not supported or not found.");
|
||||||
|
|
||||||
throw new Exception(exceptionStringBuilder.toString());
|
throw new Exception(exceptionStringBuilder.toString());
|
||||||
|
@ -312,7 +312,7 @@ public class NCAProvider {
|
||||||
byte[] rightsIDkey = hexStrToByteArray(keys.get(byteArrToHexString(rightsId))); // throws NullPointerException
|
byte[] rightsIDkey = hexStrToByteArray(keys.get(byteArrToHexString(rightsId))); // throws NullPointerException
|
||||||
|
|
||||||
SecretKeySpec skSpec = new SecretKeySpec(
|
SecretKeySpec skSpec = new SecretKeySpec(
|
||||||
hexStrToByteArray(keys.get(String.format("titlekek_%02d", cryptoTypeReal))
|
hexStrToByteArray(keys.get(String.format("titlekek_%02x", cryptoTypeReal))
|
||||||
), "AES");
|
), "AES");
|
||||||
Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding");
|
Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding");
|
||||||
cipher.init(Cipher.DECRYPT_MODE, skSpec);
|
cipher.init(Cipher.DECRYPT_MODE, skSpec);
|
||||||
|
|
|
@ -107,26 +107,6 @@
|
||||||
</graphic>
|
</graphic>
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab closable="false">
|
<Tab closable="false">
|
||||||
<content>
|
|
||||||
<ScrollPane fitToWidth="true">
|
|
||||||
<content>
|
|
||||||
<VBox spacing="5.0">
|
|
||||||
<padding>
|
|
||||||
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
|
|
||||||
</padding>
|
|
||||||
<children>
|
|
||||||
<Label text="Title Keys" />
|
|
||||||
<Button fx:id="importTitleKeysBtn" mnemonicParsing="false" text="Import from title.keys">
|
|
||||||
<graphic>
|
|
||||||
<SVGPath content="M1,12H10.76L8.26,9.5L9.67,8.08L14.59,13L9.67,17.92L8.26,16.5L10.76,14H1V12M19,3C20.11,3 21,3.9 21,5V19A2,2 0 0,1 19,21H5C3.89,21 3,20.1 3,19V16H5V19H19V7H5V10H3V5A2,2 0 0,1 5,3H19Z" />
|
|
||||||
</graphic>
|
|
||||||
</Button>
|
|
||||||
<fx:include fx:id="ListSelectorTitleKeys" source="ListSelectorLayout.fxml" />
|
|
||||||
</children>
|
|
||||||
</VBox>
|
|
||||||
</content>
|
|
||||||
</ScrollPane>
|
|
||||||
</content>
|
|
||||||
<graphic>
|
<graphic>
|
||||||
<VBox alignment="TOP_CENTER" spacing="5.0">
|
<VBox alignment="TOP_CENTER" spacing="5.0">
|
||||||
<children>
|
<children>
|
||||||
|
@ -135,6 +115,22 @@
|
||||||
</children>
|
</children>
|
||||||
</VBox>
|
</VBox>
|
||||||
</graphic>
|
</graphic>
|
||||||
|
<content>
|
||||||
|
<VBox spacing="5.0">
|
||||||
|
<padding>
|
||||||
|
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
|
||||||
|
</padding>
|
||||||
|
<children>
|
||||||
|
<Label text="Title Keys" />
|
||||||
|
<Button fx:id="importTitleKeysBtn" mnemonicParsing="false" text="Import from title.keys">
|
||||||
|
<graphic>
|
||||||
|
<SVGPath content="M1,12H10.76L8.26,9.5L9.67,8.08L14.59,13L9.67,17.92L8.26,16.5L10.76,14H1V12M19,3C20.11,3 21,3.9 21,5V19A2,2 0 0,1 19,21H5C3.89,21 3,20.1 3,19V16H5V19H19V7H5V10H3V5A2,2 0 0,1 5,3H19Z" />
|
||||||
|
</graphic>
|
||||||
|
</Button>
|
||||||
|
<fx:include fx:id="ListSelectorTitleKeys" source="ListSelectorLayout.fxml" />
|
||||||
|
</children>
|
||||||
|
</VBox>
|
||||||
|
</content>
|
||||||
</Tab>
|
</Tab>
|
||||||
</tabs>
|
</tabs>
|
||||||
</TabPane>
|
</TabPane>
|
||||||
|
|
Loading…
Reference in a new issue