golang hex address convert little endian

2022_08_20_21_49_54.png


package main

import (
    "bytes"
    "encoding/binary"
    "fmt"
)

func main() {
    buf1 := new(bytes.Buffer)
    err := binary.Write(buf1, binary.LittleEndian, int32(0x41101503))
    if err != nil {
        fmt.Println("binary.Write failed:", err)
    }
    // fmt.Printf("%# s\n", buf1)
    fmt.Printf("0x%x\n", buf1)
    fmt.Printf("0x%X\n", buf1)
}


Ref

  • 《Black Hat Go: Go Programming For Hackers and Pentesters》

你可能感兴趣的:(golang hex address convert little endian)