@@ -53,6 +53,21 @@ export const activate = (context: vscode.ExtensionContext) => {
53
53
if ( ! activeTextEditor ) return
54
54
if ( ! activeTextEditor . document . uri . fsPath ) return
55
55
}
56
+
57
+ // Small message to signify the activation of the extension
58
+ // Apparently, VS Code decided to not include new lines in their notification API for the corner notifications
59
+ // So for now, we're just gonna have to put everything on the same line
60
+ const githubUrl = "github.com/battleoverflow"
61
+
62
+ vscode . window
63
+ . showInformationMessage ( "VSIOC Activated" , githubUrl )
64
+ . then ( ( selection ) => {
65
+ if ( selection === githubUrl ) {
66
+ vscode . env . openExternal (
67
+ vscode . Uri . parse ( `https://${ githubUrl } ` )
68
+ )
69
+ }
70
+ } )
56
71
}
57
72
58
73
class CustomSidebarViewProvider implements vscode . WebviewViewProvider {
@@ -113,36 +128,35 @@ const getHtml = (stylesheetUri: vscode.Uri) => {
113
128
</head>
114
129
<body>
115
130
<section>
131
+ <h2>URLs:</h2>
132
+ <p>${ iocUrls } </p>
116
133
117
- <h2>URLs:</h2>
118
- <p>${ iocUrls } </p>
119
-
120
- <h2>IPv4s:</h2>
121
- <p>${ iocIpv4s } </p>
134
+ <h2>IPv4s:</h2>
135
+ <p>${ iocIpv4s } </p>
122
136
123
- <h2>Ipv6s:</h2>
124
- <p>${ iocIpv6s } </p>
137
+ <h2>Ipv6s:</h2>
138
+ <p>${ iocIpv6s } </p>
125
139
126
- <h2>Domains:</h2>
127
- <p>${ iocDomains } </p>
140
+ <h2>Domains:</h2>
141
+ <p>${ iocDomains } </p>
128
142
129
- <h2>Emails:</h2>
130
- <p>${ iocEmails } </p>
143
+ <h2>Emails:</h2>
144
+ <p>${ iocEmails } </p>
131
145
132
- <h2>MD5s:</h2>
133
- <p>${ iocMd5s } </p>
146
+ <h2>MD5s:</h2>
147
+ <p>${ iocMd5s } </p>
134
148
135
- <h2>Sha1s:</h2>
136
- <p>${ iocSha1s } </p>
149
+ <h2>Sha1s:</h2>
150
+ <p>${ iocSha1s } </p>
137
151
138
- <h2>Sha256s:</h2>
139
- <p>${ iocSha256s } </p>
152
+ <h2>Sha256s:</h2>
153
+ <p>${ iocSha256s } </p>
140
154
141
- <h2>Sha512s:</h2>
142
- <p>${ iocSha512s } </p>
155
+ <h2>Sha512s:</h2>
156
+ <p>${ iocSha512s } </p>
143
157
144
- <h2>Mac Addresses:</h2>
145
- <p>${ iocMacAddresses } </p>
158
+ <h2>Mac Addresses:</h2>
159
+ <p>${ iocMacAddresses } </p>
146
160
147
161
</section>
148
162
</body>
@@ -158,30 +172,8 @@ const getIOCs = (typeOfIoc: string): string => {
158
172
159
173
const document : vscode . TextDocument = activeTextEditor . document
160
174
161
- switch ( typeOfIoc ) {
162
- case "url" :
163
- return JSON . stringify ( iocExtractor ( document , "url" ) )
164
- case "ipv4" :
165
- return JSON . stringify ( iocExtractor ( document , "ipv4" ) )
166
- case "ipv6" :
167
- return JSON . stringify ( iocExtractor ( document , "ipv6" ) )
168
- case "domain" :
169
- return JSON . stringify ( iocExtractor ( document , "domain" ) )
170
- case "email" :
171
- return JSON . stringify ( iocExtractor ( document , "email" ) )
172
- case "md5" :
173
- return JSON . stringify ( iocExtractor ( document , "md5" ) )
174
- case "sha1" :
175
- return JSON . stringify ( iocExtractor ( document , "sha1" ) )
176
- case "sha256" :
177
- return JSON . stringify ( iocExtractor ( document , "sha256" ) )
178
- case "sha512" :
179
- return JSON . stringify ( iocExtractor ( document , "sha512" ) )
180
- case "mac" :
181
- return JSON . stringify ( iocExtractor ( document , "mac" ) )
182
- default :
183
- return JSON . stringify ( iocExtractor ( document , "" ) )
184
- }
175
+ // Extract IOCs based on the type of IOC
176
+ return JSON . stringify ( iocExtractor ( document , typeOfIoc ) )
185
177
}
186
178
187
179
const iocExtractor = (
0 commit comments