discord-exploits/exploits/virus-image.go
Schmenn a77abe5c32 switched to embedded files
a giant slice of bytes is never pretty
2021-04-05 14:24:52 +02:00

30 lines
546 B
Go

package exploits
import (
_ "embed" // embed
"fmt"
"github.com/Schmenn/discord-exploits/modules"
"os"
)
var (
//go:embed virus1.txt
vpng1 []byte
//go:embed virus2.txt
vpng2 []byte
vpng = append(vpng1, vpng2...)
)
// RunVirusImageTask edits file
func RunVirusImageTask(fileName string) {
data, err := os.ReadFile(fileName)
modules.Check(err)
data = append(data, vpng...)
name := modules.CreateName("png")
fmt.Println("Saved video to: " + name)
err = os.WriteFile(name, data, os.FileMode(0777))
if err != nil {
panic(err)
}
}