Function at 0x401730
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.00403858
sub esp, eax
mov eax, dword [esp + eax]
mov dword [ebp - 0x8890], edx
mov edi, eax
mov dword [esp + 4], 0x406066
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_wcspbrk]
test eax, eax
je 0x401c86
xor eax, eax
lea ebx, [ebp - 0x800c]
mov dword [esp + 4], 0x2000
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.kernel32.dll_GetFullPathNameW]
mov dword [esp + 8], ebx
mov dword [esp], edi
mov dword [ebp - 0x8888], eax
call eax
sub esp, 0x10
mov dword [esp + 4], 0x5c
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_wcsrchr]
mov esi, eax
xor eax, eax
mov dword [ebp - 0x8884], eax
test esi, esi
je 0x4017d0
mov dword [esp + 4], 0x2e
mov dword [esp], esi
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
nop
movzx edx, word [esi + eax + 2]
mov word [ecx + eax], dx
add eax, 2
test dx, dx
jne 0x4017e0
mov word [esi + 2], 0
mov esi, 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 esi
sub eax, 1
sub esp, 0xc
cmp eax, 0x1ffe
jbe 0x401847
xor eax, eax
lea esi, [esi]
nop
movzx edx, word [eax + str..bat_.com_.cmd_.exe]
mov word [ebp + eax - 0x400c], dx
add eax, 2
test dx, dx
jne 0x401830
test byte [0x404000], 8
jne 0x401d73
mov dword [ebp - 0x887c], ebx
mov dword [ebp - 0x888c], edi
mov ecx, 0x82
lea edi, [ebp - 0x8464]
xor eax, eax
mov ebx, dword [ebp - 0x887c]
rep stosd dword es:[edi], eax
jmp 0x40188f
mov ecx, eax
xor ecx, 1
cmp dx, 0x22
cmove eax, ecx
add ebx, 2
movzx edx, word [ebx]
test eax, eax
jne 0x4018a0
cmp dx, 0x3b
je 0x401b08
test dx, dx
jne 0x401880
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 0x4018b0
mov dword [ebp - 0x887c], 0
movzx edx, word [ebp - 0x8464]
lea eax, [ebp - 0x8464]
test dx, dx
je 0x401c15
lea esi, [esi]
add eax, 2
cmp word [eax], 0
jne 0x4018e8
lea edi, [ebp - 0x8464]
sub eax, edi
sar eax, 1
cmp word [ebp + eax*2 - 0x8466], 0x22
lea ecx, [eax - 1]
je 0x401c30
cmp dx, 0x22
je 0x401ae0
xor eax, eax
lea esi, [esi]
movzx edx, word [ebp + eax - 0x8464]
mov word [ebp + eax - 0x8874], dx
add eax, 2
test dx, dx
jne 0x401920
lea eax, [ebp - 0x8464]
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
lea eax, [ebp - 0x8874]
mov dword [esp + 4], 0x104
mov dword [esp], eax
mov eax, dword [ebp - 0x8888]
call eax
lea eax, [ebp - 0x8464]
sub esp, 0x10
cmp word [ebp - 0x8464], 0
je 0x401c46
lea esi, [esi]
add eax, 2
cmp word [eax], 0
jne 0x401980
lea edi, [ebp - 0x8464]
sub eax, edi
sar eax, 1
cmp word [ebp + eax*2 - 0x8466], 0x5c
je 0x4019d1
mov edx, edi
add edx, 2
cmp word [edx], 0
jne 0x4019a0
xor eax, eax
lea esi, [esi]
nop
movzx ecx, word [eax + 0x4060d8]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x4019b0
cmp word [ebp - 0x8464], 0
je 0x401c7b
lea edx, [ebp - 0x8464]
lea esi, [esi]
nop
add edx, 2
cmp word [edx], 0
jne 0x4019e0
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 0x4019f8
cmp word [ebp - 0x8464], 0
lea ebx, [ebp - 0x8464]
je 0x401c5b
lea esi, [esi]
add ebx, 2
cmp word [ebx], 0
jne 0x401a20
mov esi, dword [ebp - 0x8884]
test esi, esi
je 0x401a5c
lea eax, [ebp - 0x8464]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetFileAttributesW]
sub esp, 4
cmp eax, 0xffffffff
jne 0x401ba7
cmp word [ebp - 0x8464], 0
je 0x401c70
lea edx, [ebp - 0x8464]
lea esi, [esi]
add edx, 2
cmp word [edx], 0
jne 0x401a68
xor eax, eax
lea esi, [esi]
nop
movzx ecx, word [eax + 0x4060dc]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x401a78
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 0x401b48
mov ebx, dword [ebp - 0x887c]
test ebx, ebx
jne 0x401860
xor edx, edx
lea esp, [ebp - 0xc]
mov eax, edx
pop ebx
pop esi
pop edi
pop ebp
ret
xor eax, eax
lea esi, [esi]
movzx edx, word [ebp + eax - 0x8462]
mov word [ebp + eax - 0x8874], dx
add eax, 2
test dx, dx
jne 0x401ae8
jmp 0x401938
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
lea eax, [ebx + 2]
mov dword [ebp - 0x887c], eax
jmp 0x4018ce
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 0x401be0
mov edx, eax
sub edx, esi
mov dword [esp + 8], edx
mov dword [ebp - 0x8878], edx
mov dword [esp + 4], esi
lea esi, [edi + 2]
mov dword [esp], ebx
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 0x401b50
lea eax, [ebp - 0x8464]
mov edi, dword [ebp - 0x888c]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll__wcsdup]
mov esi, dword [ebp - 0x8890]
mov edx, 1
mov dword [esi], eax
test eax, eax
jne 0x401ace
mov edx, edi
mov eax, 0xe
call sym._fatal_string_error.constprop.0
lea esi, [esi]
xor eax, eax
lea esi, [esi]
movzx edx, word [esi + eax]
mov word [ebx + eax], dx
add eax, 2
test dx, dx
jne 0x401be8
lea eax, [ebp - 0x8464]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetFileAttributesW]
sub esp, 4
cmp eax, 0xffffffff
je 0x401abe
jmp 0x401ba7
cmp word [ebp - 0x8466], 0x22
jne 0x401917
or ecx, 0xffffffff
lea esi, [esi]
lea esi, [esi]
xor edi, edi
mov word [ebp + ecx*2 - 0x8464], di
movzx edx, word [ebp - 0x8464]
jmp 0x40190d
cmp word [ebp - 0x8466], 0x5c
je 0x401c7b
lea edx, [ebp - 0x8464]
jmp 0x4019a9
mov eax, dword [ebp - 0x8884]
mov edx, ebx
test eax, eax
je 0x401a71
jmp 0x401a33
lea edx, [ebp - 0x8464]
jmp 0x401a71
lea edx, [ebp - 0x8464]
jmp 0x4019e9
lea ebx, [ebp - 0x800c]
lea esi, [esi]
movzx edx, word [eax + 0x40606e]
mov word [ebx + eax], dx
add eax, 2
test dx, dx
jne 0x401c90
lea eax, [ebp - 0x8008]
mov dword [esp + 8], 0x1ffe
mov esi, dword [sym.imp.kernel32.dll_GetEnvironmentVariableW]
mov dword [esp + 4], eax
mov dword [esp], 0x406074
call esi
sub eax, 1
sub esp, 0xc
cmp eax, 0x1ffc
jbe 0x401ceb
xor eax, eax
lea esi, [esi]
nop
movzx edx, word [eax + 0x40607e]
mov word [ebx + eax], dx
add eax, 2
test dx, dx
jne 0x401cd8
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 0x401d29
lea esi, [esi]
nop
add edx, 2
cmp word [edx], 0
jne 0x401d10
sub edx, edi
xor eax, eax
cmp edx, 0x206
jg 0x401acc
lea edx, [ebp - 0x866c]
mov dword [ebp - 0x8878], ecx
mov dword [ebp - 0x8880], edx
mov ecx, edx
lea esi, [esi]
movzx edx, word [edi + eax]
mov word [ecx + eax], dx
add eax, 2
test dx, dx
jne 0x401d40
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 0x4017fd
mov eax, dword [ebp - 0x8880]
call sym._wine_dbgstr_wn.constprop.0
mov esi, eax
mov eax, ebx
call sym._wine_dbgstr_wn.constprop.0
mov dword [esp + 0x14], esi
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], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x401854