#NEWLINE# def nmap_search( sigs ) : #NEWLINE# #INDENT# guess = ( 0 , [ ] ) #NEWLINE# for ( os , fp ) in nmap_kdb . get_base ( ) : #NEWLINE# #INDENT# c = 0.0 #NEWLINE# for t in sigs . keys ( ) : #NEWLINE# #INDENT# if ( t in fp ) : #NEWLINE# #INDENT# c += nmap_match_one_sig ( sigs [ t ] , fp [ t ] ) #NEWLINE# #UNINDENT# #UNINDENT# c /= len ( sigs . keys ( ) ) #NEWLINE# if ( c > guess [ 0 ] ) : #NEWLINE# #INDENT# guess = ( c , [ os ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( c == guess [ 0 ] ) : #NEWLINE# #INDENT# guess [ 1 ] . append ( os ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return guess