44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
66 * You may obtain a copy of the License at
7- *
7+ *
88 * http://www.apache.org/licenses/LICENSE-2.0
9- *
9+ *
1010 * Unless required by applicable law or agreed to in writing, software
1111 * distributed under the License is distributed on an "AS IS" BASIS,
1212 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -235,7 +235,6 @@ private void doRun(TaskMonitor realMonitor) throws CancelledException {
235235 monitor .doIncrementProgress ();
236236 }
237237
238-
239238 // This is the first of the "speculative" post-correlator match algorithm. The correlator
240239 // returns all duplicate function instruction matches so there will always be more
241240 // than one possible match for each function. The compare mechanism used by the
@@ -255,7 +254,7 @@ private void doRun(TaskMonitor realMonitor) throws CancelledException {
255254 // if Auto VT min function length for dupe matches is different than current
256255 // exact instruction match setting temporarily change it for auto VT run
257256 int dupFunctionMinLen =
258- toolOptions .getInt (VTOptionDefines .DUPE_FUNCTION_CORRELATOR_MIN_LEN_OPTION , 10 );
257+ toolOptions .getInt (VTOptionDefines .DUPE_FUNCTION_CORRELATOR_MIN_LEN_OPTION , 25 );
259258
260259 vtOptions .setInt (
261260 ExactMatchInstructionsProgramCorrelatorFactory .FUNCTION_MINIMUM_SIZE ,
@@ -279,9 +278,10 @@ private void doRun(TaskMonitor realMonitor) throws CancelledException {
279278 toolOptions .getBoolean (VTOptionDefines .RUN_REF_CORRELATORS_OPTION , true );
280279 if (runRefCorrelators ) {
281280
282- double minScore = toolOptions .getDouble (VTOptionDefines .REF_CORRELATOR_MIN_SCORE_OPTION , 0.95 );
283- double minConf = toolOptions .getDouble (VTOptionDefines .REF_CORRELATOR_MIN_CONF_OPTION , 10.0 );
284-
281+ double minScore =
282+ toolOptions .getDouble (VTOptionDefines .REF_CORRELATOR_MIN_SCORE_OPTION , 0.95 );
283+ double minConf =
284+ toolOptions .getDouble (VTOptionDefines .REF_CORRELATOR_MIN_CONF_OPTION , 10.0 );
285285
286286 // Get the number of data and function matches
287287 int numDataMatches = getNumberOfDataMatches (monitor );
@@ -497,32 +497,31 @@ private Set<VTMatch> findGoodImpliedMatches(Collection<VTMatch> matchesToProcess
497497 int minVoteCountNeeded , int maxConflictsAllowed ,
498498 TaskMonitor monitor ) throws CancelledException {
499499
500-
501500 Set <VTMatch > goodImpliedMatches = new HashSet <>();
502501
503502 for (VTMatch match : matchesToProcess ) {
504- monitor .checkCancelled ();
503+ monitor .checkCancelled ();
505504
506- VTAssociation association = match .getAssociation ();
505+ VTAssociation association = match .getAssociation ();
507506
508- // skip if already accepted or blocked match
509- if (association .getStatus () != VTAssociationStatus .AVAILABLE ) {
510- continue ;
511- }
507+ // skip if already accepted or blocked match
508+ if (association .getStatus () != VTAssociationStatus .AVAILABLE ) {
509+ continue ;
510+ }
512511
513- // skip if there are any conflicting associations
514- int numConflicts = association .getRelatedAssociations ().size () - 1 ;
515- if (numConflicts > maxConflictsAllowed ) {
516- continue ;
517- }
512+ // skip if there are any conflicting associations
513+ int numConflicts = association .getRelatedAssociations ().size () - 1 ;
514+ if (numConflicts > maxConflictsAllowed ) {
515+ continue ;
516+ }
518517
519- int voteCount = association .getVoteCount ();
518+ int voteCount = association .getVoteCount ();
520519
521- if (voteCount >= minVoteCountNeeded ) {
522- goodImpliedMatches .add (match );
523- }
520+ if (voteCount >= minVoteCountNeeded ) {
521+ goodImpliedMatches .add (match );
522+ }
524523
525- monitor .incrementProgress ();
524+ monitor .incrementProgress ();
526525 }
527526
528527 return goodImpliedMatches ;
@@ -893,7 +892,6 @@ private VTMatch getAssociationMatchFromMatchSet(VTAssociation association,
893892 return null ;
894893 }
895894
896-
897895 /**
898896 * From the given related association, ie a group of src/dest pairs of functions with identical
899897 * instructions, use operand information to find any unique matches in the set.
@@ -907,7 +905,6 @@ private List<VTAssociation> findUniqueAssociations(
907905 Collection <VTAssociation > relatedAssociations , TaskMonitor monitor )
908906 throws CancelledException {
909907
910-
911908 // create function to operand map maps for each source and destination function
912909 // in the given related associations (src/dst function pairs)
913910 Map <Function , Map <Long , Map <Integer , Object >>> sourceFunctionsMap =
@@ -916,7 +913,6 @@ private List<VTAssociation> findUniqueAssociations(
916913 Map <Function , Map <Long , Map <Integer , Object >>> destFunctionsMap =
917914 createFunctionsMap (relatedAssociations , false , monitor );
918915
919-
920916 // only functions with scalar or address operands are mapped so the lists could be
921917 // empty if there are functions with no operand info to be mapped
922918 if (sourceFunctionsMap .isEmpty () || destFunctionsMap .isEmpty ()) {
@@ -1032,7 +1028,6 @@ private Map<Function, Map<Long, Map<Integer, Object>>> createFunctionsMap(
10321028 return functionsMap ;
10331029 }
10341030
1035-
10361031 /**
10371032 * Using the given source function's map and a list of destination function maps, and a list
10381033 * of destination functions to omit because they already have found matches, try to find a
@@ -1214,7 +1209,6 @@ private boolean isSameOperandType(Address addr1, Address addr2) {
12141209 */
12151210 private boolean hasAnyAssociations (Address source , Address dest ) {
12161211
1217-
12181212 Collection <VTAssociation > sourceAssociations = session .getAssociationManager ()
12191213 .getRelatedAssociationsBySourceAddress (source );
12201214
@@ -1261,7 +1255,6 @@ private Map<Long, Map<Integer, Object>> mapFunctionScalarAndAddressOperands(
12611255 throws CancelledException {
12621256
12631257 Map <Long , Map <Integer , Object >> offsetToOperandsMap = new HashMap <>();
1264-
12651258
12661259 Program program = function .getProgram ();
12671260
@@ -1278,7 +1271,7 @@ private Map<Long, Map<Integer, Object>> mapFunctionScalarAndAddressOperands(
12781271 if (map .keySet ().isEmpty ()) {
12791272 continue ;
12801273 }
1281-
1274+
12821275 // get offset from top of function to use in function to operandMap map
12831276 // can be positive or negative offset (positive means instruction address is after
12841277 // the entry address, negative means instruction address is before entry address)
0 commit comments