Skip to content

Instantly share code, notes, and snippets.

@willnix
Created March 26, 2013 23:52
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 willnix/5250386 to your computer and use it in GitHub Desktop.
Save willnix/5250386 to your computer and use it in GitHub Desktop.
vortex0
package main
import (
"bufio"
"encoding/binary"
"fmt"
"log"
)
type num [4]uint32
func (n *num) sum() {
tmp := 0
for i := 0; i < len(n); i += 1 {
sum += i
}
}
func main() {
conn, err := net.Dial("tcp", "vortex.labs.overthewire.org:5842")
if err != nil {
log.Fatal(err)
}
defer conn.Close()
bufReader := bufio.NewReader(conn)
var challenge num
err = binary.Read(bufReader, binary.LittleEndian, challenge)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Sum: %s\n", challenge.sum())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment