e = ELF("./executable")
structmodule and the
struct.pack()function, these functions have a host of options that we simply do not need or are hard to remember in which case we need which arguments. This is where pwntools comes in.
p32()takes in an integer and returns the representation of that integer as a series of bytes, much like
p32(0xdeadc0de) == b"\xde\xc0\xad\xde"
u32()does quite the opposite - takes in a series of bytes and returns the integer representation of them, much like
u32(b"\xde\xc0\xad\xde") == 0xdeadc0de
u32()but are for 64-bit binaries.
context.endian = 'little'makes all future
u32()functions (as well as other similar ones) use little endian, meaning you don't have to specify every time you use the function.