Package ghidra.app.util.recognizer
Interface Recognizer
-
- All Superinterfaces:
ExtensionPoint
public interface Recognizer extends ExtensionPoint
NOTE: ALL Recognizer CLASSES MUST END IN "Recognizer". If not, the ClassSearcher will not find them.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getPriority()
Return the recognizer priority; for instance, a GZIP/TAR recognizer should have higher priority than just the GZIP recognizer (because the GZIP/TAR will unzip part of the payload and then test against the TAR recognizer...so every GZIP/TAR match will also match GZIP).int
numberOfBytesRequired()
How many bytes (maximum) does this recognizer need to recognize its format?java.lang.String
recognize(byte[] bytes)
Ask the recognizer to recognize some bytes.
-
-
-
Method Detail
-
numberOfBytesRequired
int numberOfBytesRequired()
How many bytes (maximum) does this recognizer need to recognize its format?- Returns:
- the maximum number of bytes needed to send to this recognizer in the recognize(...) method
-
recognize
java.lang.String recognize(byte[] bytes)
Ask the recognizer to recognize some bytes. Return a description String if recognized; otherwise, null. DO NOT MUNGE THE BYTES. Right now for efficiency's sake the array of bytes is just passed to each recognizer in turn. Abuse this and we will need to create copies, and everyone loses.- Parameters:
bytes
- the bytes to recognize- Returns:
- a String description of the recognition, or null if it is not recognized
-
getPriority
int getPriority()
Return the recognizer priority; for instance, a GZIP/TAR recognizer should have higher priority than just the GZIP recognizer (because the GZIP/TAR will unzip part of the payload and then test against the TAR recognizer...so every GZIP/TAR match will also match GZIP). Note that higher is more specific, which is opposite the convention used with the Loader hierarchy.- Returns:
- the recognizer priority
-
-