Packing
Last updated
Last updated
Packing with the in-built python struct
module is often a pain with loads of unnecessary options to remember. pwntools makes this a breeze, using the context
global variable to automatically calculate how the packing should work.
Packs addr
depending on context
, which by default is little-endian.
Unpacks data
depending on context
; exact opposite of p64()
.
Can take a bunch of arguments and packs them all according to context
. The full functionality is quite , but essentially:
is equivalent to:
flat()
uses context
, so unless you specify that it is 64 bits it will attempt to pack it as 32 bits.