/** * Runs file identification for the binary file specified by targetFile * * @param targetFile The binary file to be identified */ public void runFileIdentification(IByteReader targetFile) { //record all positive identifications for (int iSig = 0; iSig < this.getNumInternalSignatures(); iSig++) { InternalSignature internalSig = this.getInternalSignature(iSig); //System.out.println("============================ Running identification for signature ID = "+internalSig.getID()+ " ==========================="); if (internalSig.isFileCompliant(targetFile)) { //File matches this internal signature targetFile.SetPositiveIdentification(); for (int i = 0; i < internalSig.getNumFileFormats(); i++) { FileFormatHit fileHit = new FileFormatHit(internalSig.getFileFormat(i), AnalysisController.HIT_TYPE_POSITIVE_GENERIC_OR_SPECIFIC, internalSig.isSpecific(), ""); targetFile.AddHit(fileHit); } } } //remove any hits for which there is a higher priority hit if (targetFile.GetNumberOfHits() > 1) { this.removeLowerPriorityHits(targetFile); } //carry out file extension checking this.checkExtension(targetFile); // if there are still no hits then classify as unidentified if (targetFile.GetNumberOfHits() == 0) { targetFile.SetNoIdentification(); } }
IList <InternalSignature> intSigs = new List <InternalSignature>(); //ArrayList(); #endregion #region Public Methods /* setters */ public void addInternalSignature(InternalSignature iSig) { intSigs.Add(iSig); }
IList<InternalSignature> intSigs = new List<InternalSignature>(); //ArrayList(); #endregion #region Public Methods /* setters */ public void addInternalSignature(InternalSignature iSig) { intSigs.Add(iSig); }