FS Access Header done

This commit is contained in:
Dmitry Isaenko 2019-09-27 04:18:57 +03:00
parent 5566ff4a13
commit a69adf863e
14 changed files with 1681 additions and 35 deletions

View file

@ -0,0 +1,191 @@
package konogonka.Controllers.NPDM;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import konogonka.Tools.NPDM.ACI0.FSAccessHeaderProvider;
import java.net.URL;
import java.util.ResourceBundle;
import static konogonka.LoperConverter.byteArrToHexString;
import static konogonka.LoperConverter.longToOctString;
public class FSAccessHeaderController implements Initializable {
@FXML
private Label versionLbl,
paddingLbl,
permBitmskLbl,
dataSizeLbl,
sizeContOwnIdLbl,
dataSizePlusContOwnSizeLbl,
sizeOfSaveDataOwnSecLbl;
@FXML
private TextField unknownTf;
@FXML
private Label mask0,
mask1,
mask2,
mask3,
mask4,
mask5,
mask6,
mask7,
mask8,
mask9,
mask10,
mask11,
mask12,
mask13,
mask14,
mask15,
mask16,
mask17,
mask18,
mask19,
mask20,
mask21,
mask22,
mask23,
mask24,
mask25,
mask26,
mask27,
mask28,
mask29,
mask30,
mask31,
mask32,
mask33,
mask34,
mask35,
mask36,
mask37,
mask38,
mask39,
mask40,
mask41,
mask42,
mask43,
mask44,
mask45,
mask46,
mask47,
mask48,
mask49,
mask50,
mask51,
mask52,
mask53,
mask54,
mask55,
mask56,
mask57,
mask58,
mask59,
mask60,
mask61,
mask62,
mask63;
private Label[] masksArr;
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
masksArr = new Label[64];
masksArr[0] = mask0;
masksArr[1] = mask1;
masksArr[2] = mask2;
masksArr[3] = mask3;
masksArr[4] = mask4;
masksArr[5] = mask5;
masksArr[6] = mask6;
masksArr[7] = mask7;
masksArr[8] = mask8;
masksArr[9] = mask9;
masksArr[10] = mask10;
masksArr[11] = mask11;
masksArr[12] = mask12;
masksArr[13] = mask13;
masksArr[14] = mask14;
masksArr[15] = mask15;
masksArr[16] = mask16;
masksArr[17] = mask17;
masksArr[18] = mask18;
masksArr[19] = mask19;
masksArr[20] = mask20;
masksArr[21] = mask21;
masksArr[22] = mask22;
masksArr[23] = mask23;
masksArr[24] = mask24;
masksArr[25] = mask25;
masksArr[26] = mask26;
masksArr[27] = mask27;
masksArr[28] = mask28;
masksArr[29] = mask29;
masksArr[30] = mask30;
masksArr[31] = mask31;
masksArr[32] = mask32;
masksArr[33] = mask33;
masksArr[34] = mask34;
masksArr[35] = mask35;
masksArr[36] = mask36;
masksArr[37] = mask37;
masksArr[38] = mask38;
masksArr[39] = mask39;
masksArr[40] = mask40;
masksArr[41] = mask41;
masksArr[42] = mask42;
masksArr[43] = mask43;
masksArr[44] = mask44;
masksArr[45] = mask45;
masksArr[46] = mask46;
masksArr[47] = mask47;
masksArr[48] = mask48;
masksArr[49] = mask49;
masksArr[50] = mask50;
masksArr[51] = mask51;
masksArr[52] = mask52;
masksArr[53] = mask53;
masksArr[54] = mask54;
masksArr[55] = mask55;
masksArr[56] = mask56;
masksArr[57] = mask57;
masksArr[58] = mask58;
masksArr[59] = mask59;
masksArr[60] = mask60;
masksArr[61] = mask61;
masksArr[62] = mask62;
masksArr[63] = mask63;
}
public void resetTab() {
versionLbl.setText("-");
paddingLbl.setText("-");
permBitmskLbl.setText("-");
dataSizeLbl.setText("-");
sizeContOwnIdLbl.setText("-");
dataSizePlusContOwnSizeLbl.setText("-");
sizeOfSaveDataOwnSecLbl.setText("-");
unknownTf.setText("-");
}
public void populateFields(FSAccessHeaderProvider provider){
versionLbl.setText(Integer.toString(provider.getVersion()));
paddingLbl.setText(byteArrToHexString(provider.getPadding()));
StringBuilder sb = new StringBuilder(longToOctString(provider.getPermissionsBitmask()));
sb.reverse();
String mask = sb.toString();
permBitmskLbl.setText(mask);
dataSizeLbl.setText(Integer.toString(provider.getDataSize()));
sizeContOwnIdLbl.setText(Integer.toString(provider.getContentOwnIdSectionSize()));
dataSizePlusContOwnSizeLbl.setText(Integer.toString(provider.getDataNownerSizes()));
sizeOfSaveDataOwnSecLbl.setText(Integer.toString(provider.getSaveDataOwnSectionSize()));
unknownTf.setText(byteArrToHexString(provider.getUnknownData()));
for (int i = 0; i < 64; i++)
masksArr[i].setText(mask.substring(i, i+1));
}
}

