mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-08-08 07:40:39 -09:00
GP-7124: MotorolaHexLoader parsing improvement
This commit is contained in:
@@ -77,10 +77,12 @@ public class MotorolaHexLoader extends AbstractProgramLoader {
|
||||
}
|
||||
|
||||
static boolean isPossibleHexFile(ByteProvider provider) {
|
||||
final int MAX_BLANK_LINES = 100;
|
||||
try (BoundedBufferedReader reader =
|
||||
new BoundedBufferedReader(new InputStreamReader(provider.getInputStream(0)))) {
|
||||
int i = 0;
|
||||
String line = reader.readLine();
|
||||
while (line.matches("^\\s*$")) {
|
||||
while (i++ < MAX_BLANK_LINES && line.isBlank()) {
|
||||
line = reader.readLine();
|
||||
}
|
||||
return line.matches("^[S:][0-9a-fA-F]+$");
|
||||
|
||||
Reference in New Issue
Block a user