Function at 0x46c690
Capabilities:
Check if file exists
Get common file path
Get file attributes
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4a7c14
mov eax, dword fs:[0]
push eax
sub esp, 0x390
mov eax, dword [0x4de880]
xor eax, ebp
mov dword [ebp - 0x14], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
lea ecx, [ebp - 0x340]
call fcn.00404240
mov dword [ebp - 4], 0
mov dword [ebp - 0x120], 0
mov dword [ebp - 0x10], 0
cmp dword [ebp + 8], 0
je 0x46c980
mov eax, dword [ebp + 8]
push eax
lea ecx, [ebp - 0x340]
call fcn.00406300
push 0
lea ecx, [ebp - 0x340]
call fcn.0040c110
movsx ecx, byte [eax]
cmp ecx, 0x22
jne 0x46c766
lea ecx, [ebp - 0x340]
call fcn.004018e0
sub eax, 1
push eax
push 1
lea edx, [ebp - 0x35c]
push edx
lea ecx, [ebp - 0x340]
call fcn.0040dbc0
mov dword [ebp - 0x390], eax
mov eax, dword [ebp - 0x390]
mov dword [ebp - 0x394], eax
mov byte [ebp - 4], 1
mov ecx, dword [ebp - 0x394]
push ecx
lea ecx, [ebp - 0x340]
call fcn.004061d0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x35c]
call fcn.00401e40
push 0xffffffffffffffff
push 0x4b9370
lea ecx, [ebp - 0x340]
call fcn.0040db60
mov dword [ebp - 0x120], eax
cmp dword [ebp - 0x120], 0xffffffff
je 0x46c7d9
mov edx, dword [ebp - 0x120]
push edx
push 0
lea eax, [ebp - 0x378]
push eax
lea ecx, [ebp - 0x340]
call fcn.0040dbc0
mov dword [ebp - 0x398], eax
mov ecx, dword [ebp - 0x398]
mov dword [ebp - 0x39c], ecx
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x39c]
push edx
lea ecx, [ebp - 0x340]
call fcn.004061d0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x378]
call fcn.00401e40
push 0x200
lea eax, [ebp - 0x324]
push eax
lea ecx, [ebp - 0x340]
call fcn.00401df0
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
test eax, eax
je 0x46c80d
lea ecx, [ebp - 0x324]
push ecx
lea ecx, [ebp - 0x340]
call fcn.00406300
push 0
push 0x4b9374
lea ecx, [ebp - 0x340]
call fcn.0040db10
cmp eax, 0xffffffff
je 0x46c897
lea ecx, [ebp - 0x340]
call fcn.00401df0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0xffffffff
je 0x46c870
mov edx, dword [ebp - 0x10]
and edx, 0x10
jne 0x46c870
mov dword [ebp - 0x37c], 1
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x340]
call fcn.00401e40
mov eax, dword [ebp - 0x37c]
jmp 0x46c9a2
mov dword [ebp - 0x380], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x340]
call fcn.00401e40
mov eax, dword [ebp - 0x380]
jmp 0x46c9a2
push 0x104
lea eax, [ebp - 0x11c]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x4b9378
lea ecx, [ebp - 0x11c]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea ecx, [ebp - 0x340]
call fcn.00401df0
push eax
lea edx, [ebp - 0x11c]
push edx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea eax, [ebp - 0x11c]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x46c90d
mov dword [ebp - 0x384], 1
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x340]
call fcn.00401e40
mov eax, dword [ebp - 0x384]
jmp 0x46c9a2
push 0x104
lea ecx, [ebp - 0x11c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
push 0x4b937c
lea edx, [ebp - 0x11c]
push edx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea ecx, [ebp - 0x340]
call fcn.00401df0
push eax
lea eax, [ebp - 0x11c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea ecx, [ebp - 0x11c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x46c980
mov dword [ebp - 0x388], 1
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x340]
call fcn.00401e40
mov eax, dword [ebp - 0x388]
jmp 0x46c9a2
mov dword [ebp - 0x38c], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x340]
call fcn.00401e40
mov eax, dword [ebp - 0x38c]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0043f9e9
mov esp, ebp
pop ebp
ret