p32 or p64 or struct ?
tags: ctf,pwn
p32 or p64 or struct ?
>>> from pwn import *
>>> import struct
>>> p32(0xdeadbeef)
'\xef\xbe\xad\xde'
>>> struct.pack("I",0xdeadbeef) == p32(0xdeadbeef)
True
>>> p64(0xdeadbeef)
'\xef\xbe\xad\xde\x00\x00\x00\x00'
>>> struct.pack("l",0xdeadbeef) == p64(0xdeadbeef)
True