Function at 0x40f350
Capabilities:
Check if file exists
Get file attributes

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x24c
mov eax, dword [0x42d0b4]
xor eax, esp
mov dword [esp + 0x248], eax
mov ecx, dword [ecx + 0x38]
push ebx
push esi
xor ebx, ebx
mov dword [esp + 0xc], edx
push edi
mov dword [esp + 0x1c], ebx
xor esi, esi
call fcn.0040ffb0
mov edi, eax
test edi, edi
je 0x40f3ab
mov esi, edi
lea ecx, [esi + 2]
mov edi, edi
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x40f390
sub esi, ecx
sar esi, 1
cmp esi, 0x7fe7
jae 0x41e173
cmp byte [0x435745], bl
je 0x40f3d4
test edi, edi
je 0x41e182
push 4
push 0x402508
push edi
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
je 0x41e182
push 0x104
lea eax, [esp + 0x34]
mov dword [esp + 0x23c], ebx
push 0
push eax
mov byte [esp + 0x248], 1
mov dword [esp + 0x24c], 0x104
call sub.msvcrt.dll_memset
add esp, 0xc
cmp byte [esp + 0x23c], bl
je 0x41e1a5
mov eax, 0x7fe7
push eax
lea ecx, [esp + 0x34]
call fcn.0040e330
test eax, eax
js 0x41e1af
push edi
lea ecx, [esp + 0x34]
call fcn.0040a586
mov ecx, dword [esp + 0x238]
test ecx, ecx
je 0x41e1d4
mov ebx, 0x5c
mov edx, 0x2f
call fcn.0040a574
test eax, eax
jne 0x41e1dd
mov ecx, dword [esp + 0x238]
mov dword [esp + 0x24c], 0x3a005c
mov word [esp + 0x250], ax
test ecx, ecx
je 0x41e1e8
lea edx, [esp + 0x24c]
call fcn.00409dfa
cmp eax, esi
jae 0x40f9b8
mov ecx, dword [esp + 0x238]
xor eax, eax
mov dword [esp + 0x18], 1
mov word [esp + 0x24e], ax
test ecx, ecx
je 0x41e1f1
mov edx, ebx
call fcn.00410145
mov edi, eax
test edi, edi
je 0x41e1fa
mov esi, dword [esp + 0x238]
add edi, 2
cmp word [edi], 0
je 0x41e322
mov ecx, 0x402424
mov eax, edi
lea esp, [esp]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x40fb44
test dx, dx
je 0x40f50a
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x40fb44
add eax, 4
add ecx, 4
test dx, dx
jne 0x40f4e0
xor eax, eax
test eax, eax
je 0x41e322
mov ecx, 0x402500
mov eax, edi
jmp 0x40f520
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x40fb4e
test dx, dx
je 0x40f54a
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x40fb4e
add eax, 4
add ecx, 4
test dx, dx
jne 0x40f520
xor eax, eax
test eax, eax
je 0x41e322
mov ecx, 0x1ff9c
call fcn.0040dc10
mov esi, eax
mov eax, dword [esp + 0x238]
test esi, esi
je 0x41e231
test eax, eax
je 0x41e253
mov ebx, dword [ebp + 8]
mov edx, ebx
mov ecx, dword [esp + 0x10]
push eax
call fcn.0040f2e0
mov ecx, dword [esp + 0x238]
test ecx, ecx
je 0x41e25c
mov eax, edi
xor edx, edx
sub eax, ecx
mov ecx, dword [esp + 0x10]
sar eax, 1
push 0x402424
mov word [ecx + eax*2], dx
mov edx, ebx
mov ebx, ecx
call fcn.0040fb80
push ebx
mov edx, 0xffce
mov ecx, esi
call fcn.00411c55
test eax, eax
jne 0x41e265
movzx eax, word [esi]
mov ecx, esi
mov edx, eax
test ax, ax
je 0x40f5e2
mov eax, ecx
add ecx, 2
cmp word [ecx], 0
jne 0x40f5d4
movzx edx, word [eax]
cmp dx, 0x5c
je 0x40f5f9
push 0x4024fc
mov edx, 0xffce
mov ecx, esi
call fcn.0040fb80
push edi
mov edx, 0xffce
mov ecx, esi
call fcn.0040fb80
mov edx, esi
lea ecx, [edx + 2]
jmp 0x40f610
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x40f610
sub edx, ecx
mov ecx, esi
sar edx, 1
lea edx, [edx*2 + 2]
call fcn.0040dc60
mov ebx, eax
test ebx, ebx
je 0x41e223
mov edx, 0x5c
mov ecx, ebx
call fcn.00410145
xor ecx, ecx
mov word [eax], cx
add eax, 2
mov dword [esp + 0x24], eax
cmp dword [esp + 0x18], ecx
je 0x40f9e0
xor esi, esi
push dword [esp + 0x10]
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_NeedCurrentDirectoryForExePathW]
mov dword [esp + 0x14], eax
test eax, eax
je 0x41e2a9
mov ecx, ebx
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40f676
sub ecx, edx
sar ecx, 1
lea edi, [ecx + 4]
test esi, esi
jne 0x40f99d
lea ecx, [edi + edi]
call fcn.0040dc10
mov esi, eax
test esi, esi
je 0x41e22a
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40f6d4
push 0x402420
mov edx, edi
mov ecx, esi
call fcn.0040fb80
push ebx
mov edx, edi
mov ecx, esi
call fcn.0040fb80
push 0x402420
mov edx, edi
mov ecx, esi
call fcn.0040fb80
mov eax, dword [esp + 0x14]
cmp dword [esp + 0x18], 0
je 0x40f9f5
mov ecx, esi
call fcn.00410ab0
push 1
mov edx, 0x40241c
mov ecx, esi
call fcn.0040bb40
mov edx, dword [esp + 0x24]
mov edi, eax
mov dword [esp + 0x14], edi
lea esi, [edx + 2]
mov cx, word [edx]
add edx, 2
test cx, cx
jne 0x40f701
sub edx, esi
sar edx, 1
lea eax, [edx + 1]
mov dword [esp + 0x28], eax
cmp byte [0x435745], cl
je 0x41e2b3
mov ecx, 0x4024e0
call fcn.0040eb6e
mov esi, eax
test esi, esi
je 0x41e2b3
mov ecx, esi
call fcn.00410ab0
push 1
mov edx, 0x40241c
mov ecx, esi
call fcn.0040bb40
mov dword [esp + 0x2c], eax
jmp 0x40f7b6
cmp dword [esp + 0x18], 0
jne 0x40fb58
mov eax, dword [0x435798]
cmp eax, 2
jne 0x41e2dc
mov edx, 0x2a
mov ecx, ebx
call fcn.0040a574
test eax, eax
jne 0x40fb13
lea edx, [eax + 0x3f]
mov ecx, ebx
call fcn.0040a574
test eax, eax
jne 0x40fb13
mov ebx, dword [esp + 0x2c]
mov edi, ebx
mov edx, dword [ebp + 8]
mov ecx, dword [esp + 0x10]
push eax
push 0x4024ac
push esi
call fcn.0040934f
test eax, eax
jne 0x40fa64
mov edi, dword [esp + 0x14]
mov esi, edi
lea ecx, [esi + 2]
jmp 0x40f7c0
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x40f7c0
sub esi, ecx
mov ecx, edi
sar esi, 1
lea ebx, [esi + 1]
mov dword [esp + 0x1c], ebx
call fcn.0040ffb0
push eax
mov edx, ebx
mov ecx, edi
call fcn.0040f2e0
mov edx, edi
lea ecx, [edx + 2]
lea esp, [esp]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x40f7f0
sub edx, ecx
mov eax, edi
movzx ecx, word [edi]
sar edx, 1
mov ebx, ecx
mov dword [esp + 0x20], ebx
mov edi, ecx
test cx, cx
je 0x40f81f
mov ecx, eax
add eax, 2
cmp word [eax], 0
jne 0x40f811
movzx edi, word [ecx]
movzx ebx, di
cmp di, 0x5c
je 0x40f82d
mov esi, dword [esp + 0x1c]
inc edx
cmp word [esp + 0x20], 0
je 0x40fb0c
mov eax, dword [esp + 0x28]
add eax, edx
mov dword [esp + 0x20], eax
cmp eax, 0x7fe7
ja 0x41e2bd
mov edi, dword [esp + 0x14]
mov edx, dword [ebp + 8]
mov ecx, dword [esp + 0x10]
push edi
call fcn.0040f2e0
cmp ebx, 0x5c
je 0x40fa22
lea edi, [edi + esi*2]
mov esi, dword [ebp + 8]
mov dword [esp + 0x14], edi
cmp ebx, 0x5c
je 0x40f88a
mov ecx, dword [esp + 0x10]
lea eax, [esp + 0x24c]
push eax
mov edx, esi
call fcn.0040fb80
mov ebx, dword [esp + 0x24]
mov edx, esi
mov ecx, dword [esp + 0x10]
push ebx
call fcn.0040fb80
mov ecx, dword [esp + 0x10]
call fcn.0040ffb0
mov ecx, dword [esp + 0x10]
mov edx, esi
push eax
call fcn.0040f2e0
mov edx, dword [esp + 0x10]
mov esi, edx
lea ecx, [esi + 2]
jmp 0x40f8c0
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x40f8c0
sub esi, ecx
sar esi, 1
cmp word [edx + 2], 0x3a
jne 0x40f8e6
mov cx, word [edx]
call fcn.00410a62
test eax, eax
je 0x40f7b6
mov edx, 0x2e
mov ecx, ebx
call fcn.00410145
test eax, eax
je 0x40f76b
cmp word [eax + 2], 0
je 0x40f76b
mov edx, dword [ebp + 8]
mov ecx, dword [esp + 0x10]
push 1
call fcn.00409b04
test eax, eax
je 0x40f752
mov ecx, dword [esp + 0x10]
mov edx, 0x2e
call fcn.00410145
mov edi, eax
test edi, edi
je 0x41e2d3
push 0x402570
push edi
call dword [sym.imp.msvcrt.dll__wcsicmp]
add esp, 8
test eax, eax
je 0x40fa28
push 0x4025ac
push edi
call dword [sym.imp.msvcrt.dll__wcsicmp]
add esp, 8
test eax, eax
mov eax, dword [esp + 0x238]
mov dword [esp + 0x238], 0
je 0x41e2f6
test eax, eax
je 0x40f981
push eax
call dword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void__]
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x248]
xor ecx, esp
call fcn.00416ad0
mov esp, ebp
pop ebp
ret 4
mov ecx, esi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40f9a2
sub ecx, edx
sar ecx, 1
add edi, ecx
jmp 0x40f690
mov esi, dword [esp + 0x238]
xor eax, eax
mov dword [esp + 0x18], 0
mov word [esp + 0x24e], ax
test esi, esi
je 0x41e21a
mov edi, esi
jmp 0x40f4c8
mov ecx, 0x4024f0
call fcn.0040eb6e
mov esi, eax
mov dword [esp + 0x1c], esi
jmp 0x40f65b
mov ebx, dword [esp + 0x1c]
test ebx, ebx
je 0x40f6df
test eax, eax
je 0x40fa13
push 0x40241c
mov edx, edi
mov ecx, esi
call fcn.0040fb80
push ebx
mov edx, edi
mov ecx, esi
call fcn.0040fb80
jmp 0x40f6df
inc esi
jmp 0x40f868
mov eax, dword [esp + 0x238]
mov dword [esp + 0x238], 0
test eax, eax
je 0x40fa48
push eax
call dword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void__]
add esp, 4
mov ecx, dword [esp + 0x254]
mov eax, 2
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00416ad0
mov esp, ebp
pop ebp
ret 4
cmp word [ebx], 0
je 0x40f7b2
mov ebx, dword [esp + 0x20]
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40fa77
sub ecx, edx
sar ecx, 1
lea eax, [ecx + ebx]
cmp eax, 0x7fe7
ja 0x40fab2
mov edx, dword [ebp + 8]
mov ecx, dword [esp + 0x10]
push 1
push edi
push esi
call fcn.0040934f
test eax, eax
jne 0x40fac7
mov eax, dword [0x435798]
cmp eax, 2
jne 0x41e2e9
movzx eax, word [edi]
add edi, 2
test ax, ax
jne 0x40fab2
cmp word [edi], ax
jne 0x40fa72
jmp 0x40f7b2
push 0x4025ac
push edi
call dword [sym.imp.msvcrt.dll__wcsicmp]
add esp, 8
test eax, eax
je 0x41e303
push 0x402570
push edi
call dword [sym.imp.msvcrt.dll__wcsicmp]
add esp, 8
test eax, eax
je 0x41e303
mov eax, dword [esp + 0x238]
mov dword [esp + 0x238], 0
jmp 0x40f973
cmp dword [esp + 0x18], 0
jne 0x40fb6b
mov dword [0x435798], 0x2331
mov eax, dword [esp + 0x238]
mov dword [esp + 0x238], 0
test eax, eax
je 0x40fb3d
push eax
call dword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void__]
add esp, 4
xor eax, eax
jmp 0x40f986
sbb eax, eax
or eax, 1
jmp 0x40f50c
sbb eax, eax
or eax, 1
jmp 0x40f54c
mov eax, dword [0x435798]
cmp eax, 5
jne 0x40f762
jmp 0x40f91b
mov eax, dword [0x435798]
test eax, eax
je 0x40fb13
cmp eax, 2
je 0x40fb13
jmp 0x40fb1d
mov dword [0x435798], 0x233f
jmp 0x40fb3d
mov ecx, 0x4024c0
call fcn.0040eb6e
mov edi, eax
test edi, edi
jne 0x40f3d4
mov dword [0x435798], 0x400023d2
jmp 0x40fb3d
mov eax, 0x104
jmp 0x40f414
mov eax, dword [esp + 0x238]
mov dword [0x435798], 8
mov dword [esp + 0x238], ebx
test eax, eax
jne 0x41e38e
jmp 0x41e398
lea ecx, [esp + 0x30]
jmp 0x40f43f
mov word [eax], bx
lea ecx, [eax + 2]
jmp 0x40f444
lea ecx, [esp + 0x30]
jmp 0x40f478
lea ecx, [esp + 0x30]
jmp 0x40f4ad
mov ecx, dword [esp + 0x238]
test ecx, ecx
jne 0x41e209
lea ecx, [esp + 0x30]
mov edx, 0x3a
call fcn.0040a574
mov edi, eax
jmp 0x40f4be
lea edi, [esp + 0x30]
jmp 0x40f4c8
mov ecx, esi
call fcn.0040dba0
mov eax, dword [esp + 0x238]
mov dword [0x435798], 8
mov dword [esp + 0x238], 0
test eax, eax
jne 0x41e38e
jmp 0x41e398
lea eax, [esp + 0x30]
jmp 0x40f577
lea ecx, [esp + 0x30]
jmp 0x40f595
cmp byte [0x435745], 0
je 0x40fb13
push ebx
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40fb13
test al, 0x10
je 0x40fb13
mov eax, dword [esp + 0x238]
mov dword [esp + 0x238], 0
test eax, eax
jne 0x41e354
jmp 0x41e35e
mov edi, 2
jmp 0x40f688
mov esi, 0x403a10
jmp 0x40f73e
cmp ebx, 0x5c
jne 0x41e2c3
inc esi
mov edi, dword [esp + 0x14]
lea edi, [edi + esi*2]
mov dword [esp + 0x14], edi
jmp 0x40f7b6
mov edi, dword [esp + 0x14]
jmp 0x40f75d
test eax, eax
jne 0x40f7b6
jmp 0x40f76b
test eax, eax
jne 0x40f7b2
jmp 0x40fab2
test eax, eax
je 0x40fa48
jmp 0x40fa3e
mov eax, dword [esp + 0x238]
mov dword [esp + 0x238], 0
test eax, eax
je 0x40fa48
jmp 0x40fa3e
cmp byte [0x435745], 0
je 0x41e3a9
push dword [esp + 0x10]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x41e368
test al, 0x10
je 0x41e3a2
mov eax, dword [esp + 0x238]
mov dword [esp + 0x238], 0
test eax, eax
je 0x41e35e
push eax
call dword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void__]
add esp, 4
mov eax, 5
jmp 0x40f986
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
cmp eax, 0x15
jne 0x41e3a2
mov dword [0x435798], eax
mov eax, dword [esp + 0x238]
mov dword [esp + 0x238], 0
test eax, eax
je 0x41e398
push eax
call dword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void__]
add esp, 4
mov eax, 3
jmp 0x40f986
mov esi, dword [esp + 0x238]
mov dword [0x435798], 0x2331
mov dword [esp + 0x238], 0
test esi, esi
je 0x40fb3d
push esi
jmp 0x40fb34