I hereby claim:
- I am grantseltzer on github.
- I am grantseltzer (https://keybase.io/grantseltzer) on keybase.
- I have a public key ASC1UD_DnAXkpdEZ7hClPkfFE9Sif-Sara8gPPscSOMHSAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| package main | |
| import "fmt" | |
| func cappy() { | |
| x := [23]string{} | |
| x[0] = ` _______ _______ _______ _______ _ _______ _____ ` | |
| x[1] = `( ____ \( ___ )( ____ )( ____ \|\ /|( \ ( ____ \ / ___ \ ` | |
| x[2] = `| ( \/| ( ) || ( )|| ( \/| ) ( || ( | ( \/ ( (___) )` | |
| x[3] = `| | | (___) || (____)|| (_____ | | | || | | (__ \ / ` |
| function chrome() { | |
| docker run \ | |
| --rm \ | |
| --security-opt seccomp=$HOME/.seccomp/chrome.json \ | |
| --net=host \ | |
| --memory 512mb \ | |
| --cpuset-cpus 0 \ | |
| -e DISPLAY=unix$DISPLAY \ | |
| -v $HOME/Downloads:$HOME/Downloads \ |
| package main | |
| import "fmt" | |
| func main() { | |
| fmt.Println("this is a test") | |
| } |
| // A Symbol represents an entry in an ELF symbol table section. | |
| type Symbol struct { | |
| Name string | |
| Info byte | |
| Other byte | |
| Section SectionIndex | |
| Value uint64 | |
| Size uint64 | |
| } |
| // Open the ELF file | |
| elfFile, err := elf.Open(path) | |
| if err != nil { | |
| log.Fatalf("error while opening ELF file %s: %+s", path, err.Error()) | |
| } | |
| // Extract the symbol table | |
| symbolTable, err := elfFile.Symbols() | |
| if err != nil { | |
| log.Fatalf("could not extract symbol table: %s", err.Error()) |
| input := []byte{0x64, 0x48, 0x8B, 0xC, 0x25, 0xF8, 0xFF, 0xFF, 0xFF} | |
| instructions, err := engine.Disasm(input, 0, 0) | |
| if err != nil { | |
| log.Fatal(err) | |
| } | |
| for _, instruction := range instructions { | |
| fmt.Printf("0x%x:\t%s\t\t%s\n", instruction.Address, instruction.Mnemonic, instruction.OpStr) | |
| } |
| // extract the .text section | |
| textSection := elfFile.Section(".text") | |
| if textSection == nil { | |
| log.Fatal("No text section") | |
| } | |
| // extract the raw bytes from the .text section | |
| textSectionData, err := textSection.Data() | |
| if err != nil { | |
| log.Fatal(err) |
| package main | |
| import ( | |
| "debug/elf" | |
| "fmt" | |
| "log" | |
| "os" | |
| "github.com/bnagy/gapstone" | |
| ) |
| engine, err := gapstone.New( | |
| gapstone.CS_ARCH_X86, | |
| gapstone.CS_MODE_64, | |
| ) | |
| if err != nil { | |
| log.Fatal(err) | |
| } |