Function at 0x4022a0
Capabilities:
Check if file exists
Get file attributes
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
push eax
mov eax, 0x8898
call fcn.00401048
sub esp, eax
mov eax, dword [esp + eax]
mov dword [ebp - 0x8890], edx
mov dword [ebp - 0x888c], eax
mov dword [esp + 4], 0x405066
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_wcspbrk]
test eax, eax
je 0x402804
mov eax, dword [ebp - 0x888c]
lea esi, [ebp - 0x800c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], esi
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_GetFullPathNameW]
mov dword [esp + 4], 0x2000
mov dword [ebp - 0x8888], eax
call eax
sub esp, 0x10
mov dword [esp + 4], 0x5c
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll_wcsrchr]
mov dword [ebp - 0x8884], 0
mov ebx, eax
test eax, eax
je 0x40234e
mov dword [esp + 4], 0x2e
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_wcschr]
test eax, eax
setne al
movzx eax, al
mov dword [ebp - 0x8884], eax
lea ecx, [ebp - 0x866c]
xor eax, eax
mov dword [ebp - 0x8880], ecx
lea esi, [esi]
movzx edx, word [ebx + eax + 2]
mov word [ecx + eax], dx
add eax, 2
test dx, dx
jne 0x402360
mov word [ebx + 2], 0
mov ebx, dword [sym.imp.kernel32.dll_GetEnvironmentVariableW]
lea eax, [ebp - 0x400c]
mov dword [esp + 8], 0x2000
mov dword [esp + 4], eax
mov dword [esp], str.PATHEXT
call ebx
dec eax
sub esp, 0xc
cmp eax, 0x1ffe
jbe 0x4023bf
xor eax, eax
lea esi, [esi]
movzx edx, word [eax + str..bat_.com_.cmd_.exe]
mov word [ebp + eax - 0x400c], dx
add eax, 2
test dx, dx
jne 0x4023a8
test byte [0x404020], 8
jne 0x4028fb
mov dword [ebp - 0x887c], esi
lea esi, [esi]
mov ecx, 0x82
lea edi, [ebp - 0x8464]
xor eax, eax
mov ebx, dword [ebp - 0x887c]
rep stosd dword es:[edi], eax
jmp 0x4023ff
mov ecx, eax
xor ecx, 1
cmp dx, 0x22
cmove eax, ecx
add ebx, 2
movzx edx, word [ebx]
test eax, eax
jne 0x402410
cmp dx, 0x3b
je 0x402680
test dx, dx
jne 0x4023f0
mov ecx, dword [ebp - 0x887c]
xor eax, eax
lea esi, [esi]
movzx edx, word [ecx + eax]
mov word [ebp + eax - 0x8464], dx
add eax, 2
test dx, dx
jne 0x402420
movzx edx, word [ebp - 0x8464]
mov dword [ebp - 0x887c], 0
test dx, dx
je 0x4026c5
lea eax, [ebp - 0x8464]
lea esi, [esi]
add eax, 2
cmp word [eax], 0
jne 0x402458
lea edi, [ebp - 0x8464]
sub eax, edi
sar eax, 1
cmp word [ebp + eax*2 - 0x8466], 0x22
lea ecx, [eax - 1]
je 0x4027c0
xor eax, eax
cmp dx, 0x22
jne 0x402498
jmp 0x402660
movzx edx, word [ebp + eax - 0x8464]
mov word [ebp + eax - 0x8874], dx
add eax, 2
test dx, dx
jne 0x402490
lea eax, [ebp - 0x8464]
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
lea eax, [ebp - 0x8874]
mov dword [esp], eax
mov eax, dword [ebp - 0x8888]
mov dword [esp + 4], 0x104
call eax
lea eax, [ebp - 0x8464]
sub esp, 0x10
cmp word [ebp - 0x8464], 0
je 0x4027eb
lea esi, [esi]
add eax, 2
cmp word [eax], 0
jne 0x4024f0
lea edi, [ebp - 0x8464]
sub eax, edi
sar eax, 1
cmp word [ebp + eax*2 - 0x8466], 0x5c
je 0x402553
lea edx, [ebp - 0x8464]
lea esi, [esi]
add edx, 2
cmp word [edx], 0
jne 0x402518
xor eax, eax
mov ecx, 0x5c
jmp 0x402537
movzx ecx, word [eax + 0x4050d8]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x402530
cmp word [ebp - 0x8464], 0
lea edx, [ebp - 0x8464]
je 0x402569
lea edx, [ebp - 0x8464]
lea esi, [esi]
add edx, 2
cmp word [edx], 0
jne 0x402560
mov ebx, dword [ebp - 0x8880]
xor eax, eax
lea esi, [esi]
movzx ecx, word [ebx + eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x402578
cmp word [ebp - 0x8464], 0
lea ebx, [ebp - 0x8464]
je 0x4027d6
lea esi, [esi]
add ebx, 2
cmp word [ebx], 0
jne 0x4025a0
mov edx, dword [ebp - 0x8884]
test edx, edx
je 0x4025dc
lea eax, [ebp - 0x8464]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetFileAttributesW]
sub esp, 4
cmp eax, 0xffffffff
jne 0x402783
cmp word [ebp - 0x8464], 0
je 0x402940
lea edx, [ebp - 0x8464]
lea esi, [esi]
add edx, 2
cmp word [edx], 0
jne 0x4025e8
xor eax, eax
mov ecx, 0x2e
jmp 0x402607
movzx ecx, word [eax + 0x4050dc]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x402600
lea eax, [ebp - 0x825c]
mov dword [esp + 4], eax
lea eax, [ebp - 0x8464]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_FindFirstFileW]
sub esp, 8
mov esi, eax
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_FindClose]
sub esp, 4
cmp esi, 0xffffffff
jne 0x4026e8
mov ebx, dword [ebp - 0x887c]
test ebx, ebx
jne 0x4023d8
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
movzx edx, word [ebp + eax - 0x8462]
mov word [ebp + eax - 0x8874], dx
add eax, 2
test dx, dx
jne 0x402660
jmp 0x4024a8
mov eax, dword [ebp - 0x887c]
mov esi, ebx
sub esi, eax
mov dword [esp + 4], eax
lea eax, [ebp - 0x8464]
mov dword [esp + 8], esi
sar esi, 1
mov dword [esp], eax
call sym._memcpy
xor eax, eax
mov word [ebp + esi*2 - 0x8464], ax
movzx edx, word [ebp - 0x8464]
lea eax, [ebx + 2]
mov dword [ebp - 0x887c], eax
test dx, dx
jne 0x40244e
cmp word [ebp - 0x8466], 0x22
je 0x4027b9
mov word [ebp - 0x8874], 0
jmp 0x4024a8
lea esi, [ebp - 0x400c]
nop
mov dword [esp + 4], 0x3b
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll_wcschr]
mov edi, eax
test eax, eax
je 0x402750
mov edx, eax
mov dword [esp + 4], esi
sub edx, esi
mov dword [esp], ebx
lea esi, [edi + 2]
mov dword [esp + 8], edx
mov dword [ebp - 0x8878], edx
call sym._memcpy
mov edx, dword [ebp - 0x8878]
xor ecx, ecx
lea eax, [ebp - 0x8464]
mov word [ebx + edx], cx
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetFileAttributesW]
sub esp, 4
cmp eax, 0xffffffff
je 0x4026f0
jmp 0x402783
xor eax, eax
lea esi, [esi]
movzx edx, word [esi + eax]
mov word [ebx + eax], dx
add eax, 2
test dx, dx
jne 0x402758
lea eax, [ebp - 0x8464]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetFileAttributesW]
sub esp, 4
cmp eax, 0xffffffff
je 0x402646
lea eax, [ebp - 0x8464]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll__wcsdup]
mov edx, eax
mov eax, dword [ebp - 0x8890]
mov dword [eax], edx
mov eax, 1
test edx, edx
jne 0x402656
mov edx, dword [ebp - 0x888c]
mov eax, 0xe
call sym._fatal_string_error.constprop.0
or ecx, 0xffffffff
lea esi, [esi]
xor edi, edi
mov word [ebp + ecx*2 - 0x8464], di
movzx edx, word [ebp - 0x8464]
jmp 0x40247d
mov esi, dword [ebp - 0x8884]
test esi, esi
jne 0x4025b3
mov edx, ebx
jmp 0x4025f1
cmp word [ebp - 0x8466], 0x5c
lea edx, [ebp - 0x8464]
je 0x402569
jmp 0x402521
lea esi, [ebp - 0x800c]
lea esi, [esi]
movzx edx, word [eax + 0x40506e]
mov word [esi + eax], dx
add eax, 2
test dx, dx
jne 0x402810
lea eax, [ebp - 0x8008]
mov dword [esp + 8], 0x1ffe
mov ebx, dword [sym.imp.kernel32.dll_GetEnvironmentVariableW]
mov dword [esp + 4], eax
mov dword [esp], 0x405074
call ebx
dec eax
sub esp, 0xc
cmp eax, 0x1ffc
jbe 0x40286b
xor eax, eax
lea esi, [esi]
movzx edx, word [eax + 0x40507e]
mov word [esi + eax], dx
add eax, 2
test dx, dx
jne 0x402858
mov edi, dword [ebp - 0x888c]
mov dword [esp + 4], 0x2e
mov dword [esp], edi
call dword [sym.imp.ucrtbase.dll_wcschr]
mov edx, edi
mov ecx, eax
xor eax, eax
cmp word [edi], 0
je 0x4028ad
nop
add edx, 2
cmp word [edx], 0
jne 0x402890
sub edx, dword [ebp - 0x888c]
xor eax, eax
cmp edx, 0x206
jg 0x402654
lea edi, [ebp - 0x866c]
mov dword [ebp - 0x8878], ecx
mov ecx, dword [ebp - 0x888c]
mov dword [ebp - 0x8880], edi
lea esi, [esi]
movzx edx, word [ecx + eax]
mov word [edi + eax], dx
add eax, 2
test dx, dx
jne 0x4028c8
mov ecx, dword [ebp - 0x8878]
xor eax, eax
test ecx, ecx
setne al
mov dword [ebp - 0x8884], eax
mov eax, dword [sym.imp.kernel32.dll_GetFullPathNameW]
mov dword [ebp - 0x8888], eax
jmp 0x40237d
mov eax, dword [ebp - 0x8880]
call sym._wine_dbgstr_wn.constprop.0
mov ebx, eax
mov eax, esi
call sym._wine_dbgstr_wn.constprop.0
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Searching_in__s_for__s_n
mov dword [esp + 8], str.search_path
mov dword [esp + 4], 0x404020
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x4023cc
lea edx, [ebp - 0x8464]
jmp 0x4025f1