Function at 0x406fa0
Capabilities:
Create process on windows
Get common file path
Set current directory
Terminate process

Disassembly:
mov eax, 0x4550
call fcn.0040cc10
mov eax, dword [esp + 0x4560]
mov dword [esp], ecx
mov ecx, 1
cmp eax, ecx
mov dword [esp + 8], 0xffffffff
mov dword [esp + 0xc], ecx
mov dword [esp + 4], ecx
jl 0x406fd1
mov dword [esp + 4], eax
push ebx
push ebp
push esi
push edi
lea eax, [esp + 0x560]
push eax
push 0x400
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
mov esi, dword [esp + 0x4574]
mov edi, dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov ebp, dword [sym.imp.KERNEL32.dll_FindClose]
jmp 0x407000
mov ecx, dword [esp + 0x4568]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
test eax, eax
je 0x40703c
mov eax, dword [esp + 0x4564]
lea edx, [esp + 0x20]
push edx
push eax
xor bl, bl
call edi
cmp eax, 0xffffffff
je 0x40703c
test byte [esp + 0x20], 0x10
jne 0x407031
mov bl, 1
push eax
call ebp
test bl, bl
jne 0x4070c7
push 0x400
lea ecx, [esp + 0x1964]
push ecx
push 0x2f
call fcn.004028e0
push esi
lea edx, [esp + 0x1970]
push edx
lea eax, [esp + 0x174]
push eax
call fcn.0040d398
add esp, 0x18
push 1
push 0x42bdd2
lea ecx, [esp + 0x168]
push ecx
push 0
call dword [0x43a2bc]
cmp eax, 2
jne 0x407000
push 0x400
lea edx, [esp + 0x164]
push edx
push 0x2e
call fcn.004028e0
add esp, 0xc
push 0x24
push 0x42bdd2
lea eax, [esp + 0x168]
push eax
push 0
call dword [0x43a2bc]
cmp eax, 6
jne 0x407000
push 0
call fcn.0040d358
mov ecx, dword [esp + 0x4564]
push ecx
lea edx, [esp + 0x964]
push 0x42c4d0
push edx
call fcn.0040d398
mov eax, dword [esp + 0x4578]
add esp, 0xc
mov edi, 0x42bdd2
mov esi, eax
mov ecx, 1
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x407149
lea edi, [esp + 0x960]
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x407105
mov cx, word [0x42c4ec]
mov word [edi], cx
mov edx, eax
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x407120
lea edi, [esp + 0x960]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x407131
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edx, dword [esp + 0x10]
cmp byte [edx], 0
je 0x407169
push 0
push str.CreateProcess
lea eax, [esp + 0x968]
push eax
push 0
call dword [0x43a2bc]
mov edi, dword [esp + 0x14]
test edi, edi
jle 0x407238
mov ebp, dword [sym.imp.KERNEL32.dll_CreateProcessA]
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
mov esi, dword [esp + 0x4570]
test esi, esi
je 0x40718d
dec edi
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x407230
mov edx, dword [esp + 0x4564]
push 0x43eb14
push 0x43ead0
push 0
push 0
push 0x30
push 0
push 0
push 0
lea ecx, [esp + 0x980]
push ecx
push edx
call ebp
test eax, eax
je 0x40721a
mov edi, esi
mov dword [esp + 0x14], edi
mov ecx, dword [0x43eb14]
lea eax, [esp + 0x18]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
test eax, eax
je 0x407257
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x4071f9
mov dword [esp + 0x1c], 0
push 1
call ebx
test esi, esi
je 0x40720a
dec edi
test edi, edi
mov dword [esp + 0x14], edi
jle 0x407238
cmp dword [esp + 0x18], 0x103
je 0x4071d3
mov edi, dword [esp + 0x14]
jmp 0x407230
cmp edi, 1
jl 0x407261
test esi, esi
je 0x407261
mov edx, dword [esp + 0x10]
cmp byte [edx], 0
jne 0x407261
push 1
call ebx
test edi, edi
jg 0x407181
lea eax, [esp + 0x560]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov eax, dword [esp + 0x18]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4550
ret 0x14
mov dword [esp + 0x18], 0
jmp 0x407238
push 0
push 0
lea eax, [esp + 0x18]
push eax
push 0x400
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0
push 0x1300
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x4564]
push ecx
push edx
lea eax, [esp + 0x1d68]
push str.Error_executing__s_n_s
push eax
call fcn.0040d398
add esp, 0x10
push 0x40
push str.Exec_And_Wait
lea ecx, [esp + 0x1d68]
push ecx
push 0
call dword [0x43a2bc]
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x407238