Skip to content

Instantly share code, notes, and snippets.

@debedb debedb/decoder.go
Created Jul 20, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.