Function at 0x40be22
Capabilities:
Create a process with modified i/o handles and window
Create process on windows
Read file via mapping
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x8c
cmp dword [ebp + 0xc], 0
je 0x40c13e
cmp dword [ebp + 0x10], 0
je 0x40c13e
push ebx
push esi
call fcn.00402506
push eax
lea ecx, [ebp - 4]
call fcn.00402331
lea edx, [ebp - 4]
mov ecx, 0x400000
call fcn.004141aa
mov ebx, eax
test ebx, ebx
je 0x40be76
jle 0x40c12d
movzx ebx, bx
or ebx, 0x80070000
jmp 0x40c12d
mov esi, dword [ebp - 4]
mov ecx, esi
call fcn.00420630
test eax, eax
jne 0x40be8e
mov ebx, 0x80070241
jmp 0x40c130
push edi
push 0x40
lea eax, [ebp - 0x88]
mov dword [ebp - 0x8c], 0x44
push 0
push eax
call sub.msvcrt.dll_memset
xor eax, eax
mov dword [ebp - 0x60], 0x101
lea edi, [ebp - 0x2c]
add esp, 0xc
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
xor eax, eax
xor edi, edi
mov word [ebp - 0x5c], ax
inc eax
mov dword [ebp - 0x10], edi
cmp dword [ebp + 0x1c], edi
je 0x40bef4
cmp dword [ebp + 0x18], edi
je 0x40bef4
and dword [ebp - 0x18], edi
push edi
push edi
push eax
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x1c]
push eax
mov dword [ebp - 0x1c], 0xc
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov edi, eax
xor eax, eax
mov dword [ebp - 0x10], edi
inc eax
xor esi, esi
xor ebx, ebx
mov dword [ebp - 0xc], esi
cmp dword [ebp + 0x24], ebx
je 0x40bf61
and dword [ebp - 0x18], ebx
push ebx
push 0x400000
push ebx
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x1c]
push 4
push eax
push 0xffffffffffffffff
mov dword [ebp - 0x1c], 0xc
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
lea ecx, [ebp - 0xc]
mov esi, eax
call fcn.0041136e
mov dword [ebp - 0xc], esi
test esi, esi
je 0x40bf61
push 0x400000
push ebx
push ebx
push 6
push esi
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov ebx, eax
test ebx, ebx
je 0x40bf65
mov edx, dword [ebp + 0x24]
push ecx
mov ecx, ebx
call fcn.0040f19b
test al, al
jne 0x40bf61
push ebx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
jmp 0x40bf65
test ebx, ebx
jne 0x40bfba
lea eax, [ebp - 0x2c]
xor ebx, ebx
push eax
lea eax, [ebp - 0x8c]
push eax
push ebx
push ebx
push 0x400
push 1
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov esi, dword [ebp - 4]
push eax
push dword [ebp + 0x14]
lea eax, [ebp + 0x24]
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push esi
push str.__s___ProxyCall__RunTarget___s____s___d__d__p
push eax
call fcn.00414bef
add esp, 0x20
mov ecx, eax
call fcn.004015bb
push eax
push esi
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
je 0x40c012
mov eax, ebx
jmp 0x40c017
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x8c]
push eax
push 0
push 0
push 0x400
push 1
push 0
push 0
push esi
push edi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov esi, dword [ebp - 4]
push eax
push dword [ebp + 0x14]
lea eax, [ebp + 0x24]
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push esi
push str.__s___ProxyCall__RunTarget___s____s___d__d__p__p
push eax
call fcn.00414bef
add esp, 0x24
mov ecx, eax
call fcn.004015bb
push eax
push esi
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
je 0x40c012
xor eax, eax
jmp 0x40c017
call fcn.0041390d
mov ecx, dword [ebp + 0x24]
mov dword [ebp - 8], eax
lea ecx, [ecx - 0x10]
call fcn.004025d7
mov ebx, dword [ebp - 8]
test ebx, ebx
jne 0x40c11c
push dword [ebp - 0x28]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
cmp dword [ebp + 0x1c], ebx
je 0x40c0f5
mov ebx, dword [sym.imp.KERNEL32.dll_SetEvent]
test edi, edi
je 0x40c066
cmp dword [ebp + 0x18], 0
je 0x40c066
push 0
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x40c066
push edi
call ebx
push 8
push 0x1f4
push 0
lea eax, [ebp - 0x2c]
push eax
push 1
call dword [sym.imp.USER32.dll_MsgWaitForMultipleObjects]
cmp eax, 0x102
je 0x40c04a
test eax, eax
je 0x40c100
cmp eax, 1
je 0x40c0cc
push 0x80004001
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
jmp 0x40c100
test edi, edi
je 0x40c0b4
cmp dword [ebp + 0x18], 0
je 0x40c0b4
push 0
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x40c0ed
cmp dword [ebp - 0x44], 0x8001
je 0x40c0cc
push dword [ebp + 0x20]
push dword [ebp - 0x3c]
push dword [ebp - 0x40]
push dword [ebp - 0x44]
call dword [ebp + 0x1c]
push 1
push 0x985c
push 0x8000
push 0xffffffffffffffff
lea eax, [ebp - 0x48]
push eax
call dword [sym.imp.USER32.dll_PeekMessageW]
test eax, eax
jne 0x40c09b
jmp 0x40c04a
push edi
call ebx
jmp 0x40c04a
push 0xffffffffffffffff
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
lea eax, [ebp - 8]
mov dword [ebp - 8], 0x80004005
push eax
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
push dword [ebp - 0x2c]
call esi
mov ebx, dword [ebp - 8]
lea ecx, [ebp - 0xc]
call fcn.0041136e
lea ecx, [ebp - 0x10]
call fcn.0041136e
pop edi
mov esi, dword [ebp - 4]
lea ecx, [esi - 0x10]
call fcn.004025d7
pop esi
mov eax, ebx
pop ebx
jmp 0x40c143
mov eax, 0x80070057
leave
ret 0x20