mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 14:11:29 +00:00
Extend parse_fingerprint_file for FP processing tools to get MatchPoints only
This commit is contained in:
@@ -973,7 +973,7 @@ FingerPrint *parse_single_fingerprint(const FingerPrintDB *DB, const char *fprin
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FingerPrintDB *parse_fingerprint_file(const char *fname) {
|
FingerPrintDB *parse_fingerprint_file(const char *fname, bool points_only) {
|
||||||
FingerPrintDB *DB = NULL;
|
FingerPrintDB *DB = NULL;
|
||||||
FingerPrint *current;
|
FingerPrint *current;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@@ -999,6 +999,8 @@ top:
|
|||||||
fparse:
|
fparse:
|
||||||
if (strncmp(line, "Fingerprint", 11) == 0) {
|
if (strncmp(line, "Fingerprint", 11) == 0) {
|
||||||
parsingMatchPoints = false;
|
parsingMatchPoints = false;
|
||||||
|
if (points_only)
|
||||||
|
break;
|
||||||
current = new FingerPrint;
|
current = new FingerPrint;
|
||||||
} else if (strncmp(line, "MatchPoints", 11) == 0) {
|
} else if (strncmp(line, "MatchPoints", 11) == 0) {
|
||||||
if (DB->MatchPoints)
|
if (DB->MatchPoints)
|
||||||
@@ -1089,5 +1091,5 @@ FingerPrintDB *parse_fingerprint_reference_file(const char *dbname) {
|
|||||||
/* Record where this data file was found. */
|
/* Record where this data file was found. */
|
||||||
o.loaded_data_files[dbname] = filename;
|
o.loaded_data_files[dbname] = filename;
|
||||||
|
|
||||||
return parse_fingerprint_file(filename);
|
return parse_fingerprint_file(filename, false);
|
||||||
}
|
}
|
||||||
|
|||||||
2
osscan.h
2
osscan.h
@@ -245,7 +245,7 @@ FingerPrint *parse_single_fingerprint(const char *fprint_orig);
|
|||||||
/* These functions take a file/db name and open+parse it, returning an
|
/* These functions take a file/db name and open+parse it, returning an
|
||||||
(allocated) FingerPrintDB containing the results. They exit with
|
(allocated) FingerPrintDB containing the results. They exit with
|
||||||
an error message in the case of error. */
|
an error message in the case of error. */
|
||||||
FingerPrintDB *parse_fingerprint_file(const char *fname);
|
FingerPrintDB *parse_fingerprint_file(const char *fname, bool points_only);
|
||||||
FingerPrintDB *parse_fingerprint_reference_file(const char *dbname);
|
FingerPrintDB *parse_fingerprint_reference_file(const char *dbname);
|
||||||
|
|
||||||
void free_fingerprint_file(FingerPrintDB *DB);
|
void free_fingerprint_file(FingerPrintDB *DB);
|
||||||
|
|||||||
Reference in New Issue
Block a user