Skip to content

Instantly share code, notes, and snippets.

@debedb
Created July 20, 2015 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save debedb/b88ac06149cbad75b4de to your computer and use it in GitHub Desktop.
Save debedb/b88ac06149cbad75b4de to your computer and use it in GitHub Desktop.
package main
import (
"bytes"
"encoding/base64"
"encoding/binary"
"fmt"
"os"
)
func main() {
var cookie [4]uint32
cookieStr := os.Args[1]
data, err := base64.StdEncoding.DecodeString(cookieStr)
if err != nil {
panic(err.Error())
}
b := []byte(data)
buf := bytes.NewReader(b)
err = binary.Read(buf, binary.LittleEndian, &cookie)
if err != nil {
panic(err.Error())
}
fmt.Printf("%08X%08X%08X%08X\n", cookie[0], cookie[1], cookie[2], cookie[3])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment