Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
pointer to bytes
size := unsafe.Sizeof(ptr)
eip := make([]byte, size)
switch size {
case 4: binary.LittleEndian.PutUint32(eip, uint32(ptr))
case 8: binary.LittleEndian.PutUint64(eip, uint64(ptr))
default: panic(fmt.Sprintf(“unknown uintptr size: %v”, size))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment