Skip to content

Commit 6a737b1

Browse files
Merge pull request #1 from battleoverflow/v1.0.3
v1.0.3
2 parents abf683f + b934db5 commit 6a737b1

File tree

5 files changed

+41
-49
lines changed

5 files changed

+41
-49
lines changed

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/*.md

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@
55
"search.exclude": {
66
"out": true
77
},
8-
98
"typescript.tsc.autoDetect": "off"
109
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vsioc",
33
"displayName": "vsioc",
44
"description": "Visual Studio Code IOC Extractor",
5-
"version": "1.0.2",
5+
"version": "1.0.3",
66
"publisher": "battleoverflow",
77
"homepage": "https://github.com/battleoverflow/vsioc",
88
"license": "GPL-3.0",

src/index.ts

Lines changed: 37 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,21 @@ export const activate = (context: vscode.ExtensionContext) => {
5353
if (!activeTextEditor) return
5454
if (!activeTextEditor.document.uri.fsPath) return
5555
}
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+
})
5671
}
5772

5873
class CustomSidebarViewProvider implements vscode.WebviewViewProvider {
@@ -113,36 +128,35 @@ const getHtml = (stylesheetUri: vscode.Uri) => {
113128
</head>
114129
<body>
115130
<section>
131+
<h2>URLs:</h2>
132+
<p>${iocUrls}</p>
116133
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>
122136
123-
<h2>Ipv6s:</h2>
124-
<p>${iocIpv6s}</p>
137+
<h2>Ipv6s:</h2>
138+
<p>${iocIpv6s}</p>
125139
126-
<h2>Domains:</h2>
127-
<p>${iocDomains}</p>
140+
<h2>Domains:</h2>
141+
<p>${iocDomains}</p>
128142
129-
<h2>Emails:</h2>
130-
<p>${iocEmails}</p>
143+
<h2>Emails:</h2>
144+
<p>${iocEmails}</p>
131145
132-
<h2>MD5s:</h2>
133-
<p>${iocMd5s}</p>
146+
<h2>MD5s:</h2>
147+
<p>${iocMd5s}</p>
134148
135-
<h2>Sha1s:</h2>
136-
<p>${iocSha1s}</p>
149+
<h2>Sha1s:</h2>
150+
<p>${iocSha1s}</p>
137151
138-
<h2>Sha256s:</h2>
139-
<p>${iocSha256s}</p>
152+
<h2>Sha256s:</h2>
153+
<p>${iocSha256s}</p>
140154
141-
<h2>Sha512s:</h2>
142-
<p>${iocSha512s}</p>
155+
<h2>Sha512s:</h2>
156+
<p>${iocSha512s}</p>
143157
144-
<h2>Mac Addresses:</h2>
145-
<p>${iocMacAddresses}</p>
158+
<h2>Mac Addresses:</h2>
159+
<p>${iocMacAddresses}</p>
146160
147161
</section>
148162
</body>
@@ -158,30 +172,8 @@ const getIOCs = (typeOfIoc: string): string => {
158172

159173
const document: vscode.TextDocument = activeTextEditor.document
160174

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))
185177
}
186178

187179
const iocExtractor = (

0 commit comments

Comments
 (0)