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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x6bc
mov eax, dword [0x4310b4]
xor eax, esp
mov dword [esp + 0x6b8], eax
mov ecx, dword [ecx + 0x38]
push ebx
push esi
xor ebx, ebx
mov dword [esp + 0x18], edx
push edi
mov dword [esp + 0x20], ebx
xor esi, esi
call fcn.0040f070
mov edi, eax
test edi, edi
je 0x40e0b6
mov esi, edi
lea ecx, [esi + 2]
mov edi, edi
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x40e090
sub esi, ecx
sar esi, 1
cmp esi, 0x7fe7
jb 0x40e0b6
mov dword [0x439820], 0x233f
jmp 0x40ebd1
cmp byte [0x4397cd], bl
je 0x40e0f6
test edi, edi
je 0x40e0d7
push 4
push 0x4036d8
push edi
call dword [sym.imp.msvcrt.dll__wcsnicmp]
add esp, 0xc
test eax, eax
jne 0x40e0f6
mov ecx, 0x402568
call fcn.0040d89b
mov edi, eax
test edi, edi
jne 0x40e0f6
mov dword [0x439820], 0x400023d2
jmp 0x40ebd1
push 0x104
lea eax, [esp + 0x4c]
mov dword [esp + 0x254], ebx
push 0
push eax
mov byte [esp + 0x260], 1
mov dword [esp + 0x264], 0x104
call sub.msvcrt.dll_memset
movzx eax, byte [esp + 0x260]
lea ecx, [esp + 0x54]
add esp, 0xc
neg eax
sbb eax, eax
and eax, 0x7ee3
add eax, 0x104
push eax
call fcn.0040d300
test eax, eax
jns 0x40e165
mov eax, dword [esp + 0x250]
mov dword [0x439820], 8
mov dword [esp + 0x250], ebx
jmp 0x40eb7d
push edi
lea ecx, [esp + 0x4c]
call fcn.0040f229
mov ecx, dword [esp + 0x250]
test ecx, ecx
jne 0x40e17e
lea ecx, [esp + 0x48]
mov edx, 0x2f
call fcn.0040f66b
mov ebx, 0x5c
test eax, eax
je 0x40e1a5
lea ecx, [eax + 2]
mov word [eax], bx
mov edx, 0x2f
call fcn.0040f66b
test eax, eax
jne 0x40e191
mov ecx, dword [esp + 0x250]
xor eax, eax
mov dword [esp + 0x4b0], 0x3a005c
mov edi, 0x3a
mov word [esp + 0x4b4], ax
test ecx, ecx
jne 0x40e1ce
lea ecx, [esp + 0x48]
lea edx, [esp + 0x4b0]
call fcn.0040fb25
cmp eax, esi
jae 0x40e230
mov ecx, dword [esp + 0x250]
xor eax, eax
mov dword [esp + 0x28], 1
mov word [esp + 0x4b2], ax
test ecx, ecx
jne 0x40e1ff
lea ecx, [esp + 0x48]
mov edx, ebx
call fcn.0040f211
mov esi, eax
test esi, esi
jne 0x40e224
mov ecx, dword [esp + 0x250]
test ecx, ecx
jne 0x40e21b
lea ecx, [esp + 0x48]
mov edx, edi
call fcn.0040f66b
mov esi, eax
mov edi, dword [esp + 0x250]
add esi, 2
jmp 0x40e253
mov edi, dword [esp + 0x250]
xor eax, eax
mov dword [esp + 0x28], 0
mov esi, edi
mov word [esp + 0x4b2], ax
test edi, edi
jne 0x40e253
lea esi, [esp + 0x48]
cmp word [esi], 0
je 0x40eafb
mov ecx, 0x402630
mov eax, esi
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x40e28a
test dx, dx
je 0x40e286
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x40e28a
add eax, 4
add ecx, 4
test dx, dx
jne 0x40e264
xor eax, eax
jmp 0x40e28f
sbb eax, eax
or eax, 1
test eax, eax
je 0x40eafb
mov ecx, 0x402628
mov eax, esi
mov edi, edi
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x40e2c6
test dx, dx
je 0x40e2c2
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x40e2c6
add eax, 4
add ecx, 4
test dx, dx
jne 0x40e2a0
xor eax, eax
jmp 0x40e2cb
sbb eax, eax
or eax, 1
test eax, eax
je 0x40eafb
mov ecx, 0x1ff9c
call fcn.0040cbc0
mov edi, eax
mov eax, dword [esp + 0x250]
test edi, edi
jne 0x40e2f9
mov dword [0x439820], 8
jmp 0x40eb72
test eax, eax
jne 0x40e301
lea eax, [esp + 0x48]
mov ebx, dword [esp + 0x1c]
mov ecx, ebx
mov edx, dword [ebp + 8]
push eax
call fcn.0040dfe0
mov ecx, dword [esp + 0x250]
test ecx, ecx
jne 0x40e31f
lea ecx, [esp + 0x48]
mov edx, dword [ebp + 8]
mov eax, esi
sub eax, ecx
xor ecx, ecx
sar eax, 1
push 0x402630
mov word [ebx + eax*2], cx
mov ecx, ebx
call fcn.0040ebf0
push ebx
mov edx, 0xffce
mov ecx, edi
call fcn.00411809
test eax, eax
je 0x40e392
cmp byte [0x4397cd], 0
je 0x40e368
push ebx
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40e368
test al, 0x10
jne 0x40eb1f
mov dword [0x439820], 0x2331
mov eax, dword [esp + 0x250]
mov dword [esp + 0x250], 0
test eax, eax
je 0x40ebd1
push eax
jmp 0x40ebc8
movzx eax, word [edi]
mov ecx, edi
mov edx, eax
test ax, ax
je 0x40e3ae
mov edi, edi
mov eax, ecx
add ecx, 2
cmp word [ecx], 0
jne 0x40e3a0
movzx edx, word [eax]
cmp dx, 0x5c
je 0x40e3c5
push 0x40263c
mov edx, 0xffce
mov ecx, edi
call fcn.0040ebf0
push esi
mov edx, 0xffce
mov ecx, edi
call fcn.0040ebf0
mov edx, edi
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x40e3d7
sub edx, ecx
mov ecx, edi
sar edx, 1
lea edx, [edx*2 + 2]
call fcn.0040cc10
mov ebx, eax
test ebx, ebx
jne 0x40e410
mov ecx, edi
call fcn.0040cb50
mov dword [0x439820], 8
jmp 0x40eb6b
mov edx, 0x5c
mov ecx, ebx
call fcn.0040f211
xor ecx, ecx
mov word [eax], cx
add eax, 2
mov dword [esp + 0x2c], eax
cmp dword [esp + 0x28], ecx
jne 0x40e440
mov ecx, 0x402598
call fcn.0040d89b
mov edi, eax
mov dword [esp + 0x20], edi
jmp 0x40e442
xor edi, edi
push dword [esp + 0x1c]
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_NeedCurrentDirectoryForExePathW]
mov dword [esp + 0x24], eax
test eax, eax
je 0x40e474
mov ecx, ebx
lea edx, [ecx + 2]
lea esp, [esp]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40e460
sub ecx, edx
sar ecx, 1
lea esi, [ecx + 4]
jmp 0x40e479
mov esi, 2
test edi, edi
je 0x40e493
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40e482
sub ecx, edx
sar ecx, 1
add esi, ecx
lea ecx, [esi + esi]
call fcn.0040cbc0
mov edi, eax
test edi, edi
jne 0x40e4b0
mov dword [0x439820], 8
jmp 0x40eb6b
mov eax, dword [esp + 0x24]
test eax, eax
je 0x40e4e2
push 0x402778
mov edx, esi
mov ecx, edi
call fcn.0040ebf0
push ebx
mov edx, esi
mov ecx, edi
call fcn.0040ebf0
push 0x402778
mov edx, esi
mov ecx, edi
call fcn.0040ebf0
mov eax, dword [esp + 0x24]
cmp dword [esp + 0x28], 0
jne 0x40e50d
mov ebx, dword [esp + 0x20]
test ebx, ebx
je 0x40e50d
test eax, eax
je 0x40e503
push 0x403648
mov edx, esi
mov ecx, edi
call fcn.0040ebf0
push ebx
mov edx, esi
mov ecx, edi
call fcn.0040ebf0
mov ecx, edi
call fcn.00410720
push 1
mov edx, 0x403648
mov ecx, edi
call fcn.0040ab20
mov edx, dword [esp + 0x2c]
mov edi, eax
mov dword [esp + 0x14], edi
lea esi, [edx + 2]
nop
mov cx, word [edx]
add edx, 2
test cx, cx
jne 0x40e530
sub edx, esi
sar edx, 1
lea eax, [edx + 1]
mov dword [esp + 0x20], eax
cmp byte [0x4397cd], cl
je 0x40e567
mov ecx, 0x402588
call fcn.0040d89b
mov esi, eax
test esi, esi
je 0x40e567
mov ecx, esi
call fcn.00410720
jmp 0x40e56c
mov esi, 0x403650
push 1
mov edx, 0x403648
mov ecx, esi
call fcn.0040ab20
mov dword [esp + 0x3c], eax
jmp 0x40e584
mov edi, dword [esp + 0x14]
mov esi, edi
lea ecx, [esi + 2]
lea esp, [esp]
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x40e590
sub esi, ecx
mov ecx, edi
sar esi, 1
lea ebx, [esi + 1]
mov dword [esp + 0x30], ebx
call fcn.0040f070
push eax
mov edx, ebx
mov ecx, edi
call fcn.0040dfe0
mov ecx, edi
lea edx, [ecx + 2]
lea esp, [esp]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40e5c0
movzx eax, word [edi]
sub ecx, edx
sar ecx, 1
mov edx, edi
mov edi, eax
mov ebx, eax
test ax, ax
je 0x40e5ee
lea ecx, [ecx]
mov eax, edx
add edx, 2
cmp word [edx], 0
jne 0x40e5e0
movzx edi, word [eax]
cmp di, 0x5c
je 0x40e5f9
mov esi, dword [esp + 0x30]
inc ecx
test bx, bx
je 0x40ead5
add ecx, dword [esp + 0x20]
call fcn.004102d7
test al, al
je 0x40e626
cmp di, 0x5c
jne 0x40e616
inc esi
mov edi, dword [esp + 0x14]
lea edi, [edi + esi*2]
mov dword [esp + 0x14], edi
jmp 0x40e584
push dword [esp + 0x14]
mov ebx, dword [esp + 0x20]
mov ecx, ebx
mov edx, dword [ebp + 8]
call fcn.0040dfe0
cmp di, 0x5c
je 0x40e659
mov edx, dword [ebp + 8]
lea eax, [esp + 0x4b0]
push eax
mov ecx, ebx
call fcn.0040ebf0
mov eax, dword [esp + 0x14]
lea eax, [eax + esi*2]
jmp 0x40e663
mov eax, dword [esp + 0x14]
lea eax, [eax + esi*2]
add eax, 2
push dword [esp + 0x2c]
mov esi, dword [ebp + 8]
mov ecx, ebx
mov edx, esi
mov dword [esp + 0x18], eax
call fcn.0040ebf0
mov ecx, ebx
call fcn.0040f070
push eax
mov edx, esi
mov ecx, ebx
call fcn.0040dfe0
mov edi, ebx
lea ecx, [edi + 2]
lea ecx, [ecx]
mov ax, word [edi]
add edi, 2
test ax, ax
jne 0x40e690
sub edi, ecx
sar edi, 1
cmp word [ebx + 2], 0x3a
mov dword [esp + 0x34], edi
jne 0x40e6ba
mov cx, word [ebx]
call fcn.004106ce
test eax, eax
je 0x40e580
mov ecx, dword [esp + 0x2c]
mov edx, 0x2e
call fcn.0040f211
test eax, eax
je 0x40e719
cmp word [eax + 2], 0
je 0x40e719
push ecx
mov edx, esi
mov ecx, ebx
call fcn.0040ffce
test eax, eax
jne 0x40e6f1
cmp dword [esp + 0x28], eax
je 0x40e707
mov eax, dword [0x439820]
cmp eax, 5
jne 0x40e70c
mov edx, 0x2e
mov ecx, ebx
call fcn.0040f211
mov esi, eax
test esi, esi
jne 0x40ea37
mov eax, dword [0x439820]
cmp eax, 2
je 0x40e719
test eax, eax
jne 0x40e580
mov ebx, dword [esp + 0x2c]
mov edx, 0x2a
mov ecx, ebx
call fcn.0040f66b
test eax, eax
jne 0x40e368
lea edx, [eax + 0x3f]
mov ecx, ebx
call fcn.0040f66b
test eax, eax
jne 0x40e368
or esi, 0xffffffff
mov dword [esp + 0x30], eax
mov bh, 1
mov dword [esp + 0x24], eax
mov cl, bh
mov dword [esp + 0x18], esi
xor al, al
mov byte [esp + 0x12], bh
mov byte [esp + 0x11], cl
mov dword [esp + 0x38], esi
mov byte [esp + 0x13], al
jmp 0x40e786
mov esi, dword [esp + 0x18]
mov bh, byte [esp + 0x12]
jmp 0x40e789
mov bh, byte [esp + 0x12]
mov esi, dword [esp + 0x18]
mov cl, byte [esp + 0x11]
mov eax, dword [ebp + 8]
xor bl, bl
test cl, cl
je 0x40e99f
test bh, bh
je 0x40e7da
mov esi, dword [esp + 0x1c]
xor ecx, ecx
push 0x4036e4
mov edx, eax
mov word [esi + edi*2], cx
mov ecx, esi
call fcn.0040ebf0
test eax, eax
js 0x40e7ce
lea eax, [esp + 0x18]
mov edx, 0x1027
push eax
lea eax, [esp + 0x264]
mov ecx, esi
push eax
call fcn.00425c14
mov bl, al
mov esi, dword [esp + 0x18]
xor bh, bh
mov byte [esp + 0x12], bh
jmp 0x40e7ee
push esi
mov edx, 0x1027
lea ecx, [esp + 0x264]
call fcn.0042eb8b
mov bl, al
test bl, bl
je 0x40e99f
mov edx, 0x2e
lea ecx, [esp + 0x28c]
call fcn.0040f211
mov cl, byte [esp + 0x11]
mov dword [esp + 0x44], eax
test eax, eax
je 0x40e786
mov edx, eax
lea ecx, [edx + 2]
lea esp, [esp]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x40e820
mov eax, dword [ebp + 8]
sub edx, ecx
mov cl, byte [esp + 0x11]
sar edx, 1
mov dword [esp + 0x40], edx
cmp edx, 1
jbe 0x40e789
mov eax, dword [esp + 0x3c]
xor ebx, ebx
mov esi, eax
cmp word [eax], bx
mov eax, dword [ebp + 8]
je 0x40e770
jmp 0x40e860
mov edi, dword [esp + 0x34]
mov cl, byte [esp + 0x11]
mov eax, dword [ebp + 8]
cmp ebx, dword [esp + 0x38]
jae 0x40e770
mov edx, esi
lea ecx, [edx + 2]
lea ebx, [ebx]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x40e880
sub edx, ecx
lea eax, [esp + 0x28c]
sar edx, 1
lea edi, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40e8a0
sub eax, edi
sar eax, 1
cmp dword [esp + 0x40], edx
jne 0x40e8d3
mov edi, dword [esp + 0x20]
dec edi
lea ecx, [edx + edi]
cmp eax, ecx
jne 0x40e8d3
push dword [esp + 0x44]
push esi
call dword [sym.imp.msvcrt.dll__wcsicmp]
add esp, 8
test eax, eax
je 0x40e8f1
movzx eax, word [esi]
add esi, 2
test ax, ax
jne 0x40e8d3
inc ebx
cmp word [esi], ax
jne 0x40e860
mov edi, dword [esp + 0x34]
jmp 0x40e77a
lea ecx, [esp + 0x28c]
lea edx, [ecx + 2]
jmp 0x40e900
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40e900
mov eax, dword [ebp + 8]
sub ecx, edx
sar ecx, 1
sub ecx, edi
mov edi, dword [esp + 0x34]
add ecx, edi
cmp ecx, eax
mov cl, byte [esp + 0x11]
jge 0x40e770
sub esp, 0xc
lea eax, [esp + 0x298]
lea ecx, [esp + 0x4c4]
push eax
call fcn.0041bc23
mov cl, byte [esp + 0x11]
test eax, eax
mov eax, dword [ebp + 8]
js 0x40e770
mov dword [esp + 0x38], ebx
neg ebx
push 0x4036a8
sbb bl, bl
mov byte [esp + 0x17], 1
and bl, cl
push esi
mov byte [esp + 0x19], bl
call dword [sym.imp.msvcrt.dll__wcsicmp]
add esp, 8
test eax, eax
je 0x40e992
push 0x40369c
push esi
call dword [sym.imp.msvcrt.dll__wcsicmp]
add esp, 8
test eax, eax
je 0x40e992
mov dword [esp + 0x24], 1
jmp 0x40e77a
mov dword [esp + 0x24], 2
jmp 0x40e77a
cmp byte [esp + 0x13], 0
je 0x40e9d3
mov eax, dword [esp + 0x20]
xor ecx, ecx
mov edx, dword [ebp + 8]
dec eax
sub edi, eax
mov eax, dword [esp + 0x1c]
mov word [eax + edi*2], cx
lea ecx, [esp + 0x4b8]
push ecx
mov ecx, eax
call fcn.0040ebf0
test eax, eax
js 0x40e9d3
mov ebx, dword [esp + 0x24]
jmp 0x40e9ea
cmp dword [0x439820], 0x12
mov ebx, dword [esp + 0x30]
jne 0x40e9ea
mov dword [0x439820], 2
cmp esi, 0xffffffff
je 0x40e9f6
mov ecx, esi
call fcn.00411bba
test ebx, ebx
je 0x40e580
mov ecx, dword [esp + 0x250]
mov dword [esp + 0x250], 0
test ecx, ecx
je 0x40ea1e
push ecx
call dword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void__]
add esp, 4
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x6b8]
xor ecx, esp
call fcn.00417b90
mov esp, ebp
pop ebp
ret 4
push 0x40369c
push esi
call dword [sym.imp.msvcrt.dll__wcsicmp]
add esp, 8
test eax, eax
je 0x40ea5d
push 0x4036a8
push esi
call dword [sym.imp.msvcrt.dll__wcsicmp]
add esp, 8
test eax, eax
jne 0x40ea99
mov eax, dword [esp + 0x250]
mov dword [esp + 0x250], 0
test eax, eax
je 0x40ea7d
push eax
call dword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void__]
add esp, 4
mov eax, 2
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x6b8]
xor ecx, esp
call fcn.00417b90
mov esp, ebp
pop ebp
ret 4
mov eax, dword [esp + 0x250]
mov dword [esp + 0x250], 0
test eax, eax
je 0x40eab9
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 + 0x6b8]
xor ecx, esp
call fcn.00417b90
mov esp, ebp
pop ebp
ret 4
cmp dword [esp + 0x28], 0
je 0x40e368
mov eax, dword [0x439820]
test eax, eax
je 0x40e368
cmp eax, 2
jne 0x40e372
jmp 0x40e368
cmp byte [0x4397cd], 0
je 0x40ebae
push dword [esp + 0x1c]
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40eb5b
test al, 0x10
je 0x40eba7
mov eax, dword [esp + 0x250]
mov dword [esp + 0x250], 0
test eax, eax
je 0x40eb3f
push eax
call dword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void__]
add esp, 4
mov eax, 5
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x6b8]
xor ecx, esp
call fcn.00417b90
mov esp, ebp
pop ebp
ret 4
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
cmp eax, 0x15
jne 0x40eba7
mov dword [0x439820], eax
mov eax, dword [esp + 0x250]
mov dword [esp + 0x250], 0
test eax, eax
je 0x40eb8b
push eax
call dword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void__]
add esp, 4
mov eax, 3
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x6b8]
xor ecx, esp
call fcn.00417b90
mov esp, ebp
pop ebp
ret 4
mov edi, dword [esp + 0x250]
mov dword [0x439820], 0x2331
mov dword [esp + 0x250], 0
test edi, edi
je 0x40ebd1
push edi
call dword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void__]
add esp, 4
mov ecx, dword [esp + 0x6c4]
xor eax, eax
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00417b90
mov esp, ebp
pop ebp
ret 4