mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GP-652 Minor correction and cleanup of CoffArchive support
This commit is contained in:
@@ -17,10 +17,7 @@ package ghidra.app.util.bin.format.coff.archive;
|
|||||||
|
|
||||||
public final class CoffArchiveConstants {
|
public final class CoffArchiveConstants {
|
||||||
|
|
||||||
public final static String MAGIC = "!<arch>\n";
|
public static final String MAGIC = "!<arch>\n";
|
||||||
public final static int MAGIC_LEN = MAGIC.length();
|
public static final int MAGIC_LEN = MAGIC.length();
|
||||||
public static final int MAGIC_LEN_CONST_EXPR = 8;
|
|
||||||
public static final byte[] MAGIC_BYTES = MAGIC.getBytes();
|
public static final byte[] MAGIC_BYTES = MAGIC.getBytes();
|
||||||
|
|
||||||
public final static String END_OF_HEADER_MAGIC = "'\n";
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ public final class CoffArchiveHeader implements StructConverter {
|
|||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public static boolean isMatch(ByteProvider provider) throws IOException {
|
public static boolean isMatch(ByteProvider provider) throws IOException {
|
||||||
return (provider.length() > 2) && CoffArchiveConstants.MAGIC.equals(
|
return (provider.length() > CoffArchiveConstants.MAGIC_LEN) && CoffArchiveConstants.MAGIC
|
||||||
new String(provider.readBytes(0, CoffArchiveConstants.MAGIC_LEN)));
|
.equals(new String(provider.readBytes(0, CoffArchiveConstants.MAGIC_LEN)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import utilities.util.ArrayUtilities;
|
|||||||
public class CoffArchiveFileSystemFactory
|
public class CoffArchiveFileSystemFactory
|
||||||
implements GFileSystemFactoryFull<CoffArchiveFileSystem>, GFileSystemProbeBytesOnly {
|
implements GFileSystemFactoryFull<CoffArchiveFileSystem>, GFileSystemProbeBytesOnly {
|
||||||
|
|
||||||
public static final int PROBE_BYTES_REQUIRED = CoffArchiveConstants.MAGIC_LEN_CONST_EXPR;
|
public static final int PROBE_BYTES_REQUIRED = CoffArchiveConstants.MAGIC_LEN;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CoffArchiveFileSystem create(FSRL containerFSRL, FSRLRoot targetFSRL,
|
public CoffArchiveFileSystem create(FSRL containerFSRL, FSRLRoot targetFSRL,
|
||||||
|
|||||||
Reference in New Issue
Block a user