@@ -93,7 +93,7 @@ object DetectionHeuristic {
9393 private type OptionMap = scala.collection.mutable.Map [Symbol , String ]
9494
9595 def main (args : Array [String ]): Unit = {
96- invokeCLI(args)
96+ testHeuristics();
9797 }
9898
9999 private def invokeCLI (args : Array [String ]): Unit = {
@@ -166,7 +166,7 @@ object DetectionHeuristic {
166166 }
167167 }
168168 private def testHeuristics (): Unit = {
169- val folder = new File (" /home/deque/portextestfiles/badfiles " )
169+ val folder = new File (" /home/deque/portextestfiles/x64viruses " )
170170 val threshholdA = 0.99
171171 val threshholdB = 0.80
172172 val threshholdC = 0.50
@@ -190,9 +190,9 @@ object DetectionHeuristic {
190190 }
191191 if (total % 1000 == 0 ) {
192192 println(" files read: " + total)
193- println(" malicious by threshhold 0.99: " + malcounterA + " ratio " + (malcounterA.toDouble / total.toDouble))
194- println(" malicious by threshhold 0.80: " + malcounterB + " ratio " + (malcounterB.toDouble / total.toDouble))
195- println(" malicious by threshhold 0.50: " + malcounterC + " ratio " + (malcounterC.toDouble / total.toDouble))
193+ println(" malicious by threshold 0.99: " + malcounterA + " ratio " + (malcounterA.toDouble / total.toDouble))
194+ println(" malicious by threshold 0.80: " + malcounterB + " ratio " + (malcounterB.toDouble / total.toDouble))
195+ println(" malicious by threshold 0.50: " + malcounterC + " ratio " + (malcounterC.toDouble / total.toDouble))
196196 }
197197 } catch {
198198 case e : FileFormatException => notLoaded += 1 ; System .err.println(" file is no PE file: " + file.getName());
@@ -201,9 +201,9 @@ object DetectionHeuristic {
201201 }
202202 total -= notLoaded
203203 println(" files read: " + total)
204- println(" malicious by threshhold 0.99: " + malcounterA + " ratio " + (malcounterA.toDouble / total.toDouble))
205- println(" malicious by threshhold 0.80: " + malcounterB + " ratio " + (malcounterB.toDouble / total.toDouble))
206- println(" malicious by threshhold 0.50: " + malcounterC + " ratio " + (malcounterC.toDouble / total.toDouble))
204+ println(" malicious by threshold 0.99: " + malcounterA + " ratio " + (malcounterA.toDouble / total.toDouble))
205+ println(" malicious by threshold 0.80: " + malcounterB + " ratio " + (malcounterB.toDouble / total.toDouble))
206+ println(" malicious by threshold 0.50: " + malcounterC + " ratio " + (malcounterC.toDouble / total.toDouble))
207207 }
208208
209209 def newInstance (file : File ): DetectionHeuristic = apply(file)
0 commit comments