-
Notifications
You must be signed in to change notification settings - Fork 14
/
exploits.go
230 lines (197 loc) · 6.07 KB
/
exploits.go
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
package main
import (
"fmt"
"os"
"strings"
"github.com/Schmenn/discord-exploits/exploits"
"github.com/Schmenn/discord-exploits/modules"
)
var (
quiet bool = false
inputFile string = "no input file provided"
mode string = "no mode specified"
)
func main() {
args := os.Args[1:]
handleArgs(args, &quiet)
if !quiet {
modules.Welcome()
}
fmt.Println("input file: " + inputFile)
fmt.Println("mode: " + mode)
initCommand(inputFile, mode)
}
func handleArgs(args []string, quiet *bool) {
for i, s := range args {
switch s {
// Quiet
case "-q", "--quiet":
*quiet = true
// Input File
case "-i":
inputFile = args[i+1]
// Mode Selection
case "-m":
mode = args[i+1]
// Help Message
case "-h":
modules.Help(os.Args[0])
*quiet = true
return
default:
break
}
}
}
/*func initCommand(inputFile string, mode string) {
inputFile = strings.ToLower(inputFile)
switch strings.ToLower(mode) {
case "e":
if strings.HasSuffix(inputFile, ".webm") {
fmt.Println("editing video.")
exploits.RunExpandingVideoTask(inputFile)
fmt.Println("completed task.")
} else {
fmt.Println("File is not a webm or mp4, check -h")
}
case "n":
if strings.HasSuffix(inputFile, ".webm") {
fmt.Println("editing video.")
exploits.RunNegativeVideoTask(inputFile)
fmt.Println("completed task.")
} else {
fmt.Println("File is not a webm, check -h")
}
case "0", "z":
if strings.HasSuffix(inputFile, ".webm") {
fmt.Println("editing video.")
exploits.RunZeroVideoTask(inputFile)
fmt.Println("completed task.")
} else {
fmt.Println("File is not a webm, check -h")
}
case "v":
if strings.HasSuffix(inputFile, ".png") {
fmt.Println("editing photo.")
exploits.RunVirusImageTask(inputFile)
fmt.Println("completed task.")
} else {
fmt.Println("File is not a png, check -h")
}
}
}
*/
func initCommand(inputFile string, mode string) {
inputFile = strings.ToLower(inputFile)
if strings.HasSuffix(inputFile, ".webm") {
switch mode {
case "e":
fmt.Println("editing video.")
exploits.RunExpandingVideoTask(inputFile)
fmt.Println("completed task.")
case "n":
fmt.Println("editing video.")
exploits.RunNegativeVideoTask(inputFile)
fmt.Println("completed task.")
case "0", "z":
fmt.Println("editing video.")
exploits.RunZeroVideoTask(inputFile)
fmt.Println("completed task.")
default:
fmt.Println("the mode doesn't match the file")
}
} else if strings.HasSuffix(inputFile, ".mp4") {
switch mode {
case "e":
fmt.Println("transcoding video from mp4 to webm")
out := modules.Transcode(inputFile, "webm")
fmt.Println("finished transcoding video from mp4 to webm")
fmt.Println("editing video.")
exploits.RunExpandingVideoTask(out)
fmt.Println("completed task.")
os.Remove(out)
case "n":
fmt.Println("transcoding video from mp4 to webm")
out := modules.Transcode(inputFile, "webm")
fmt.Println("finished transcoding video from mp4 to webm")
fmt.Println("editing video.")
exploits.RunNegativeVideoTask(out)
fmt.Println("completed task.")
os.Remove(out)
case "0", "z":
fmt.Println("transcoding video from mp4 to webm")
out := modules.Transcode(inputFile, "webm")
fmt.Println("finished transcoding video from mp4 to webm")
fmt.Println("editing video.")
exploits.RunZeroVideoTask(out)
fmt.Println("completed task.")
os.Remove(out)
default:
fmt.Println("the mode doesn't match the file")
}
} else if strings.HasSuffix(inputFile, ".png") {
fmt.Println("editing photo.")
exploits.RunVirusImageTask(inputFile)
fmt.Println("completed task.")
} else if strings.HasSuffix(inputFile, ".jpg") {
fmt.Println("transcoding image from jpg to png")
out := modules.Transcode(inputFile, "png")
fmt.Println("finished transcoding image from jpg to png")
fmt.Println("editing photo.")
exploits.RunVirusImageTask(out)
fmt.Println("completed task.")
os.Remove(out)
} else if strings.HasSuffix(inputFile, ".jpeg") {
if strings.ToLower(mode) != "v" || strings.ToLower(mode) == "no mode specified"{
fmt.Println("the mode is not compatible with the image, proceeding to run the virus image task anyway")
}
fmt.Println("transcoding image from jpeg to png")
out := modules.Transcode(inputFile, "png")
fmt.Println("finished transcoding image from jpeg to png")
fmt.Println("editing photo.")
exploits.RunVirusImageTask(out)
fmt.Println("completed task.")
os.Remove(out)
} else if strings.HasSuffix(inputFile, ".ogg") {
if strings.ToLower(mode) != "t" || strings.ToLower(mode) == "no mode specified"{
fmt.Println("the mode is not compatible with the audio file, proceeding to run the play-twice task anyway")
}
fmt.Println("editing audio.")
exploits.RunTwiceAudioTask(inputFile)
fmt.Println("completed task.")
} else if strings.HasSuffix(inputFile, ".mp3") {
if strings.ToLower(mode) != "t" || strings.ToLower(mode) == "no mode specified"{
fmt.Println("the mode is not compatible with the audio file, proceeding to run the play-twice task anyway")
}
fmt.Println("transcoding audio from mp3 to ogg")
out := modules.Transcode(inputFile, "ogg")
fmt.Println("finished transcoding audio from mp3 to ogg")
fmt.Println("editing audio.")
exploits.RunTwiceAudioTask(out)
fmt.Println("completed task.")
os.Remove(out)
} else if strings.HasSuffix(inputFile, ".m4a") {
if strings.ToLower(mode) != "t" || strings.ToLower(mode) == "no mode specified"{
fmt.Println("the mode is not compatible with the audio file, proceeding to run the play-twice task anyway")
}
fmt.Println("transcoding audio from m4a to ogg")
out := modules.Transcode(inputFile, "ogg")
fmt.Println("finished transcoding audio from m4a to ogg")
fmt.Println("editing audio.")
exploits.RunTwiceAudioTask(out)
fmt.Println("completed task.")
os.Remove(out)
} else {
if inputFile == "no input file provided" {
return
}
}
}
/*func test() {
data, err := twice.Asset("twice.ogg")
modules.Check(err)
testData, err := ioutil.ReadFile("test.ogg")
modules.Check(err)
data = append(data, testData...)
ioutil.WriteFile("testFinal.ogg", data, 0777)
}*/