Function at 0x406cb0
Capabilities:
Check if file exists
Get disk information
Get file attributes
Query environment variable

Disassembly:
sub esp, 0x18c
mov eax, dword [0x423640]
xor eax, esp
mov dword [esp + 0x188], eax
mov eax, dword [esp + 0x190]
mov ecx, dword [esp + 0x194]
mov edx, dword [esp + 0x198]
push ebx
push edi
push 0x12000
xor ebx, ebx
push ebx
mov dword [esp + 0x34], eax
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x30], edx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
mov dword [esp + 0x1c], edi
cmp edi, ebx
jne 0x406d1f
pop edi
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x188]
xor ecx, esp
call fcn.00409279
add esp, 0x18c
ret
push ebp
push esi
lea esi, [edi + 4]
push 0x4000
mov dword [edi], ebx
mov dword [esp + 0x14], esi
mov dword [esp + 0x24], ebx
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x2c], ebx
call fcn.0040a541
mov ebp, eax
add esp, 4
test ebp, ebp
je 0x406ffc
lea ecx, [esp + 0x17]
lea eax, [ebp + 0x1f40]
push ecx
mov dword [esp + 0x20], eax
mov byte [esp + 0x1b], bl
call fcn.00403a10
add esp, 4
cmp byte [esp + 0x17], 1
jne 0x406eaa
push ebp
mov byte [ebp], bl
call fcn.00403980
push ebp
push esi
push 1
call fcn.00406460
add esp, 0x10
cmp eax, 1
jne 0x406da4
mov dword [esi + 4], 0x1000003
add esi, dword [esi]
mov ebx, eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x10], esi
mov dword [esp + 0x20], ebx
push ebp
mov byte [ebp], 0
call fcn.004063b0
add esp, 4
cmp byte [ebp], 0
je 0x406e34
lea edx, [esp + 0x158]
push edx
push 0x40
call dword [sym.imp.KERNEL32.dll_GetLogicalDriveStringsA]
test eax, eax
je 0x406e34
cmp byte [esp + 0x158], 0
lea edi, [esp + 0x158]
je 0x406e30
push edi
call dword [sym.imp.KERNEL32.dll_GetDriveTypeA]
cmp eax, 3
jne 0x406e10
mov al, byte [edi]
push ebp
push esi
push 1
mov byte [ebp], al
call fcn.00406460
add esp, 0xc
cmp eax, 1
jne 0x406e10
inc dword [esp + 0x18]
mov dword [esi + 4], 0x1000003
add esi, dword [esi]
inc ebx
mov eax, edi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x406e15
sub eax, edx
cmp byte [edi + eax + 1], cl
lea edi, [edi + eax + 1]
jne 0x406de0
mov dword [esp + 0x20], ebx
mov dword [esp + 0x10], esi
mov edi, dword [esp + 0x24]
lea ecx, [esp + 0x3c]
push ecx
call fcn.00409160
add esp, 4
cmp dword [esp + 0x40], 0xa
jb 0x406eaa
mov edx, dword [esp + 0x1c]
push 3
push ebp
push edx
call fcn.0040a5e0
mov ecx, dword [esp + 0x28]
lea eax, [ebp + 3]
push eax
add ecx, 3
push str.Windows.old_s
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
mov edx, dword [esp + 0x34]
add esp, 0x18
push edx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x406eaa
mov eax, dword [esp + 0x1c]
push eax
push esi
push 1
call fcn.00406460
add esp, 0xc
cmp eax, 1
jne 0x406eaa
inc dword [esp + 0x18]
mov dword [esi + 4], 0x1000003
add esi, dword [esi]
inc ebx
mov dword [esp + 0x10], esi
mov dword [esp + 0x20], ebx
lea ecx, [esp + 0x18]
push ecx
lea edx, [esp + 0x24]
push edx
lea eax, [esp + 0x18]
push eax
call fcn.00406b30
lea ecx, [esp + 0x28]
xor ebx, ebx
push ecx
mov dword [esp + 0x2c], ebx
call fcn.00406160
add esp, 0x10
cmp dword [esp + 0x1c], ebx
je 0x406fe9
mov esi, dword [esp + 0x10]
lea edx, [esi + 0x400]
lea eax, [edi + 0x10000]
cmp edx, eax
jae 0x406fdc
mov eax, dword [esp + 0x1c]
push ebp
push ebx
push eax
mov byte [ebp], 0
call fcn.00406200
add esp, 0xc
cmp eax, 1
jne 0x406fdc
push 0x7c
push ebp
call fcn.0040a52a
add esp, 8
test eax, eax
je 0x406fc7
lea ecx, [esp + 0x10]
push ecx
mov byte [eax], 0
inc eax
push 0x41f59c
push eax
mov dword [esp + 0x1c], 0
call fcn.0040a5b6
mov eax, dword [esp + 0x1c]
add esp, 0xc
test eax, eax
je 0x406fc7
test al, 2
je 0x406fc7
push 0x800
lea edi, [ebp + 0xfa0]
push edi
push ebp
mov byte [edi], 0
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
test eax, eax
jne 0x406f73
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov edx, dword [esp + 0x10]
shr edx, 0x18
and dl, 1
mov byte [esp + 0x38], dl
mov eax, dword [esp + 0x38]
push edi
push esi
push eax
call fcn.00406460
add esp, 0xc
cmp eax, 1
jne 0x406fc3
cmp byte [esi + 8], 0
je 0x406fa1
inc dword [esp + 0x18]
jmp 0x406fa5
inc dword [esp + 0x28]
call fcn.004062f0
test al, al
je 0x406fb6
or dword [esp + 0x10], 0x10000000
mov ecx, dword [esp + 0x10]
mov dword [esi + 4], ecx
add esi, dword [esi]
inc dword [esp + 0x20]
mov edi, dword [esp + 0x24]
lea edx, [esi + 0x400]
lea eax, [edi + 0x10000]
inc ebx
cmp edx, eax
jb 0x406ef3
mov eax, dword [esp + 0x1c]
push eax
call fcn.00406270
add esp, 4
mov esi, dword [esp + 0x20]
push ebp
mov dword [edi], esi
call fcn.0040a163
add esp, 4
test esi, esi
jne 0x407018
push edi
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov dword [esp + 0x24], 0
mov edi, dword [esp + 0x24]
mov eax, dword [esp + 0x34]
pop esi
pop ebp
test eax, eax
je 0x407028
mov ecx, dword [esp + 0x10]
mov dword [eax], ecx
mov eax, dword [esp + 0x24]
test eax, eax
je 0x407036
mov edx, dword [esp + 0x20]
mov dword [eax], edx
mov eax, dword [esp + 0x28]
test eax, eax
je 0x407040
mov dword [eax], edi
mov ecx, dword [esp + 0x190]
pop edi
pop ebx
xor ecx, esp
mov eax, 1
call fcn.00409279
add esp, 0x18c
ret