discord-exploits/exploits.go

107 lines
2.1 KiB
Go
Raw Normal View History

package main
import (
"fmt"
"github.com/Schmenn/discord-exploits/exploits"
"github.com/Schmenn/discord-exploits/modules"
"os"
"strings"
)
var (
quiet bool = false
inputFile string = "no input file provided"
mode string = "no mode specified"
//skipArg int = 0
)
func main() {
args := os.Args[1:]
handleArgs(args, &quiet)
//fmt.Println(quiet)
if !quiet {
modules.Welcome()
//exploits.RunExpandingVideoTask()
}
fmt.Println("input file: " + inputFile)
fmt.Println("mode: " + mode)
initCommand(inputFile, mode)
}
func handleArgs(args []string, quiet *bool) {
/*if skipArg > 0 {
skipArg = skipArg - 1
return
}*/
for i, s := range args {
switch s {
// quiet
case "-q":
*quiet = true
case "--quiet":
*quiet = true
// Input File
case "-i":
//skipArg++
inputFile = args[i+1]
// Mode Selection
case "-m":
//skipArg++
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 "expandingvideo":
if strings.HasSuffix(inputFile, ".webm") {
fmt.Println("editing video.")
exploits.RunExpandingVideoTask(inputFile)
fmt.Println("completed task.")
} else {
fmt.Println("File is not a webm, check -h")
}
case "negativevideo":
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 "zerovideo":
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 "virusimage":
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")
}
}
}