-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
50 lines (44 loc) · 863 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package main
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"os"
"strconv"
"strings"
"github.com/parzel/GoBofRunner/bof"
)
func main() {
rawCoff, err := ioutil.ReadFile(os.Args[1])
if err != nil {
log.Fatal(err)
}
bofArgs := bof.BOFArgsBuffer{
Buffer: new(bytes.Buffer),
}
for _, arg := range os.Args[1:] {
a := strings.SplitN(arg, ":", 2)
switch a[0] {
case "integer":
fallthrough
case "int":
x, _ := strconv.Atoi(a[1])
err = bofArgs.AddInt(uint32(x))
case "string":
err = bofArgs.AddString(a[1])
case "wstring":
err = bofArgs.AddWString(a[1])
case "short":
x, _ := strconv.Atoi(a[1])
err = bofArgs.AddShort(uint16(x))
}
if err != nil {
return
}
}
BeaconData, _ := bofArgs.GetBuffer()
fmt.Printf("Beacondata: %x\n", BeaconData)
output := bof.ParseCoff(rawCoff, BeaconData)
fmt.Println(output)
}