-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
64 lines (56 loc) · 1.64 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
package main
import (
"fmt"
"os"
"path/filepath"
"github.com/spf13/cobra"
"github.com/akiym/akitools/cmd/binary2png"
"github.com/akiym/akitools/cmd/command_wrapper"
"github.com/akiym/akitools/cmd/d"
"github.com/akiym/akitools/cmd/gadgets"
"github.com/akiym/akitools/cmd/gistwrapper"
"github.com/akiym/akitools/cmd/git_branch_recent"
"github.com/akiym/akitools/cmd/jwt"
"github.com/akiym/akitools/cmd/libc_offsets"
"github.com/akiym/akitools/cmd/noln"
"github.com/akiym/akitools/cmd/o"
"github.com/akiym/akitools/cmd/random_string"
"github.com/akiym/akitools/cmd/rotn"
"github.com/akiym/akitools/cmd/shellcode"
"github.com/akiym/akitools/cmd/tobin"
"github.com/akiym/akitools/cmd/tohex"
)
var version = "0.0.1"
var revision = "HEAD"
func main() {
rootCmd := &cobra.Command{
Use: "akitools <command>",
Version: fmt.Sprintf("%s (revision:%s)", version, revision),
SilenceUsage: true,
}
rootCmd.AddCommand(binary2png.Cmd)
rootCmd.AddCommand(command_wrapper.Cmd)
rootCmd.AddCommand(d.Cmd)
rootCmd.AddCommand(gadgets.Cmd)
rootCmd.AddCommand(gistwrapper.Cmd)
rootCmd.AddCommand(git_branch_recent.Cmd)
rootCmd.AddCommand(jwt.Cmd)
rootCmd.AddCommand(libc_offsets.Cmd)
rootCmd.AddCommand(noln.Cmd)
rootCmd.AddCommand(o.Cmd)
rootCmd.AddCommand(random_string.Cmd)
rootCmd.AddCommand(rotn.Cmd)
rootCmd.AddCommand(shellcode.Cmd)
rootCmd.AddCommand(tobin.Cmd)
rootCmd.AddCommand(tohex.Cmd)
argv0 := filepath.Base(os.Args[0])
for _, cmd := range rootCmd.Commands() {
if argv0 == cmd.Name() {
rootCmd.SetArgs(append([]string{argv0}, os.Args[1:]...))
break
}
}
if err := rootCmd.Execute(); err != nil {
os.Exit(1)
}
}