Function at 0x401720
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, 0x88b8
call fcn.004037a8
sub esp, eax
mov eax, dword [esp + eax]
mov dword [ebp - 0x88a8], edx
mov dword [esp + 4], 0x405066
mov edi, eax
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_wcspbrk]
test eax, eax
je 0x401c44
lea esi, [ebp - 0x8018]
xor eax, eax
mov dword [esp + 4], 0x2000
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.kernel32.dll_GetFullPathNameW]
mov dword [esp + 8], esi
mov dword [esp], edi
mov dword [ebp - 0x88a0], eax
call eax
sub esp, 0x10
mov dword [esp + 4], 0x5c
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll_wcsrchr]
mov ebx, eax
xor eax, eax
mov dword [ebp - 0x889c], eax
test ebx, ebx
je 0x4017c0
mov dword [esp + 4], 0x2e
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_wcschr]
test eax, eax
setne al
movzx eax, al
mov dword [ebp - 0x889c], eax
lea ecx, [ebp - 0x8678]
xor eax, eax
mov dword [ebp - 0x8898], ecx
nop
movzx edx, word [ebx + eax + 2]
mov word [ecx + eax], dx
add eax, 2
test dx, dx
jne 0x4017d0
mov word [ebx + 2], 0
mov ebx, dword [sym.imp.kernel32.dll_GetEnvironmentVariableW]
lea eax, [ebp - 0x4018]
mov dword [esp + 8], 0x2000
mov dword [esp + 4], eax
mov dword [esp], str.PATHEXT
call ebx
sub eax, 1
sub esp, 0xc
cmp eax, 0x1ffe
jbe 0x401837
xor eax, eax
lea esi, [esi]
nop
movzx edx, word [eax + str..bat_.com_.cmd_.exe]
mov word [ebp + eax - 0x4018], dx
add eax, 2
test dx, dx
jne 0x401820
test byte [section..data], 8
jne 0x401d33
mov dword [ebp - 0x8894], esi
mov dword [ebp - 0x88a4], edi
lea esi, [ebp - 0x8470]
lea esi, [esi]
lea esi, [esi]
mov ecx, 0x82
mov edi, esi
xor eax, eax
mov ebx, dword [ebp - 0x8894]
rep stosd dword es:[edi], eax
jmp 0x401887
mov ecx, eax
xor ecx, 1
cmp dx, 0x22
cmove eax, ecx
add ebx, 2
movzx edx, word [ebx]
test eax, eax
jne 0x401898
cmp dx, 0x3b
je 0x401ae8
test dx, dx
jne 0x401878
mov ecx, dword [ebp - 0x8894]
xor eax, eax
lea esi, [esi]
movzx edx, word [ecx + eax]
mov word [esi + eax], dx
add eax, 2
test dx, dx
jne 0x4018a8
movzx edx, word [ebp - 0x8470]
mov eax, esi
mov dword [ebp - 0x8894], 0
test dx, dx
je 0x401b29
lea esi, [esi]
add eax, 2
cmp word [eax], 0
jne 0x4018d8
sub eax, esi
sar eax, 1
cmp word [ebp + eax*2 - 0x8472], 0x22
lea ecx, [eax - 1]
je 0x401b40
cmp dx, 0x22
je 0x401aa0
xor eax, eax
lea esi, [esi]
nop
movzx edx, word [esi + eax]
mov word [ebp + eax - 0x8880], dx
add eax, 2
test dx, dx
jne 0x401908
lea eax, [ebp - 0x8880]
mov dword [esp + 0xc], 0
mov dword [esp + 8], esi
mov dword [esp + 4], 0x104
mov dword [esp], eax
mov eax, dword [ebp - 0x88a0]
call eax
mov eax, esi
sub esp, 0x10
cmp word [ebp - 0x8470], 0
je 0x401c2f
lea esi, [esi]
add eax, 2
cmp word [eax], 0
jne 0x401958
sub eax, esi
sar eax, 1
cmp word [ebp + eax*2 - 0x8472], 0x5c
je 0x4019a9
mov edx, esi
lea esi, [esi]
add edx, 2
cmp word [edx], 0
jne 0x401978
xor eax, eax
lea esi, [esi]
nop
movzx ecx, word [eax + 0x4050d8]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x401988
cmp word [ebp - 0x8470], 0
je 0x401ada
mov edx, esi
lea esi, [esi]
nop
add edx, 2
cmp word [edx], 0
jne 0x4019b0
mov ebx, dword [ebp - 0x8898]
xor eax, eax
lea esi, [esi]
movzx ecx, word [ebx + eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x4019c8
cmp word [ebp - 0x8470], 0
mov ebx, esi
je 0x401ac5
lea esi, [esi]
nop
add ebx, 2
cmp word [ebx], 0
jne 0x4019f0
mov edi, dword [ebp - 0x889c]
test edi, edi
je 0x401a26
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_GetFileAttributesW]
sub esp, 4
cmp eax, 0xffffffff
jne 0x401bcb
cmp word [ebp - 0x8470], 0
je 0x401ad3
mov edx, esi
lea esi, [esi]
nop
add edx, 2
cmp word [edx], 0
jne 0x401a30
xor eax, eax
lea esi, [esi]
nop
movzx ecx, word [eax + 0x4050dc]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x401a40
lea eax, [ebp - 0x8268]
mov dword [esp], esi
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_FindFirstFileW]
sub esp, 8
mov edi, eax
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_FindClose]
sub esp, 4
cmp edi, 0xffffffff
jne 0x401b60
mov ecx, dword [ebp - 0x8894]
test ecx, ecx
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 - 0x846e]
mov word [ebp + eax - 0x8880], dx
add eax, 2
test dx, dx
jne 0x401aa8
jmp 0x40191c
mov eax, dword [ebp - 0x889c]
test eax, eax
jne 0x401a03
mov edx, esi
jmp 0x401a39
mov edx, esi
jmp 0x4019b9
mov eax, dword [ebp - 0x8894]
mov edi, ebx
mov dword [esp], esi
sub edi, eax
mov dword [esp + 4], eax
mov dword [esp + 8], edi
sar edi, 1
call sub.ucrtbase.dll_memcpy
xor eax, eax
mov word [ebp + edi*2 - 0x8470], ax
movzx edx, word [ebp - 0x8470]
lea eax, [ebx + 2]
mov dword [ebp - 0x8894], eax
mov eax, esi
test dx, dx
jne 0x4018d8
cmp word [ebp - 0x8472], 0x22
jne 0x401901
or ecx, 0xffffffff
lea esi, [esi]
xor eax, eax
mov word [ebp + ecx*2 - 0x8470], ax
movzx edx, word [ebp - 0x8470]
jmp 0x4018f7
lea edi, [ebp - 0x4018]
lea esi, [esi]
lea esi, [esi]
mov dword [esp + 4], 0x3b
mov dword [esp], edi
call dword [sym.imp.ucrtbase.dll_wcschr]
test eax, eax
je 0x401c00
mov ecx, eax
mov dword [ebp - 0x8890], eax
sub ecx, edi
mov dword [esp + 8], ecx
mov dword [ebp - 0x888c], ecx
mov dword [esp + 4], edi
mov dword [esp], ebx
call sub.ucrtbase.dll_memcpy
mov ecx, dword [ebp - 0x888c]
xor edx, edx
mov word [ebx + ecx], dx
mov edx, dword [ebp - 0x8890]
mov dword [esp], esi
lea edi, [edx + 2]
call dword [sym.imp.kernel32.dll_GetFileAttributesW]
sub esp, 4
cmp eax, 0xffffffff
je 0x401b70
mov edi, dword [ebp - 0x88a4]
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wcsdup]
mov esi, dword [ebp - 0x88a8]
mov edx, 1
mov dword [esi], eax
test eax, eax
jne 0x401a90
mov edx, edi
mov eax, 0xe
call fcn.004015c0
lea esi, [esi]
nop
xor edx, edx
lea esi, [esi]
movzx eax, word [edi + edx]
mov word [ebx + edx], ax
add edx, 2
test ax, ax
jne 0x401c08
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_GetFileAttributesW]
sub esp, 4
cmp eax, 0xffffffff
je 0x401a80
jmp 0x401bcb
cmp word [ebp - 0x8472], 0x5c
je 0x401ada
mov edx, esi
jmp 0x401981
lea esi, [ebp - 0x8018]
lea esi, [esi]
movzx edx, word [eax + 0x40506e]
mov word [esi + eax], dx
add eax, 2
test dx, dx
jne 0x401c50
lea eax, [ebp - 0x8014]
mov ebx, dword [sym.imp.kernel32.dll_GetEnvironmentVariableW]
mov dword [esp + 8], 0x1ffe
mov dword [esp + 4], eax
mov dword [esp], 0x405074
call ebx
sub eax, 1
sub esp, 0xc
cmp eax, 0x1ffc
jbe 0x401cab
xor eax, eax
lea esi, [esi]
nop
movzx edx, word [eax + 0x40507e]
mov word [esi + eax], dx
add eax, 2
test dx, dx
jne 0x401c98
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 0x401ce9
lea esi, [esi]
nop
add edx, 2
cmp word [edx], 0
jne 0x401cd0
sub edx, edi
xor eax, eax
cmp edx, 0x206
jg 0x401a8e
lea edx, [ebp - 0x8678]
mov dword [ebp - 0x888c], ecx
mov dword [ebp - 0x8898], edx
mov ecx, edx
lea esi, [esi]
movzx edx, word [edi + eax]
mov word [ecx + eax], dx
add eax, 2
test dx, dx
jne 0x401d00
mov ecx, dword [ebp - 0x888c]
xor eax, eax
test ecx, ecx
setne al
mov dword [ebp - 0x889c], eax
mov eax, dword [sym.imp.kernel32.dll_GetFullPathNameW]
mov dword [ebp - 0x88a0], eax
jmp 0x4017ed
mov eax, dword [ebp - 0x8898]
call fcn.004013a0
mov ebx, eax
mov eax, esi
call fcn.004013a0
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], 0x404000
mov dword [esp], 3
call fcn.004014c0
jmp 0x401844