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