});
for (File file : files) {
Parser parser = new FileParser(file);
parser.parse();
IMG img = parser.getIMG();
Header header = img.getImgHeader();
PartitionTable partitionTable = header.getPartitionTable();
System.out.println("IMG " + img.getName() + " - " + file.length());
System.out.println("XOR'd " +header.isXorEd());
System.out.println("XOR byte " + header.getXorByte());
System.out.println("Update month " + header.getUpdateMonth());
System.out.println("Update year " + header.getUpdateYear());
System.out.println("Checksum " + header.getChecksum());
System.out.println("Signature " + header.getSignature());
System.out.println("Creation date " + header.getCreationDate());
System.out.println("Map file identifier " + header.getMapFileIdentifier());
System.out.println("Description " + header.getDescription() + "...");
System.out.println("Exponent1 " + header.getBlockSizeExponent1());
System.out.println("Exponent2 " + header.getBlockSizeExponent2());
System.out.println("Boot " + partitionTable.getBoot());
System.out.println("Start head " + partitionTable.getStartHead());
System.out.println("Start sector " + partitionTable.getStartSector());
System.out.println("Start cylinder " + partitionTable.getStartCylinder());
System.out.println("System type " + partitionTable.getSystemType());
System.out.println("End head " + partitionTable.getEndHead());
System.out.println("End sector " + partitionTable.getEndSector());
System.out.println("End cylinder " + partitionTable.getEndCylinder());
System.out.println("Rel sectors " + partitionTable.getRelSectors());
System.out.println("Number of sectors " + partitionTable.getNumberOfSectors());
System.out.println("Block size " + header.getFatBlockSize());
System.out.println("Header size " + header.getHeaderSize());
System.out.println("First subfile offset " + header.getFirstSubfileOffset());
System.out.println("Block sequence count " + header.getBlockSequence().size());
System.out.println("Blocks total size " + header.getFatBlocksTotalSize());
for (FATBlock fatBlock : header.getFatBlocks()) {
System.out.println(" Block type " + fatBlock.getType());
System.out.println(" Subfile name " + fatBlock.getSubfileName());
System.out.println(" Subfile type " + fatBlock.getSubfileType());
System.out.println(" Subfile part " + fatBlock.getSubfilePart());
System.out.println(" Subfile size " + fatBlock.getSubfileSizeInBytes());
System.out.println(" Subfile offset " + fatBlock.getSubfileOffset());
System.out.println(" Block sequence count " + fatBlock.getBlockSequence().size());
}
for (Subfile subfile : img.getSubfiles()) {
System.out.println(" Subfile type " + subfile.getCommonHeader().getType());
System.out.println(" Headers length " + subfile.getCommonHeader().getHeadersLength());
System.out.println(" Offset " + subfile.getOffset());
switch (subfile.getCommonHeader().getType()) {
case TRE: