myph.git


myph

~ shellcode loader for your evasion needs
git clone https://github.com/matro7sh/myph.git
log | files | refs | archive | README | LICENSE

hash_function.go (856B)

      1 package main
      2 
      3 import (
      4 	"fmt"
      5 	"os"
      6 
      7 	hash "github.com/cmepw/myph/internals"
      8 	"github.com/spf13/cobra"
      9 )
     10 
     11 func main() {
     12 
     13 	var rootCmd = &cobra.Command{
     14 		Use:   "hash",
     15 		Short: "hash-command",
     16 		Long:  `Computes the hash for a given function or library name`,
     17 		Run: func(cmd *cobra.Command, args []string) {
     18 
     19 			if len(args) != 1 {
     20 				fmt.Println("hash-command only accepts one argument")
     21 				os.Exit(1)
     22 			}
     23 
     24 			toHash := args[0]
     25 
     26 			fmt.Printf("\t{\n\t\tName: \"%s\",\n", toHash)
     27 			fmt.Printf("\t\tSha1: \"%s\",\n", hash.HashSHA1(toHash))
     28 			fmt.Printf("\t\tSha256: \"%s\",\n", hash.HashSHA256(toHash))
     29 			fmt.Printf("\t\tSha512: \"%s\",\n", hash.HashSHA512(toHash))
     30 			fmt.Printf("\t\tDjb2: \"%s\",\n", hash.HashDJB2(toHash))
     31 
     32 			fmt.Printf("\t},\n")
     33 
     34 		},
     35 	}
     36 
     37 	err := rootCmd.Execute()
     38 	if err != nil {
     39 		fmt.Println(err.Error())
     40 		os.Exit(1)
     41 	}
     42 }