Function at 0x40a370
Capabilities:
Check if file exists
Create directory
Query environment variable

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff0
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
sub esp, 0x498
mov eax, dword [0x432040]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
push 0x208
lea eax, [ebp - 0x418]
mov esi, ecx
push 0
push eax
mov dword [ebp - 0x424], esi
call fcn.0040ef50
add esp, 0xc
mov eax, 0x437184
cmp dword [0x437198], 7
cmova eax, dword [0x437184]
push eax
lea eax, [ebp - 0x418]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatW]
push 0x104
lea edi, [esi + 0xd4]
push edi
lea eax, [ebp - 0x418]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenW]
push edi
call esi
mov ecx, dword [ebp - 0x424]
push 0x208
push 0
mov dword [ecx + 0x6f0], eax
lea eax, [ebp - 0x210]
push eax
call fcn.0040ef50
add esp, 0xc
push edi
call esi
mov edi, eax
test edi, edi
je 0x40a504
cmp edi, 0x104
jae 0x40a504
mov eax, dword [ebp - 0x424]
lea ecx, [edi + edi]
push ecx
add eax, 0xd4
push eax
lea eax, [ebp - 0x210]
push eax
call fcn.0040f0f0
lea esi, [edi - 1]
add esp, 0xc
mov eax, 0x5c
test esi, esi
je 0x40a504
cmp ax, word [ebp + esi*2 - 0x210]
jne 0x40a4a1
cmp esi, 0x104
jae 0x40ab96
xor eax, eax
mov word [ebp + esi*2 - 0x210], ax
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40a4a6
mov eax, 0x5c
mov word [ebp + esi*2 - 0x210], ax
sub esi, 1
jne 0x40a463
test esi, esi
je 0x40a504
mov eax, 0x5c
mov word [ebp + esi*2 - 0x210], ax
inc esi
cmp esi, edi
jae 0x40a504
nop dword [eax]
cmp ax, word [ebp + esi*2 - 0x210]
jne 0x40a4ff
cmp esi, 0x104
jae 0x40ab96
xor eax, eax
push eax
mov word [ebp + esi*2 - 0x210], ax
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
je 0x40a504
mov eax, 0x5c
mov word [ebp + esi*2 - 0x210], ax
inc esi
cmp esi, edi
jb 0x40a4c0
mov dword [ebp - 0x420], 0xaa9ec36b
mov dword [ebp - 0x41c], 0xe21f29e9
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x480], eax
mov dword [ebp - 0x47c], ecx
mov dword [ebp - 0x420], 0x682f0447
mov dword [ebp - 0x41c], 0x67297eec
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x478], eax
mov dword [ebp - 0x474], ecx
mov dword [ebp - 0x420], 0x52aefebb
mov dword [ebp - 0x41c], 0x6d7daed5
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x470], eax
mov dword [ebp - 0x46c], ecx
mov dword [ebp - 0x420], 0x3b66e3e8
mov dword [ebp - 0x41c], 0x73c635e0
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x468], eax
mov dword [ebp - 0x464], ecx
mov dword [ebp - 0x420], 0xaafbc31d
mov dword [ebp - 0x41c], 0xe26c299b
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x450], eax
mov dword [ebp - 0x44c], ecx
mov esi, dword [ebp - 0x424]
mov dword [ebp - 0x420], 0x6840042e
mov dword [ebp - 0x41c], 0x67077e82
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x448], eax
mov dword [ebp - 0x444], ecx
mov dword [ebp - 0x420], 0x52c2fedf
mov dword [ebp - 0x41c], 0x6d7daeb9
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x440], eax
mov dword [ebp - 0x43c], ecx
mov dword [ebp - 0x420], 0x3b66e3e8
mov dword [ebp - 0x41c], 0x73c635e0
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
movaps xmm1, xmmword [ebp - 0x480]
xorps xmm1, xmmword [ebp - 0x450]
movaps xmmword [ebp - 0x480], xmm1
movaps xmm1, xmmword [ebp - 0x470]
mov dword [ebp - 0x438], eax
lea eax, [ebp - 0x480]
mov dword [ebp - 0x434], ecx
mov ecx, esi
xorps xmm1, xmmword [ebp - 0x440]
push eax
movaps xmmword [ebp - 0x470], xmm1
call fcn.00409cc0
test eax, eax
jne 0x40ab81
mov dword [ebp - 0x420], 0xaa94c35a
mov dword [ebp - 0x41c], 0xe20b29f4
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x460], eax
mov dword [ebp - 0x45c], ecx
mov dword [ebp - 0x420], 0x68250442
mov dword [ebp - 0x41c], 0x67757ec1
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x458], eax
mov dword [ebp - 0x454], ecx
mov dword [ebp - 0x420], 0x52b1febe
mov dword [ebp - 0x41c], 0x6d35aed1
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x450], eax
mov dword [ebp - 0x44c], ecx
mov dword [ebp - 0x420], 0x3b08e389
mov dword [ebp - 0x41c], 0x73aa3584
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x448], eax
mov dword [ebp - 0x444], ecx
mov dword [ebp - 0x420], 0x6c08fc94
mov dword [ebp - 0x41c], 0x3473c621
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x440], eax
mov dword [ebp - 0x43c], ecx
mov dword [ebp - 0x420], 0x13cc4c5a
mov dword [ebp - 0x41c], 0xf07549a6
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x438], eax
mov dword [ebp - 0x434], ecx
mov dword [ebp - 0x420], 0xaafbc31d
mov dword [ebp - 0x41c], 0xe26c299b
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x490], eax
mov dword [ebp - 0x48c], ecx
mov dword [ebp - 0x420], 0x6840042e
mov dword [ebp - 0x41c], 0x67077e82
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x488], eax
mov dword [ebp - 0x484], ecx
mov dword [ebp - 0x420], 0x52c2fedf
mov dword [ebp - 0x41c], 0x6d7daeb9
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x480], eax
mov dword [ebp - 0x47c], ecx
mov dword [ebp - 0x420], 0x3b66e3e8
mov dword [ebp - 0x41c], 0x73c635e0
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x478], eax
mov dword [ebp - 0x474], ecx
mov dword [ebp - 0x420], 0x6c7afcf1
mov dword [ebp - 0x41c], 0x3416c60f
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x470], eax
mov dword [ebp - 0x46c], ecx
mov dword [ebp - 0x420], 0x13a94c22
mov dword [ebp - 0x41c], 0xf07549a6
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
movaps xmm1, xmmword [ebp - 0x460]
xorps xmm1, xmmword [ebp - 0x490]
movaps xmmword [ebp - 0x460], xmm1
movaps xmm1, xmmword [ebp - 0x450]
xorps xmm1, xmmword [ebp - 0x480]
movaps xmmword [ebp - 0x450], xmm1
movaps xmm1, xmmword [ebp - 0x440]
mov dword [ebp - 0x468], eax
mov dword [ebp - 0x464], ecx
xorps xmm1, xmmword [ebp - 0x470]
movaps xmmword [ebp - 0x440], xmm1
lea eax, [ebp - 0x460]
mov ecx, esi
push eax
call fcn.00409cc0
test eax, eax
jne 0x40ab81
mov dword [ebp - 0x420], 0xaa94c35a
mov dword [ebp - 0x41c], 0xe20b29f4
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x460], eax
mov dword [ebp - 0x45c], ecx
mov dword [ebp - 0x420], 0x68250442
mov dword [ebp - 0x41c], 0x67757ec1
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x458], eax
mov dword [ebp - 0x454], ecx
mov dword [ebp - 0x420], 0x52b1febe
mov dword [ebp - 0x41c], 0x6d35aed1
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x450], eax
mov dword [ebp - 0x44c], ecx
mov dword [ebp - 0x420], 0x3b08e389
mov dword [ebp - 0x41c], 0x73aa3584
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x448], eax
mov dword [ebp - 0x444], ecx
mov dword [ebp - 0x420], 0x6c08fc94
mov dword [ebp - 0x41c], 0x3473c621
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x440], eax
mov dword [ebp - 0x43c], ecx
mov dword [ebp - 0x420], 0x13cc4c5a
mov dword [ebp - 0x41c], 0xf07549a6
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x438], eax
mov dword [ebp - 0x434], ecx
mov dword [ebp - 0x420], 0xaafbc31d
mov dword [ebp - 0x41c], 0xe26c299b
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x490], eax
mov dword [ebp - 0x48c], ecx
mov dword [ebp - 0x420], 0x6840042e
mov dword [ebp - 0x41c], 0x67077e82
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x488], eax
mov dword [ebp - 0x484], ecx
mov dword [ebp - 0x420], 0x52c2fedf
mov dword [ebp - 0x41c], 0x6d7daeb9
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x480], eax
mov dword [ebp - 0x47c], ecx
mov dword [ebp - 0x420], 0x3b66e3e8
mov dword [ebp - 0x41c], 0x73c635e0
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x478], eax
mov dword [ebp - 0x474], ecx
mov dword [ebp - 0x420], 0x6c7afcf1
mov dword [ebp - 0x41c], 0x3416c60f
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x470], eax
mov dword [ebp - 0x46c], ecx
mov dword [ebp - 0x420], 0x13a94c22
mov dword [ebp - 0x41c], 0xf07549a6
mov eax, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x41c]
movaps xmm1, xmmword [ebp - 0x460]
xorps xmm1, xmmword [ebp - 0x490]
movaps xmmword [ebp - 0x460], xmm1
movaps xmm1, xmmword [ebp - 0x450]
xorps xmm1, xmmword [ebp - 0x480]
movaps xmmword [ebp - 0x450], xmm1
movaps xmm1, xmmword [ebp - 0x440]
mov dword [ebp - 0x468], eax
mov dword [ebp - 0x464], ecx
xorps xmm1, xmmword [ebp - 0x470]
movaps xmmword [ebp - 0x440], xmm1
push 0
lea eax, [ebp - 0x460]
mov ecx, esi
push eax
call fcn.0040a070
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040cc8c
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
xor ecx, ebp
pop esi
call fcn.0040cc8c
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
call fcn.0040cdbd
int3