Function at 0x404df4
Capabilities:
Check if file exists

Disassembly:
mov eax, 0x416efc
call fcn.00416310
sub esp, 0x4c
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov esi, ecx
mov ecx, edi
call fcn.004057ec
mov ebx, eax
test ebx, ebx
jl 0x404fc8
cmp word [edi + ebx*2 + 2], 0
je 0x404fc8
lea eax, [edi + ebx*2]
lea ecx, [ebp - 0x30]
push eax
call fcn.0040370b
and dword [ebp - 4], 0
push edi
lea ecx, [ebp - 0x24]
call fcn.0040370b
cmp ebx, dword [ebp - 0x20]
mov byte [ebp - 4], 1
jae 0x404e53
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x20], ebx
and word [eax + ebx*2], 0
mov eax, dword [ebp - 0x2c]
cmp eax, 6
jbe 0x404e70
mov ecx, dword [ebp - 0x30]
mov edx, 0x41881c
lea ecx, [ecx + eax*2 - 0xc]
call fcn.00403329
test al, al
jne 0x404e7d
push str.:_DATA
lea ecx, [ebp - 0x30]
call fcn.0040389f
mov ecx, dword [ebp - 0x24]
call fcn.0040575c
test al, al
mov eax, dword [ebp - 0x24]
je 0x404ec2
cmp ebx, 2
je 0x404e9d
cmp ebx, 3
jne 0x404ec2
cmp word [eax + 4], 0x5c
jne 0x404ec2
mov ecx, esi
call fcn.00404dc2
mov eax, dword [esi + 0x28]
lea ecx, [esi + 0x28]
xor edi, edi
cmp ebx, 2
mov dword [ecx + 4], edi
mov word [eax], di
jne 0x404ed4
lea eax, [ebp - 0x24]
push eax
call fcn.004037e0
jmp 0x404ed4
push eax
mov ecx, esi
call fcn.00404df4
test al, al
je 0x404fb6
xor edi, edi
and word [esi + 0x20], 0xfbef
or dword [ebp - 0x40], 0xffffffff
mov dword [esi], edi
mov dword [esi + 4], edi
lea eax, [ebp - 0x24]
lea ecx, [ebp - 0x3c]
push eax
mov byte [ebp - 4], 2
call fcn.0040374e
lea ecx, [ebp - 0x58]
mov byte [ebp - 4], 3
call fcn.004036e8
lea eax, [ebp + 0xb]
lea ecx, [ebp - 0x40]
push eax
lea eax, [ebp - 0x58]
push eax
mov byte [ebp - 4], 4
call fcn.00404d82
test al, al
je 0x404f4b
cmp byte [ebp + 0xb], 0
je 0x404f43
mov edx, dword [ebp - 0x30]
mov ecx, dword [ebp - 0x58]
call fcn.00403288
test al, al
jne 0x404f4f
push dword [ebp - 0x58]
mov byte [ebp - 4], 3
call fcn.0040327c
pop ecx
lea ecx, [ebp - 0x58]
call fcn.004036e8
jmp 0x404eff
push 2
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor bl, bl
jmp 0x404f85
mov ecx, dword [ebp - 0x54]
cmp ecx, 7
jbe 0x404f68
lea eax, [ecx - 6]
cmp eax, ecx
jae 0x404f68
mov ecx, dword [ebp - 0x58]
mov dword [ebp - 0x54], eax
mov word [ecx + eax*2], di
lea eax, [ebp - 0x58]
lea ecx, [esi + 0x28]
push eax
call fcn.004038eb
mov eax, dword [ebp - 0x48]
mov byte [esi + 0x24], 1
mov dword [esi], eax
mov eax, dword [ebp - 0x44]
mov dword [esi + 4], eax
mov bl, 1
push dword [ebp - 0x58]
call fcn.0040327c
push dword [ebp - 0x3c]
call fcn.0040327c
pop ecx
pop ecx
lea ecx, [ebp - 0x40]
call fcn.00404b6c
push dword [ebp - 0x24]
call fcn.0040327c
push dword [ebp - 0x30]
call fcn.0040327c
pop ecx
pop ecx
jmp 0x405189
push dword [ebp - 0x24]
call fcn.0040327c
push dword [ebp - 0x30]
call fcn.0040327c
pop ecx
pop ecx
or dword [ebp - 0x10], 0xffffffff
push esi
push edi
lea ecx, [ebp - 0x10]
mov dword [ebp - 4], 5
call fcn.00404b8c
test al, al
je 0x404fe8
mov bl, 1
jmp 0x405181
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
mov dword [ebp - 0x18], eax
je 0x405010
cmp eax, 0x35
je 0x405010
cmp eax, 0x43
je 0x405010
cmp eax, 0x7b
je 0x405010
cmp eax, 0xa1
jne 0x40517f
mov ecx, edi
xor ebx, ebx
call fcn.00405785
test al, al
je 0x405020
push 4
pop ebx
mov ax, word [edi]
cmp ax, 0x5c
je 0x40502f
cmp ax, 0x2f
jne 0x40506b
cmp word [edi + 2], 0
jne 0x40506b
mov ecx, edi
call fcn.00404de5
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40517f
test bl, 0x10
je 0x40517f
mov ecx, esi
call fcn.00404dc2
mov eax, dword [esi + 0x28]
and dword [esi + 0x2c], 0
and word [eax], 0
mov dword [esi + 0x20], ebx
jmp 0x404fe1
lea ecx, [edi + ebx*2]
mov dword [ebp + 8], ecx
call fcn.0040564a
test al, al
je 0x4050cf
cmp word [edi + ebx*2 + 6], 0
jne 0x4050cf
mov ecx, edi
call fcn.00404de5
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40517f
test bl, 0x10
je 0x40517f
mov ecx, esi
call fcn.00404dc2
push dword [ebp + 8]
mov dword [esi + 0x20], ebx
add esi, 0x28
mov ecx, esi
call fcn.0040377c
push 2
pop eax
cmp dword [esi + 4], eax
jbe 0x404fe1
mov dword [esi + 4], eax
mov eax, dword [esi]
and word [eax + 4], 0
jmp 0x404fe1
mov ecx, edi
call fcn.004056ff
test eax, eax
jbe 0x40517f
cmp word [edi + eax*2], 0
lea ecx, [edi + eax*2]
mov dword [ebp - 0x14], ecx
je 0x40517f
call fcn.00405602
test eax, eax
jge 0x40517f
push edi
lea ecx, [ebp - 0x3c]
call fcn.0040370b
push 0x5c
lea ecx, [ebp - 0x3c]
mov byte [ebp - 4], 6
call fcn.00401f70
push 0x2a
lea ecx, [ebp - 0x3c]
call fcn.00401f70
and byte [ebp + 0xb], 0
push esi
push dword [ebp - 0x3c]
lea ecx, [ebp - 0x10]
call fcn.00404b8c
test al, al
je 0x405154
mov eax, dword [esi + 0x28]
lea ebx, [esi + 0x28]
push 0x4187d0
push eax
call dword [sym.imp.MSVCRT.dll_wcscmp]
pop ecx
test eax, eax
pop ecx
jne 0x405150
push dword [ebp - 0x14]
mov ecx, ebx
jmp 0x4051ba
mov byte [ebp + 0xb], 1
mov ecx, edi
call fcn.00404de5
cmp byte [ebp + 0xb], 0
mov ebx, eax
jne 0x40519c
cmp ebx, 0xffffffff
je 0x40516d
test bl, 0x10
jne 0x40519c
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_SetLastError]
push dword [ebp - 0x3c]
call fcn.0040327c
pop ecx
xor bl, bl
lea ecx, [ebp - 0x10]
call fcn.00404b6c
mov al, bl
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret 4
mov ecx, esi
call fcn.00404dc2
cmp ebx, 0xffffffff
je 0x4051ad
mov dword [esi + 0x20], ebx
jmp 0x4051b4
mov dword [esi + 0x20], 0x10
push dword [ebp - 0x14]
lea ecx, [esi + 0x28]
call fcn.0040377c
push dword [ebp - 0x3c]
call fcn.0040327c
pop ecx
lea ecx, [ebp - 0x10]
call fcn.00404b6c
mov al, 1
jmp 0x40518b