Function at 0x401220
Capabilities:
Create a process with modified i/o handles and window
Create process on windows
Get file size
Write and execute a file
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x464
mov eax, dword [0x40f040]
push ebx
mov ebx, dword [ebp + 0x10]
push esi
mov dword [esp + 0x468], eax
mov eax, dword [ebp + 8]
test eax, eax
mov esi, ecx
mov ecx, dword [ebp + 0x14]
push edi
mov dword [esp + 0x1c], ecx
je 0x40125d
push eax
lea edx, [esi + 0x10]
push edx
call fcn.00402a16
add esp, 8
xor eax, eax
test ebx, ebx
mov ecx, 0x11
lea edi, [esp + 0x20]
rep stosd dword es:[edi], eax
mov ax, word [ebp + 0xc]
mov edx, 1
mov dword [esp + 0xc], 0xc
mov dword [esp + 0x10], 0
mov dword [esp + 0x14], edx
mov dword [esp + 0x20], 0x44
mov dword [esp + 0x4c], edx
mov word [esp + 0x50], ax
je 0x40137a
push 0
push 0x80
push 2
lea ecx, [esp + 0x18]
push ecx
push 3
push 0xc0000000
push ebx
mov dword [esp + 0x68], 0x101
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [esi + 8], eax
jne 0x4012e3
xor eax, eax
mov ecx, dword [esp + 0x46c]
call fcn.00402b75
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
push 0
push eax
mov dword [esp + 0x64], eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
test eax, eax
je 0x40137a
mov edx, dword [esi + 8]
push 2
push 0
push 0
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
xor eax, eax
mov ecx, 0x40
lea edi, [esp + 0x268]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x168]
push eax
call fcn.00402ac3
lea ecx, [esp + 0x6c]
push ecx
call fcn.00402a41
lea edx, [esp + 0x170]
push edx
lea eax, [esp + 0x74]
push eax
lea ecx, [esp + 0x278]
push 0x40c1d8
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x18
push 0
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x270]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov edx, dword [esi + 8]
push eax
lea ecx, [esp + 0x274]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x401458
mov edx, dword [esp + 0x4c]
mov ecx, 0x100
test ecx, edx
jne 0x401399
or edx, ecx
mov dword [esp + 0x4c], edx
push 0
push 0x80
push 4
lea ecx, [esp + 0x18]
push ecx
push 3
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [esi + 4], eax
je 0x4012cc
push 0
push eax
mov dword [esp + 0x68], eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
test eax, eax
je 0x401458
mov edx, dword [esi + 4]
push 2
push 0
push 0
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
xor eax, eax
mov ecx, 0x40
lea edi, [esp + 0x268]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x68]
push eax
call fcn.00402ac3
lea ecx, [esp + 0x16c]
push ecx
call fcn.00402a41
lea edx, [esp + 0x70]
push edx
lea eax, [esp + 0x174]
push eax
lea ecx, [esp + 0x278]
push 0x40c1d8
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x18
push 0
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x270]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov edx, dword [esi + 4]
push eax
lea ecx, [esp + 0x274]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [esi + 0x218]
test ecx, ecx
mov eax, 0x20
je 0x40146c
mov eax, 0x30
lea ecx, [esi + 0x21c]
push ecx
lea edx, [esp + 0x24]
push edx
push 0
push 0
push eax
push 1
lea eax, [esp + 0x24]
push eax
mov ecx, eax
push ecx
add esi, 0x10
push esi
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
mov ecx, dword [esp + 0x46c]
neg eax
sbb eax, eax
neg eax
call fcn.00402b75
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10