-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvirusScanCreateLinks.ahk
88 lines (71 loc) · 2.12 KB
/
virusScanCreateLinks.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
*********************************************************************************
*
* virusScanCreateLinks.ahk
*
* Sourcecode uses UTF-8 BOM, Resulting file uses ANSI codec
*
* Creates links (to be appended to the readme-file) using the latest scan results only
*
* Version: no versioning
*
* Copyright (c) 2024 jvr.de. All rights reserved.
*
*
*********************************************************************************
*/
/*
*********************************************************************************
*
* GNU GENERAL PUBLIC LICENSE
*
* A copy is included in the file "license.txt"
*
*********************************************************************************
*/
#Requires Autohotkey v2+
#SingleInstance Force
#Warn
FileEncoding "UTF-8"
inputFileName := "_virusscanresults.txt"
outputFileName := "_virusscanLinks.txt"
virusscanResults := Map()
Loop read, inputFileName {
if (StrLen(A_LoopReadLine) > 10){
line := StrSplit(A_LoopReadLine, ",")
if (virusscanResults.Has(line[1]))
virusscanResults.Delete(line[1])
virusscanResults.Set(line[1], line[2])
}
}
output := ""
inCleaned := ""
for (k, v in virusscanResults){
n := "[Virusscan at Virustotal, " k " 64bit-exe, Check here](" v ") `n"
output .= n
inCleaned .= k "," v "`n"
}
If (FileExist(outputFileName))
FileDelete outputFileName
FileAppend output, outputFileName, "`n CP0"
; create a new "cleaned" inputfile
If (FileExist(inputFileName))
FileDelete inputFileName
FileAppend inCleaned, inputFileName, "`n CP0"
showHintColoredTop("Created: " virusscanResults.Count " entries!")
return
;---------------------------- showHintColoredTop ----------------------------
showHintColoredTop(s := "", n := 3000, fg := "cFFFFFF", bg := "a900ff"){
global
local t
hintColored := Gui("+0x80000000 -Caption +ToolWindow +AlwaysOnTop")
hintColored.SetFont("c" fg)
hintColored.BackColor := bg
hintColored.add("Text", , s)
hintColored.Show("y10 xcenter")
if (n > 0){
sleep(n)
hintColored.Destroy()
}
}
;----------------------------------------------------------------------------