View file

@ -6,7 +6,7 @@ import javafx.scene.control.Label;
import javafx.scene.control.Separator; import javafx.scene.control.Separator;
import javafx.scene.layout.HBox; import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox; import javafx.scene.layout.VBox;
import konogonka.Tools.NPDM.ACID.KernelAccessControlProvider; import konogonka.Tools.NPDM.KernelAccessControlProvider;
import java.util.Map; import java.util.Map;

View file

@ -6,7 +6,7 @@ import javafx.scene.control.Label;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;
import konogonka.Controllers.ITabController; import konogonka.Controllers.ITabController;
import konogonka.Tools.ISuperProvider; import konogonka.Tools.ISuperProvider;
import konogonka.Tools.NPDM.ACI0Provider; import konogonka.Tools.NPDM.ACI0.ACI0Provider;
import konogonka.Tools.NPDM.ACID.ACIDProvider; import konogonka.Tools.NPDM.ACID.ACIDProvider;
import konogonka.Tools.NPDM.NPDMProvider; import konogonka.Tools.NPDM.NPDMProvider;
import konogonka.Workers.Analyzer; import konogonka.Workers.Analyzer;
@ -78,16 +78,15 @@ public class NPDMController implements ITabController {
//ACID //ACID
@FXML @FXML
private FSAccessControlController ACIDFSAccessControlTableController; private FSAccessControlController ACIDFSAccessControlTableController;
@FXML @FXML
private ServiceAccessControlController ACIDServiceAccessControlTableController; private ServiceAccessControlController ACIDServiceAccessControlTableController;
@FXML @FXML
private KernelAccessControlController ACIDKernelAccessControlTableController; private KernelAccessControlController ACIDKernelAccessControlTableController;
// ACI0 // ACI0
@FXML @FXML
private FSAccessHeaderController ACI0FSAccessHeaderTableController;
@FXML
private ServiceAccessControlController ACI0ServiceAccessControlTableController; private ServiceAccessControlController ACI0ServiceAccessControlTableController;
@FXML @FXML
private KernelAccessControlController ACI0KernelAccessControlTableController; private KernelAccessControlController ACI0KernelAccessControlTableController;
@ -174,13 +173,14 @@ public class NPDMController implements ITabController {
acidKernelAccessControlOffsetLbl.setText("-"); acidKernelAccessControlOffsetLbl.setText("-");
acidKernelAccessControlSizeLbl.setText("-"); acidKernelAccessControlSizeLbl.setText("-");
acidReserved2Lbl.setText("-"); acidReserved2Lbl.setText("-");
// ACI0
ACI0FSAccessHeaderTableController.resetTab();
ACI0ServiceAccessControlTableController.resetTab();
ACI0KernelAccessControlTableController.resetTab();
// ACID // ACID
ACIDFSAccessControlTableController.resetTab(); ACIDFSAccessControlTableController.resetTab();
ACIDServiceAccessControlTableController.resetTab(); ACIDServiceAccessControlTableController.resetTab();
ACIDKernelAccessControlTableController.resetTab(); ACIDKernelAccessControlTableController.resetTab();
// ACI0
ACI0ServiceAccessControlTableController.resetTab();
ACI0KernelAccessControlTableController.resetTab();
} }
private void setData(NPDMProvider npdmProvider, File file) { private void setData(NPDMProvider npdmProvider, File file) {
if (npdmProvider == null) if (npdmProvider == null)
@ -221,7 +221,7 @@ public class NPDMController implements ITabController {
aci0KernelAccessControlSizeLbl.setText(Integer.toString(aci0.getKernelAccessControlSize())); aci0KernelAccessControlSizeLbl.setText(Integer.toString(aci0.getKernelAccessControlSize()));
aci0Reserved3Lbl.setText(byteArrToHexString(aci0.getReserved3())); aci0Reserved3Lbl.setText(byteArrToHexString(aci0.getReserved3()));
ACI0FSAccessHeaderTableController.populateFields(aci0.getFsAccessHeaderProvider());
ACI0ServiceAccessControlTableController.populateFields(aci0.getServiceAccessControlProvider().getCollection()); ACI0ServiceAccessControlTableController.populateFields(aci0.getServiceAccessControlProvider().getCollection());
ACI0KernelAccessControlTableController.populateFields(aci0.getKernelAccessControlProvider()); ACI0KernelAccessControlTableController.populateFields(aci0.getKernelAccessControlProvider());
// ACID // ACID

View file

@ -1,7 +1,7 @@
package konogonka.Tools.NPDM; package konogonka.Tools.NPDM.ACI0;
import konogonka.Tools.NPDM.ACID.KernelAccessControlProvider; import konogonka.Tools.NPDM.KernelAccessControlProvider;
import konogonka.Tools.NPDM.ACID.ServiceAccessControlProvider; import konogonka.Tools.NPDM.ServiceAccessControlProvider;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.Arrays; import java.util.Arrays;

View file

@ -1,7 +1,6 @@
package konogonka.Tools.NPDM; package konogonka.Tools.NPDM.ACI0;
import konogonka.LoperConverter; import konogonka.LoperConverter;
import konogonka.RainbowHexDump;
import java.util.Arrays; import java.util.Arrays;
@ -28,21 +27,6 @@ public class FSAccessHeaderProvider {
dataNownerSizes = LoperConverter.getLEint(bytes, 0x14); dataNownerSizes = LoperConverter.getLEint(bytes, 0x14);
saveDataOwnSectionSize = LoperConverter.getLEint(bytes, 0x18); saveDataOwnSectionSize = LoperConverter.getLEint(bytes, 0x18);
unknownData = Arrays.copyOfRange(bytes, 0x1C, bytes.length); unknownData = Arrays.copyOfRange(bytes, 0x1C, bytes.length);
//
System.out.println("version "+version);
System.out.print("padding ");
RainbowHexDump.hexDumpUTF8(padding);
System.out.print("Permissions Bitmask ");
RainbowHexDump.octDumpLong(permissionsBitmask);
System.out.println(
"DataSize "+dataSize+"\n"+
"Content OwnId Section Size "+contentOwnIdSectionSize+"\n"+
"Data + owner "+dataNownerSizes+"\n"+
"Save Data Own Section Size "+saveDataOwnSectionSize
);
RainbowHexDump.hexDumpUTF8(Arrays.copyOfRange(bytes, 0x1C, bytes.length));
//*/
//reserved = Arrays.copyOfRange(bytes, 0xC, 0x2C);
} }
public byte getVersion() { return version; } public byte getVersion() { return version; }

View file

@ -1,6 +1,7 @@
package konogonka.Tools.NPDM.ACID; package konogonka.Tools.NPDM.ACID;
import konogonka.Tools.NPDM.ACI0Provider; import konogonka.Tools.NPDM.KernelAccessControlProvider;
import konogonka.Tools.NPDM.ServiceAccessControlProvider;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.Arrays; import java.util.Arrays;

View file

@ -1,4 +1,4 @@
package konogonka.Tools.NPDM.ACID; package konogonka.Tools.NPDM;
import konogonka.LoperConverter; import konogonka.LoperConverter;
import konogonka.RainbowHexDump; import konogonka.RainbowHexDump;

View file

@ -1,6 +1,7 @@
package konogonka.Tools.NPDM; package konogonka.Tools.NPDM;
import konogonka.Tools.ASuperInFileProvider; import konogonka.Tools.ASuperInFileProvider;
import konogonka.Tools.NPDM.ACI0.ACI0Provider;
import konogonka.Tools.NPDM.ACID.ACIDProvider; import konogonka.Tools.NPDM.ACID.ACIDProvider;
import java.io.*; import java.io.*;

View file

@ -1,4 +1,4 @@
package konogonka.Tools.NPDM.ACID; package konogonka.Tools.NPDM;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;

View file

@ -14,7 +14,7 @@
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<VBox xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="konogonka.Controllers.NPDM.FSAccessControlController"> <VBox xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="konogonka.Controllers.NPDM.FSAccessControlController">
<TitledPane text="FS Access Control"> <TitledPane expanded="false" text="FS Access Control">
<VBox.margin> <VBox.margin>
<Insets bottom="5.0" /> <Insets bottom="5.0" />
</VBox.margin> </VBox.margin>

File diff suppressed because it is too large Load diff

View file

@ -12,7 +12,7 @@
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<VBox xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="konogonka.Controllers.NPDM.KernelAccessControlController"> <VBox xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="konogonka.Controllers.NPDM.KernelAccessControlController">
<TitledPane text="Kernel Access Control"> <TitledPane expanded="false" text="Kernel Access Control">
<VBox.margin> <VBox.margin>
<Insets bottom="5.0" /> <Insets bottom="5.0" />
</VBox.margin> </VBox.margin>

View file

@ -735,6 +735,7 @@
</Label> </Label>
</children> </children>
</GridPane> </GridPane>
<fx:include fx:id="ACI0FSAccessHeaderTable" source="FSAccessHeaderTable.fxml" />
<fx:include fx:id="ACI0ServiceAccessControlTable" source="ServiceAccessControlTable.fxml" /> <fx:include fx:id="ACI0ServiceAccessControlTable" source="ServiceAccessControlTable.fxml" />
<fx:include fx:id="ACI0KernelAccessControlTable" source="KernelAccessControlTable.fxml" /> <fx:include fx:id="ACI0KernelAccessControlTable" source="KernelAccessControlTable.fxml" />
</children> </children>

View file

@ -8,7 +8,7 @@
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<VBox xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="konogonka.Controllers.NPDM.ServiceAccessControlController"> <VBox xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="konogonka.Controllers.NPDM.ServiceAccessControlController">
<TitledPane text="Service Access Control"> <TitledPane expanded="false" text="Service Access Control">
<content> <content>
<VBox> <VBox>
<children> <children>