Function at 0x4041a0
Capabilities:
Create process on windows
Get common file path
Print debug messages
Set current directory

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x50e7eb
mov eax, dword fs:[0]
push eax
mov eax, 0x1860
call fcn.004f91c0
mov eax, dword [0x5635b8]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x1818], ecx
mov esi, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
mov edi, dword [ebp + 0x10]
call fcn.00408caa
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x4041fb
push 0x80004005
call fcn.004010e0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x1814], eax
push 0x44
lea ecx, [ebp - 0x186c]
push 0
push ecx
mov dword [ebp - 4], 0
call fcn.004f9100
movzx edx, byte [ebp + 0x14]
mov ecx, dword [esi]
add esp, 0xc
neg edx
sbb edx, edx
and edx, 5
mov dword [ebp - 0x186c], 0x44
mov dword [ebp - 0x1840], 1
mov word [ebp - 0x183c], dx
mov eax, dword [ecx - 0xc]
test eax, eax
je 0x404285
jns 0x404262
push 0x80070057
call fcn.004010e0
cmp word [ecx], 0x22
je 0x404285
lea edx, [eax - 1]
test edx, edx
js 0x404258
cmp edx, eax
jg 0x404258
cmp word [ecx + edx*2], 0x22
je 0x404285
mov eax, dword [ebx]
push eax
push ecx
push str.__s___s
jmp 0x40428e
mov eax, dword [ebx]
push eax
push ecx
push str._s__s
lea edx, [ebp - 0x1010]
push 0x800
push edx
call fcn.004f917a
add esp, 0x14
lea eax, [ebp - 0x1810]
push eax
push 0x800
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
mov eax, dword [edi]
cmp dword [eax - 0xc], 0
mov ebx, dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
je 0x4042cd
push eax
call ebx
test eax, eax
je 0x4043ba
mov eax, dword [edi]
mov esi, dword [esi]
lea ecx, [ebp - 0x1828]
push ecx
lea edx, [ebp - 0x186c]
push edx
push eax
push 0
push 0x1000200
push 0
push 0
push 0
lea eax, [ebp - 0x1010]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
cmp eax, 1
sete al
test al, al
jne 0x404332
mov eax, dword [ebp - 0x1814]
add eax, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40432e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor al, al
jmp 0x40439c
mov ecx, dword [edi]
cmp dword [ecx - 0xc], 0
je 0x404343
lea edx, [ebp - 0x1810]
push edx
call ebx
mov eax, dword [ebp - 0x1824]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp - 0x1828]
push eax
call edi
test esi, esi
je 0x404305
cmp byte [ebp + 0x1c], 0
je 0x40436e
mov ecx, dword [ebp - 0x1818]
push esi
call fcn.00403b20
push esi
call edi
mov eax, dword [ebp - 0x1814]
add eax, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40439a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004f90ee
mov esp, ebp
pop ebp
ret 0x18
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [ebp - 0x1010]
push ecx
lea edx, [ebp - 0x1814]
push str.CreateProcess__s__failed_with_error__u.
push edx
call fcn.00402d20
mov eax, dword [ebp - 0x1814]
add esp, 0x10
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
jmp 0x404305