mirror of
https://github.com/Schmenn/discord-exploits.git
synced 2024-12-22 21:45:30 +00:00
[^] /exploits | removed ioutil as it is deprecated [^] /modules/transcode.go | removed annoying ffmpeg output [^] go.mod | changed to go 1.16 [^] exploits.go | removed comment
40 lines
792 B
Go
40 lines
792 B
Go
package exploits
|
|
|
|
import (
|
|
"bytes"
|
|
"fmt"
|
|
"github.com/Schmenn/discord-exploits/modules"
|
|
"os"
|
|
)
|
|
|
|
// RunZeroVideoTask edits file so it has got a duration of 0
|
|
func RunZeroVideoTask(fileName string) {
|
|
|
|
data, err := os.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] = 0
|
|
data[index+4] = 0
|
|
data[index+5] = 0
|
|
data[index+6] = 0
|
|
data[index+7] = 0
|
|
data[index+8] = 0
|
|
data[index+9] = 0
|
|
data[index+10] = 0
|
|
|
|
name := modules.CreateName("webm")
|
|
|
|
fmt.Println(name)
|
|
|
|
err = os.WriteFile(name, data, os.FileMode(0777))
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|