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

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x4691bd
push eax
mov dword fs:[0], esp
sub esp, 0x52c
push edi
mov edi, dword [esp + 0x540]
mov ecx, dword [edi]
mov eax, dword [ecx - 0xc]
test eax, eax
jne 0x4624d9
mov eax, 0x80004005
pop edi
mov ecx, dword [esp + 0x52c]
mov dword fs:[0], ecx
add esp, 0x538
ret 4
test eax, eax
push esi
jl 0x46255b
push str.___
push ecx
call fcn.0044b7cc
add esp, 8
test eax, eax
je 0x46255b
mov ecx, dword [edi]
sub eax, ecx
jne 0x46255b
mov eax, str.___
lea esi, [eax + 1]
mov edi, edi
mov dl, byte [eax]
add eax, 1
test dl, dl
jne 0x462500
mov ecx, dword [ecx - 0xc]
sub eax, esi
sub ecx, eax
push ecx
lea eax, [esp + 0x10]
push eax
mov ecx, edi
call fcn.0040d2e2
push eax
mov ecx, edi
mov dword [esp + 0x540], 0
call fcn.0040e6c3
mov eax, dword [esp + 0xc]
add eax, 0xfffffff0
mov dword [esp + 0x53c], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x46255b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [edi]
lea edx, [esp + 0x124]
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
add eax, 1
test cl, cl
jne 0x462566
mov esi, dword [sym.imp.SHLWAPI.dll_PathUnquoteSpacesA]
lea ecx, [esp + 0x124]
push ecx
call esi
push 0x104
lea edx, [esp + 0x24]
push edx
lea eax, [esp + 0x12c]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
lea eax, [esp + 0x20]
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x4625a1
push ebp
sub eax, edx
push eax
lea ecx, [esp + 0x28]
push ecx
mov ecx, edi
call fcn.00403cc5
mov ebp, dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
lea edx, [esp + 0x24]
push edx
call ebp
test eax, eax
je 0x4625f1
lea eax, [esp + 0x24]
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x4625d2
sub eax, edx
push eax
lea eax, [esp + 0x28]
push eax
mov ecx, edi
call fcn.00403cc5
xor eax, eax
jmp 0x46293f
push ebx
lea ecx, [esp + 0x28]
push ecx
lea ecx, [esp + 0x14]
call fcn.00409a7c
mov dword [esp + 0x544], 1
mov bl, 2
lea ecx, [ecx]
mov edx, dword [esp + 0x10]
push 0x20
push edx
call fcn.0044d760
xor ecx, ecx
add esp, 8
cmp eax, ecx
je 0x46271d
sub eax, dword [esp + 0x10]
cmp eax, 0xffffffff
je 0x46271d
push eax
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x18]
call fcn.004231c0
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x548], bl
call fcn.0040e6c3
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
mov byte [esp + 0x544], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x46267e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
cmp dword [eax + 0xc], 1
jle 0x46269f
mov ecx, dword [eax + 4]
push ecx
lea ecx, [esp + 0x14]
call fcn.00401ab5
mov edx, dword [esp + 0x10]
lea eax, [edx - 0x10]
or ecx, 0xffffffff
add dword [eax + 0xc], ecx
jne 0x4626aa
mov dword [eax + 0xc], ecx
mov eax, dword [esp + 0x10]
push eax
call esi
mov eax, dword [esp + 0x10]
mov ecx, dword [eax - 4]
add eax, 0xfffffffc
test ecx, ecx
jge 0x4626cc
add ecx, 1
mov dword [eax], ecx
jne 0x4626cc
mov dword [eax], 1
mov ecx, dword [esp + 0x10]
push ecx
call ebp
test eax, eax
je 0x462610
lea edx, [esp + 0x10]
push edx
mov ecx, edi
call fcn.0040e6c3
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
mov dword [esp + 0x544], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x462a6c
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
jmp 0x46293e
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], ecx
push 0x104
lea ecx, [esp + 0x234]
push ecx
mov bl, 3
push str.Path
mov byte [esp + 0x550], bl
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
lea edx, [esp + 0x18]
push edx
push 0x46fb8c
lea eax, [esp + 0x238]
push eax
call fcn.00462070
push 0x104
lea ecx, [esp + 0x43c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x104
lea edx, [esp + 0x338]
push edx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
lea eax, [esp + 0x334]
push eax
lea ecx, [esp + 0x18]
call fcn.00409a7c
mov eax, dword [eax]
push 1
push eax
push 0
lea ecx, [esp + 0x24]
mov byte [esp + 0x550], 4
call fcn.00461f10
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
mov byte [esp + 0x544], bl
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4627db
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [esp + 0x438]
push ecx
lea ecx, [esp + 0x18]
call fcn.00409a7c
mov eax, dword [eax]
push 1
push eax
push 0
lea ecx, [esp + 0x24]
mov byte [esp + 0x550], 5
call fcn.00461f10
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
mov byte [esp + 0x544], bl
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x46282b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x1c]
xor esi, esi
test eax, eax
jbe 0x4628f2
lea esp, [esp]
mov edx, dword [0x47fe44]
mov eax, dword [edx + 0xc]
mov ecx, 0x47fe44
call eax
add eax, 0x10
mov dword [esp + 0x14], eax
cmp esi, dword [esp + 0x1c]
mov byte [esp + 0x544], 6
jae 0x462959
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx + esi*4]
lea edx, [esp + 0x12c]
push edx
push eax
lea ecx, [esp + 0x1c]
call fcn.0040e69a
mov edi, dword [esp + 0x14]
push edi
call ebp
test eax, eax
jne 0x462963
cmp esi, dword [esp + 0x1c]
jae 0x462959
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 0x18]
mov eax, dword [eax + esi*4]
push ecx
push eax
lea ecx, [esp + 0x1c]
call fcn.0040e69a
mov edi, dword [esp + 0x14]
push edi
call ebp
test eax, eax
jne 0x4629ed
lea eax, [edi - 0x10]
mov byte [esp + 0x544], bl
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4628e3
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x1c]
add esi, 1
cmp esi, eax
jb 0x462840
mov ecx, dword [esp + 0x18]
test ecx, ecx
je 0x46290e
push eax
push ecx
call fcn.0040e9c0
mov ecx, dword [esp + 0x20]
push ecx
call fcn.00448193
add esp, 0xc
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
mov dword [esp + 0x544], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x462939
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 0x80004005
pop ebx
mov ecx, dword [esp + 0x538]
pop ebp
pop esi
pop edi
mov dword fs:[0], ecx
add esp, 0x538
ret 4
push 0x80070057
call fcn.0040109c
lea ecx, [esp + 0x14]
push ecx
mov ecx, dword [esp + 0x550]
call fcn.0040e6c3
lea eax, [edi - 0x10]
mov byte [esp + 0x544], bl
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x462997
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x18]
test eax, eax
je 0x4629b7
mov ecx, dword [esp + 0x1c]
push ecx
push eax
call fcn.0040e9c0
mov edx, dword [esp + 0x20]
push edx
call fcn.00448193
add esp, 0xc
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
mov dword [esp + 0x544], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x462a6c
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
jmp 0x46293e
lea ecx, [esp + 0x14]
push ecx
mov ecx, dword [esp + 0x550]
call fcn.0040e6c3
lea eax, [edi - 0x10]
mov byte [esp + 0x544], bl
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x462a21
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x18]
test eax, eax
je 0x462a41
mov ecx, dword [esp + 0x1c]
push ecx
push eax
call fcn.0040e9c0
mov edx, dword [esp + 0x20]
push edx
call fcn.00448193
add esp, 0xc
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
mov dword [esp + 0x544], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x462a6c
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
jmp 0x46293e