Function at 0x406871
Capabilities:
Check if file exists
Create process on windows
Create process suspended
Get common file path
Set current directory
Terminate process

Disassembly:
push 0x98
mov eax, 0x434d9b
call fcn.0041f0ed
push dword [ebp + 0x10]
lea eax, [ebp - 0x30]
push eax
call fcn.004024a0
xor esi, esi
mov dword [ebp - 4], esi
mov eax, dword [0x44f98c]
mov edi, 0x44f98c
mov ecx, edi
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x20], eax
mov byte [ebp - 4], 1
mov eax, dword [0x44f98c]
mov ecx, edi
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x18], eax
push str.Wow64DisableWow64FsRedirection
mov byte [ebp - 4], 2
push str.kernel32.dll
mov dword [ebp - 0x2c], esi
mov dword [ebp - 0x34], esi
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, esi
je 0x4068e5
lea ecx, [ebp - 0x34]
push ecx
call eax
mov eax, 0x104
push eax
push eax
lea esi, [ebp - 0x18]
call fcn.00401365
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
call fcn.0040277f
lea eax, [ebp - 0x5c]
push eax
call fcn.00409394
mov eax, esi
push eax
lea ebx, [ebp - 0x5c]
mov byte [ebp - 4], 3
call fcn.004065ea
pop ecx
test eax, eax
jne 0x40692d
push str._esys
call fcn.004017a8
pop ecx
jmp 0x406b22
and dword [ebp - 0x24], 0
jmp 0x406938
mov edi, 0x44f98c
lea esi, [ebp - 0x20]
call fcn.0040147b
lea eax, [ebp - 0x5c]
push eax
mov eax, esi
push eax
call fcn.004066d8
pop ecx
pop ecx
test eax, eax
jne 0x406962
push str._ename
call fcn.004017a8
pop ecx
jmp 0x406afd
mov eax, dword [0x44f98c]
mov ecx, edi
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x1c], eax
mov byte [ebp - 4], 4
push dword [ebp - 0x20]
lea eax, [ebp - 0x1c]
push dword [ebp - 0x18]
push 0x442c58
call fcn.004015b8
add esp, 0xc
lea esi, [ebp - 0x1c]
call fcn.0040277f
mov esi, dword [ebp - 0x1c]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x406af1
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
xor eax, eax
lea edi, [ebp - 0x44]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
push 0x44
pop ebx
stosd dword es:[edi], eax
push ebx
xor edi, edi
lea eax, [ebp - 0xa4]
push edi
push eax
call fcn.0041e9c0
add esp, 0xc
lea eax, [ebp - 0x28]
push eax
mov dword [ebp - 0xa4], ebx
mov dword [ebp - 0x28], edi
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
call dword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
test eax, eax
jne 0x4069ef
mov dword [ebp - 0x28], edi
cmp dword [ebp - 0x28], edi
jne 0x406a67
push str._in0
call fcn.004017a8
pop ecx
mov dword [ebp - 0x14], edi
jmp 0x406a0f
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
lea ebx, [ebp - 0x14]
call fcn.004067ac
test eax, eax
je 0x406a04
cmp dword [ebp - 0x14], edi
je 0x406ae6
lea eax, [ebp - 0x44]
push eax
lea eax, [ebp - 0xa4]
push eax
push edi
push edi
push 0x8000004
push edi
push edi
push edi
push 0x438fa4
push esi
push dword [ebp - 0x14]
mov dword [ebp - 0x9c], str.WinSta0Default
call dword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
mov ebx, eax
cmp dword [ebp - 0x14], edi
je 0x406a95
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x14], edi
jmp 0x406a95
push str._in1
call fcn.004017a8
pop ecx
lea eax, [ebp - 0x44]
push eax
lea eax, [ebp - 0xa4]
push eax
push edi
push edi
push 0x8000004
push edi
push edi
push edi
push 0x438fa4
push esi
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
mov ebx, eax
cmp ebx, edi
je 0x406ae6
cmp dword [ebp - 0x3c], edi
je 0x406ae6
lea esi, [ebp - 0x30]
call fcn.00402768
push eax
push 0x442d0c
push edi
push dword [ebp + 0xc]
push dword [ebp + 8]
push dword [ebp - 0x3c]
call fcn.00410780
add esp, 0x18
mov dword [ebp - 0x2c], eax
cmp eax, edi
jne 0x406b0c
push 0x442d94
call fcn.004017a8
pop ecx
push edi
push dword [ebp - 0x44]
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
mov byte [ebp - 4], 3
mov eax, dword [ebp - 0x1c]
add eax, 0xfffffff0
jmp 0x406af8
push 0x442d90
call fcn.004017a8
pop ecx
mov byte [ebp - 4], 3
lea eax, [esi - 0x10]
call fcn.00401603
inc dword [ebp - 0x24]
cmp dword [ebp - 0x24], 3
jl 0x406933
jmp 0x406b22
push 0x442d98
call fcn.004017a8
mov eax, dword [ebp - 0x1c]
pop ecx
add eax, 0xfffffff0
call fcn.00401603
lea esi, [ebp - 0x5c]
mov byte [ebp - 4], 2
call fcn.004093cd
push str.Wow64RevertWow64FsRedirection
push str.kernel32.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x406b4e
push dword [ebp - 0x34]
call eax
mov eax, dword [ebp - 0x18]
add eax, 0xfffffff0
call fcn.00401603
mov eax, dword [ebp - 0x20]
add eax, 0xfffffff0
call fcn.00401603
mov eax, dword [ebp - 0x30]
add eax, 0xfffffff0
call fcn.00401603
mov eax, dword [ebp - 0x2c]
call fcn.0041f1c5
ret