diff --git a/src/com/pnf/plugin/fat/FatPlugin.java b/src/com/pnf/plugin/fat/FatPlugin.java index 92363f8..bdbf93b 100644 --- a/src/com/pnf/plugin/fat/FatPlugin.java +++ b/src/com/pnf/plugin/fat/FatPlugin.java @@ -33,7 +33,7 @@ import com.pnfsoftware.jeb.util.logging.ILogger; public class FatPlugin extends AbstractUnitIdentifier { - private static final String ID = "fat_plugin"; + static final String ID = "fat"; private static final int[] FAT_BOOT_SIG = { (byte)0x55, (byte)0xAA }; private static final int FAT_BOOT_SIG_OFFSET = 0x200 - FAT_BOOT_SIG.length; private static final int[] OBB_SIG = { (byte)0x83, (byte)0x99, (byte)0x05, (byte)0x01 }; @@ -59,13 +59,8 @@ public boolean canIdentify(IInput stream, IUnitCreator unit) { isObb = false; } - return !isObb && checkBytes(stream, FAT_BOOT_SIG_OFFSET, FAT_BOOT_SIG); // Then - // check - // for - // FAT - // boot - // sector - // signature + // Then check for FAT boot sector signature + return !isObb && checkBytes(stream, FAT_BOOT_SIG_OFFSET, FAT_BOOT_SIG); } public void initialize(IPropertyDefinitionManager parent) { @@ -82,6 +77,7 @@ public IUnit prepare(String name, IInput data, IUnitProcessor processor, IUnitCr @Override public PluginInformation getPluginInformation() { - return new PluginInformation("FAT Plugin", "", "PNF Software", new Version(1, 0, 0)); + return new PluginInformation("FAT Plugin", "Parser for FAT filesystem images", "PNF Software", new Version(1, + 0, 0)); } } diff --git a/src/com/pnf/plugin/fat/FatProcessor.java b/src/com/pnf/plugin/fat/FatProcessor.java index bb465eb..7ba5194 100644 --- a/src/com/pnf/plugin/fat/FatProcessor.java +++ b/src/com/pnf/plugin/fat/FatProcessor.java @@ -48,15 +48,17 @@ public class FatProcessor { */ public FatProcessor(String name, byte[] stream) { try { - RamDisk rd = RamDisk.read(stream); // Create in-memory - // representation of disk image - image = FatFileSystem.read(rd, true); // Open as read-only to - // prevent accidental writes + // Create in-memory representation of disk image + RamDisk rd = RamDisk.read(stream); + + // Open as read-only to prevent accidental writes + image = FatFileSystem.read(rd, true); } catch(IOException e) { } - type = image.getFatType().toString(); // Store type of FAT image + // Store type of FAT image + type = image.getFatType().toString(); root = new ContainerStream(null, name, false); /* Create list of files */ @@ -107,11 +109,8 @@ private void addAll(ContainerStream parentDir, FsDirectory fatDir) { readError = true; } - new DocumentStream(parentDir, e.getName(), buff, readError); // constructor - // handles - // adding - // to - // parent + // constructor handles adding to parent + new DocumentStream(parentDir, e.getName(), buff, readError); } } } diff --git a/src/com/pnf/plugin/fat/FatUnit.java b/src/com/pnf/plugin/fat/FatUnit.java index d638f90..7d22ae7 100644 --- a/src/com/pnf/plugin/fat/FatUnit.java +++ b/src/com/pnf/plugin/fat/FatUnit.java @@ -35,13 +35,12 @@ import com.pnfsoftware.jeb.util.IO; public class FatUnit extends AbstractBinaryUnit { - private static final String FILE_TYPE = "fat_image"; private StringBuffer desc; private boolean descSet = false; public FatUnit(String name, IInput data, IUnitProcessor unitProcessor, IUnitCreator parent, IPropertyDefinitionManager pdm) { - super(null, data, FILE_TYPE, name, unitProcessor, parent, pdm); + super(null, data, FatPlugin.ID, name, unitProcessor, parent, pdm); } public String getDescription() {