Function at 0x40f410
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 [0x42e0b4]
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.00410060
mov edi, eax
test edi, edi
je 0x40f46b
mov esi, edi
lea ecx, [esi + 2]
mov edi, edi
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x40f450
sub esi, ecx
sar esi, 1
cmp esi, 0x7fe7
jae 0x41e2b2
cmp byte [0x436755], bl
je 0x40f494
test edi, edi
je 0x41e2c1
push 4
push 0x402518
push edi
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
je 0x41e2c1
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 0x41e2e4
mov eax, 0x7fe7
push eax
lea ecx, [esp + 0x34]
call fcn.0040e3f0
test eax, eax
js 0x41e2ee
push edi
lea ecx, [esp + 0x34]
call fcn.0040a641
mov ecx, dword [esp + 0x238]
test ecx, ecx
je 0x41e313
mov ebx, 0x5c
mov edx, 0x2f
call fcn.0040a62f
test eax, eax
jne 0x41e31c
mov ecx, dword [esp + 0x238]
mov dword [esp + 0x24c], 0x3a005c
mov word [esp + 0x250], ax
test ecx, ecx
je 0x41e327
lea edx, [esp + 0x24c]
call fcn.00409eba
cmp eax, esi
jae 0x40fa78
mov ecx, dword [esp + 0x238]
xor eax, eax
mov dword [esp + 0x18], 1
mov word [esp + 0x24e], ax
test ecx, ecx
je 0x41e330
mov edx, ebx
call fcn.004101f5
mov edi, eax
test edi, edi
je 0x41e339
mov esi, dword [esp + 0x238]
add edi, 2
cmp word [edi], 0
je 0x41e461
mov ecx, 0x402434
mov eax, edi
lea esp, [esp]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x40fc04
test dx, dx
je 0x40f5ca
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x40fc04
add eax, 4
add ecx, 4
test dx, dx
jne 0x40f5a0
xor eax, eax
test eax, eax
je 0x41e461
mov ecx, 0x402510
mov eax, edi
jmp 0x40f5e0
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x40fc0e
test dx, dx
je 0x40f60a
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x40fc0e
add eax, 4
add ecx, 4
test dx, dx
jne 0x40f5e0
xor eax, eax
test eax, eax
je 0x41e461
mov ecx, 0x1ff9c
call fcn.0040dcd0
mov esi, eax
mov eax, dword [esp + 0x238]
test esi, esi
je 0x41e370
test eax, eax
je 0x41e392
mov ebx, dword [ebp + 8]
mov edx, ebx
mov ecx, dword [esp + 0x10]
push eax
call fcn.0040f3a0
mov ecx, dword [esp + 0x238]
test ecx, ecx
je 0x41e39b
mov eax, edi
xor edx, edx
sub eax, ecx
mov ecx, dword [esp + 0x10]
sar eax, 1
push 0x402434
mov word [ecx + eax*2], dx
mov edx, ebx
mov ebx, ecx
call fcn.0040fc40
push ebx
mov edx, 0xffce
mov ecx, esi
call fcn.00411cd5
test eax, eax
jne 0x41e3a4
movzx eax, word [esi]
mov ecx, esi
mov edx, eax
test ax, ax
je 0x40f6a2
mov eax, ecx
add ecx, 2
cmp word [ecx], 0
jne 0x40f694
movzx edx, word [eax]
cmp dx, 0x5c
je 0x40f6b9
push 0x40250c
mov edx, 0xffce
mov ecx, esi
call fcn.0040fc40
push edi
mov edx, 0xffce
mov ecx, esi
call fcn.0040fc40
mov edx, esi
lea ecx, [edx + 2]
jmp 0x40f6d0
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x40f6d0
sub edx, ecx
mov ecx, esi
sar edx, 1
lea edx, [edx*2 + 2]
call fcn.0040dd20
mov ebx, eax
test ebx, ebx
je 0x41e362
mov edx, 0x5c
mov ecx, ebx
call fcn.004101f5
xor ecx, ecx
mov word [eax], cx
add eax, 2
mov dword [esp + 0x24], eax
cmp dword [esp + 0x18], ecx
je 0x40faa0
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 0x41e3e8
mov ecx, ebx
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40f736
sub ecx, edx
sar ecx, 1
lea edi, [ecx + 4]
test esi, esi
jne 0x40fa5d
lea ecx, [edi + edi]
call fcn.0040dcd0
mov esi, eax
test esi, esi
je 0x41e369
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40f794
push 0x402430
mov edx, edi
mov ecx, esi
call fcn.0040fc40
push ebx
mov edx, edi
mov ecx, esi
call fcn.0040fc40
push 0x402430
mov edx, edi
mov ecx, esi
call fcn.0040fc40
mov eax, dword [esp + 0x14]
cmp dword [esp + 0x18], 0
je 0x40fab5
mov ecx, esi
call fcn.00410b60
push 1
mov edx, 0x40242c
mov ecx, esi
call fcn.0040bc30
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 0x40f7c1
sub edx, esi
sar edx, 1
lea eax, [edx + 1]
mov dword [esp + 0x28], eax
cmp byte [0x436755], cl
je 0x41e3f2
mov ecx, 0x4024f0
call fcn.0040ec2e
mov esi, eax
test esi, esi
je 0x41e3f2
mov ecx, esi
call fcn.00410b60
push 1
mov edx, 0x40242c
mov ecx, esi
call fcn.0040bc30
mov dword [esp + 0x2c], eax
jmp 0x40f876
cmp dword [esp + 0x18], 0
jne 0x40fc18
mov eax, dword [0x4367a8]
cmp eax, 2
jne 0x41e41b
mov edx, 0x2a
mov ecx, ebx
call fcn.0040a62f
test eax, eax
jne 0x40fbd3
lea edx, [eax + 0x3f]
mov ecx, ebx
call fcn.0040a62f
test eax, eax
jne 0x40fbd3
mov ebx, dword [esp + 0x2c]
mov edi, ebx
mov edx, dword [ebp + 8]
mov ecx, dword [esp + 0x10]
push eax
push 0x4024bc
push esi
call fcn.00409402
test eax, eax
jne 0x40fb24
mov edi, dword [esp + 0x14]
mov esi, edi
lea ecx, [esi + 2]
jmp 0x40f880
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x40f880
sub esi, ecx
mov ecx, edi
sar esi, 1
lea ebx, [esi + 1]
mov dword [esp + 0x1c], ebx
call fcn.00410060
push eax
mov edx, ebx
mov ecx, edi
call fcn.0040f3a0
mov edx, edi
lea ecx, [edx + 2]
lea esp, [esp]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x40f8b0
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 0x40f8df
mov ecx, eax
add eax, 2
cmp word [eax], 0
jne 0x40f8d1
movzx edi, word [ecx]
movzx ebx, di
cmp di, 0x5c
je 0x40f8ed
mov esi, dword [esp + 0x1c]
inc edx
cmp word [esp + 0x20], 0
je 0x40fbcc
mov eax, dword [esp + 0x28]
add eax, edx
mov dword [esp + 0x20], eax
cmp eax, 0x7fe7
ja 0x41e3fc
mov edi, dword [esp + 0x14]
mov edx, dword [ebp + 8]
mov ecx, dword [esp + 0x10]
push edi
call fcn.0040f3a0
cmp ebx, 0x5c
je 0x40fae2
lea edi, [edi + esi*2]
mov esi, dword [ebp + 8]
mov dword [esp + 0x14], edi
cmp ebx, 0x5c
je 0x40f94a
mov ecx, dword [esp + 0x10]
lea eax, [esp + 0x24c]
push eax
mov edx, esi
call fcn.0040fc40
mov ebx, dword [esp + 0x24]
mov edx, esi
mov ecx, dword [esp + 0x10]
push ebx
call fcn.0040fc40
mov ecx, dword [esp + 0x10]
call fcn.00410060
mov ecx, dword [esp + 0x10]
mov edx, esi
push eax
call fcn.0040f3a0
mov edx, dword [esp + 0x10]
mov esi, edx
lea ecx, [esi + 2]
jmp 0x40f980
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x40f980
sub esi, ecx
sar esi, 1
cmp word [edx + 2], 0x3a
jne 0x40f9a6
mov cx, word [edx]
call fcn.00410b12
test eax, eax
je 0x40f876
mov edx, 0x2e
mov ecx, ebx
call fcn.004101f5
test eax, eax
je 0x40f82b
cmp word [eax + 2], 0
je 0x40f82b
mov edx, dword [ebp + 8]
mov ecx, dword [esp + 0x10]
push 1
call fcn.00409bc4
test eax, eax
je 0x40f812
mov ecx, dword [esp + 0x10]
mov edx, 0x2e
call fcn.004101f5
mov edi, eax
test edi, edi
je 0x41e412
push 0x402580
push edi
call dword [sym.imp.msvcrt.dll__wcsicmp]
add esp, 8
test eax, eax
je 0x40fae8
push 0x4025bc
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 0x41e435
test eax, eax
je 0x40fa41
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.00416b30
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 0x40fa62
sub ecx, edx
sar ecx, 1
add edi, ecx
jmp 0x40f750
mov esi, dword [esp + 0x238]
xor eax, eax
mov dword [esp + 0x18], 0
mov word [esp + 0x24e], ax
test esi, esi
je 0x41e359
mov edi, esi
jmp 0x40f588
mov ecx, 0x402500
call fcn.0040ec2e
mov esi, eax
mov dword [esp + 0x1c], esi
jmp 0x40f71b
mov ebx, dword [esp + 0x1c]
test ebx, ebx
je 0x40f79f
test eax, eax
je 0x40fad3
push 0x40242c
mov edx, edi
mov ecx, esi
call fcn.0040fc40
push ebx
mov edx, edi
mov ecx, esi
call fcn.0040fc40
jmp 0x40f79f
inc esi
jmp 0x40f928
mov eax, dword [esp + 0x238]
mov dword [esp + 0x238], 0
test eax, eax
je 0x40fb08
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.00416b30
mov esp, ebp
pop ebp
ret 4
cmp word [ebx], 0
je 0x40f872
mov ebx, dword [esp + 0x20]
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40fb37
sub ecx, edx
sar ecx, 1
lea eax, [ecx + ebx]
cmp eax, 0x7fe7
ja 0x40fb72
mov edx, dword [ebp + 8]
mov ecx, dword [esp + 0x10]
push 1
push edi
push esi
call fcn.00409402
test eax, eax
jne 0x40fb87
mov eax, dword [0x4367a8]
cmp eax, 2
jne 0x41e428
movzx eax, word [edi]
add edi, 2
test ax, ax
jne 0x40fb72
cmp word [edi], ax
jne 0x40fb32
jmp 0x40f872
push 0x4025bc
push edi
call dword [sym.imp.msvcrt.dll__wcsicmp]
add esp, 8
test eax, eax
je 0x41e442
push 0x402580
push edi
call dword [sym.imp.msvcrt.dll__wcsicmp]
add esp, 8
test eax, eax
je 0x41e442
mov eax, dword [esp + 0x238]
mov dword [esp + 0x238], 0
jmp 0x40fa33
cmp dword [esp + 0x18], 0
jne 0x40fc2b
mov dword [0x4367a8], 0x2331
mov eax, dword [esp + 0x238]
mov dword [esp + 0x238], 0
test eax, eax
je 0x40fbfd
push eax
call dword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void__]
add esp, 4
xor eax, eax
jmp 0x40fa46
sbb eax, eax
or eax, 1
jmp 0x40f5cc
sbb eax, eax
or eax, 1
jmp 0x40f60c
mov eax, dword [0x4367a8]
cmp eax, 5
jne 0x40f822
jmp 0x40f9db
mov eax, dword [0x4367a8]
test eax, eax
je 0x40fbd3
cmp eax, 2
je 0x40fbd3
jmp 0x40fbdd
mov dword [0x4367a8], 0x233f
jmp 0x40fbfd
mov ecx, 0x4024d0
call fcn.0040ec2e
mov edi, eax
test edi, edi
jne 0x40f494
mov dword [0x4367a8], 0x400023d2
jmp 0x40fbfd
mov eax, 0x104
jmp 0x40f4d4
mov eax, dword [esp + 0x238]
mov dword [0x4367a8], 8
mov dword [esp + 0x238], ebx
test eax, eax
jne 0x41e4cd
jmp 0x41e4d7
lea ecx, [esp + 0x30]
jmp 0x40f4ff
mov word [eax], bx
lea ecx, [eax + 2]
jmp 0x40f504
lea ecx, [esp + 0x30]
jmp 0x40f538
lea ecx, [esp + 0x30]
jmp 0x40f56d
mov ecx, dword [esp + 0x238]
test ecx, ecx
jne 0x41e348
lea ecx, [esp + 0x30]
mov edx, 0x3a
call fcn.0040a62f
mov edi, eax
jmp 0x40f57e
lea edi, [esp + 0x30]
jmp 0x40f588
mov ecx, esi
call fcn.0040dc60
mov eax, dword [esp + 0x238]
mov dword [0x4367a8], 8
mov dword [esp + 0x238], 0
test eax, eax
jne 0x41e4cd
jmp 0x41e4d7
lea eax, [esp + 0x30]
jmp 0x40f637
lea ecx, [esp + 0x30]
jmp 0x40f655
cmp byte [0x436755], 0
je 0x40fbd3
push ebx
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40fbd3
test al, 0x10
je 0x40fbd3
mov eax, dword [esp + 0x238]
mov dword [esp + 0x238], 0
test eax, eax
jne 0x41e493
jmp 0x41e49d
mov edi, 2
jmp 0x40f748
mov esi, 0x403ad0
jmp 0x40f7fe
cmp ebx, 0x5c
jne 0x41e402
inc esi
mov edi, dword [esp + 0x14]
lea edi, [edi + esi*2]
mov dword [esp + 0x14], edi
jmp 0x40f876
mov edi, dword [esp + 0x14]
jmp 0x40f81d
test eax, eax
jne 0x40f876
jmp 0x40f82b
test eax, eax
jne 0x40f872
jmp 0x40fb72
test eax, eax
je 0x40fb08
jmp 0x40fafe
mov eax, dword [esp + 0x238]
mov dword [esp + 0x238], 0
test eax, eax
je 0x40fb08
jmp 0x40fafe
cmp byte [0x436755], 0
je 0x41e4e8
push dword [esp + 0x10]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x41e4a7
test al, 0x10
je 0x41e4e1
mov eax, dword [esp + 0x238]
mov dword [esp + 0x238], 0
test eax, eax
je 0x41e49d
push eax
call dword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void__]
add esp, 4
mov eax, 5
jmp 0x40fa46
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
cmp eax, 0x15
jne 0x41e4e1
mov dword [0x4367a8], eax
mov eax, dword [esp + 0x238]
mov dword [esp + 0x238], 0
test eax, eax
je 0x41e4d7
push eax
call dword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void__]
add esp, 4
mov eax, 3
jmp 0x40fa46
mov esi, dword [esp + 0x238]
mov dword [0x4367a8], 0x2331
mov dword [esp + 0x238], 0
test esi, esi
je 0x40fbfd
push esi
jmp 0x40fbf4