discord-exploits/exploits.go

196 lines
5.2 KiB
Go
Raw Normal View History

package main
import (
"fmt"
"github.com/Schmenn/discord-exploits/exploits"
"github.com/Schmenn/discord-exploits/modules"
2021-03-30 12:04:30 +00:00
"os"
"strings"
)
var (
quiet bool = false
inputFile string = "no input file provided"
mode string = "no mode specified"
)
func main() {
2021-03-30 12:04:30 +00:00
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
2021-01-12 10:36:43 +00:00
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) {
if strings.HasSuffix(inputFile, ".webm") {
switch mode {
case "e":
fmt.Println("editing video.")
exploits.RunExpandingVideoTask(inputFile)
fmt.Println("completed task.")
2021-03-30 12:04:30 +00:00
case "n":
fmt.Println("editing video.")
exploits.RunNegativeVideoTask(inputFile)
fmt.Println("completed task.")
2021-03-30 12:04:30 +00:00
case "0", "z":
fmt.Println("editing video.")
exploits.RunZeroVideoTask(inputFile)
fmt.Println("completed task.")
2021-03-30 12:04:30 +00:00
case "c":
fmt.Println("transcoding video from webm to mp4")
out := modules.Transcode(inputFile, "mp4")
fmt.Println("finished transcoding video from webm to mp4")
fmt.Println("editing video.")
exploits.RunCrashVideoTask(out)
fmt.Println("completed task.")
os.Remove(out)
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)
2021-03-30 12:04:30 +00:00
case "c":
fmt.Println("editing video.")
exploits.RunCrashVideoTask(inputFile)
fmt.Println("completed task.")
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") {
2021-03-30 12:04:30 +00:00
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)
2021-01-25 09:52:39 +00:00
} else if strings.HasSuffix(inputFile, ".ogg") {
2021-03-30 12:04:30 +00:00
if strings.ToLower(mode) != "t" || strings.ToLower(mode) == "no mode specified" {
2021-01-25 09:52:39 +00:00
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.")
2021-03-30 12:04:30 +00:00
2021-01-25 09:52:39 +00:00
} else if strings.HasSuffix(inputFile, ".mp3") {
2021-03-30 12:04:30 +00:00
if strings.ToLower(mode) != "t" || strings.ToLower(mode) == "no mode specified" {
2021-01-25 09:52:39 +00:00
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") {
2021-03-30 12:04:30 +00:00
if strings.ToLower(mode) != "t" || strings.ToLower(mode) == "no mode specified" {
2021-01-25 09:52:39 +00:00
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
}
}
}