-
Notifications
You must be signed in to change notification settings - Fork 33
/
main.go
99 lines (90 loc) · 2.15 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package main
import (
"fmt"
"io/ioutil"
"github.com/iskaa02/qalam/gradient"
"github.com/TwiN/go-color"
"strconv"
"github.com/ANG13T/DroneXtract/helpers"
"os"
"github.com/ANG13T/DroneXtract/parsing"
"github.com/ANG13T/DroneXtract/steganography"
"github.com/ANG13T/DroneXtract/telemetry"
"github.com/ANG13T/DroneXtract/analysis"
)
var category_banners = []string{"fileparsing.txt", "telemetrymapping.txt", "steganography.txt"}
var option_values = []int{5, 4, 6}
func Banner() {
banner, _ := ioutil.ReadFile("txt/banner.txt")
info, _ := ioutil.ReadFile("txt/info.txt")
options, _ := ioutil.ReadFile("txt/options.txt")
g,_:=gradient.NewGradient("#1179ef", "cyan")
g.Print("\n" + string(banner))
fmt.Println(color.Ize(color.Cyan, string(info)))
fmt.Println(color.Ize(color.Cyan, string(options) + "\n"))
}
func Option() {
fmt.Print("\n ENTER INPUT > ")
var selection string
fmt.Scanln(&selection)
num, err := strconv.Atoi(selection)
if err != nil {
fmt.Println(color.Ize(color.Red, " [!] INVALID INPUT"))
Option()
} else {
if (num >= 0 && num < 5) {
DisplayOption(num)
} else {
fmt.Println(color.Ize(color.Red, " [!] INVALID INPUT"))
Option()
}
}
}
func DisplayOption(x int) {
if (x == 0) {
fmt.Println(color.Ize(color.Blue, " Farewell and fly high!"))
os.Exit(1)
} else if (x == 5) {
Banner()
Option()
} else if (x > 0 && x < 5) {
DisplayOptionInformation(x)
} else {
helpers.PrintError("INVALID INPUT")
Option()
}
}
func DisplayOptionInformation(option int) {
returnVal := 0
if (option == 4) {
analysis.ExecuteAnalysis()
Banner()
Option()
} else {
contents, _ := ioutil.ReadFile("txt/" + category_banners[option - 1])
fmt.Println(color.Ize(color.Cyan, string(contents)))
returnVal = helpers.Option(0, option_values[option - 1])
}
if (returnVal == -1) {
Banner()
Option()
} else {
if (option == 1) {
parsing.ExecuteParser(returnVal)
Banner()
Option()
} else if (option == 2) {
telemetry.ExecuteTelemetry(returnVal)
Banner()
Option()
} else {
steganography.ExecuteSteganography(returnVal)
Banner()
Option()
}
}
}
func main() {
Banner()
Option()
}