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

Disassembly:
push ebp
mov ebp, esp
push ecx
push ecx
mov edx, dword [0x4501a4]
mov eax, dword [ebp + 8]
test edx, edx
je 0x4049b7
sub esp, 0xc
push eax
call fcn.00407380
add esp, 0x10
mov dword [ebp + 8], eax
leave
jmp 0x40b2a0
sub esp, 0xc
push eax
call fcn.00407360
add esp, 0x10
mov dword [ebp + 8], eax
leave
jmp 0x40adf0
sub esp, 0x13c
mov dword [esp + 0x12c], ebx
mov ebx, dword [esp + 0x140]
mov dword [esp + 0x130], esi
mov dword [esp + 0x134], edi
mov dword [esp + 0x138], ebp
call sub.msvcrt.dll__errno
test ebx, ebx
mov dword [eax], 0
je 0x40afec
cmp byte [ebx], 0
je 0x40afc0
mov dword [esp], ebx
call sub.KERNEL32.dll_GetFileAttributesA
sub esp, 4
cmp eax, 0xffffffff
je 0x40afd0
test al, 0x10
je 0x40afc0
lea ebp, [esp + 0x1c]
mov dword [esp + 4], ebx
mov ebx, ebp
mov dword [esp + 8], 0x104
mov dword [esp], ebp
call sub.msvcrt.dll__fullpath
mov edx, dword [ebx]
add ebx, 4
lea eax, [edx - 0x1010101]
not edx
and eax, edx
and eax, 0x80808080
je 0x40ae6b
test eax, 0x8080
je 0x40afa2
add al, al
sbb ebx, 3
sub ebx, ebp
lea eax, [ebx + 0x233]
mov dword [esp], eax
call sub.msvcrt.dll_malloc
test eax, eax
mov esi, eax
je 0x40afdf
lea edi, [eax + 0x22c]
lea eax, [ebx + 1]
mov dword [esp + 8], eax
mov dword [esp + 4], ebp
mov dword [esp], edi
call fcn.00410a30
cmp byte [esi + 0x22c], 0
je 0x40af06
mov dword [esp + 4], 0x2f
lea ebp, [esi + ebx + 0x22b]
mov dword [esp], edi
call sub.msvcrt.dll_strrchr
cmp eax, ebp
je 0x40af06
mov dword [esp + 4], 0x5c
mov dword [esp], edi
call sub.msvcrt.dll_strrchr
cmp ebp, eax
je 0x40af06
mov word [esi + ebx + 0x22c], 0x5c
mov eax, edi
mov ecx, dword [eax]
add eax, 4
lea edx, [ecx - 0x1010101]
not ecx
and edx, ecx
and edx, 0x80808080
je 0x40af08
test edx, 0x8080
je 0x40afb0
add dl, dl
mov ecx, 0x41
sbb eax, 3
sub eax, edi
lea edx, [esi + 0x120]
mov word [esi + eax + 0x22c], 0x2a
mov edi, edx
xor eax, eax
rep stosd dword es:[edi], eax
mov dword [esi + 0x224], 0xffffffff
mov dword [esi + 0x228], 0
mov dword [esi + 0x118], 0
mov word [esi + 0x11c], 0
mov word [esi + 0x11e], 0
mov eax, esi
mov ebx, dword [esp + 0x12c]
mov esi, dword [esp + 0x130]
mov edi, dword [esp + 0x134]
mov ebp, dword [esp + 0x138]
add esp, 0x13c
ret
shr eax, 0x10
add ebx, 2
jmp 0x40ae8c
shr edx, 0x10
add eax, 2
jmp 0x40af2b
call sub.msvcrt.dll__errno
xor esi, esi
mov dword [eax], 0x14
jmp 0x40af7d
call sub.msvcrt.dll__errno
xor esi, esi
mov dword [eax], 2
jmp 0x40af7d
call sub.msvcrt.dll__errno
mov dword [eax], 0xc
jmp 0x40af7d
call sub.msvcrt.dll__errno
xor esi, esi
mov dword [eax], 0xe
jmp 0x40af7d
push edi
push esi
push ebx
sub esp, 0x230
mov ebx, dword [esp + 0x240]
call sub.msvcrt.dll__errno
test ebx, ebx
mov dword [eax], 0
je 0x40b4d2
cmp word [ebx], 0
je 0x40b490
mov eax, dword [sym.imp.msvcrt.dll__osver]
mov eax, dword [eax]
test ah, 0x80
jne 0x40b3d0
mov dword [esp], ebx
call sub.KERNEL32.dll_GetFileAttributesW
sub esp, 4
cmp eax, 0xffffffff
je 0x40b4b0
test al, 0x10
je 0x40b490
lea edi, [esp + 0x28]
mov dword [esp + 4], ebx
mov dword [esp + 8], 0x104
mov dword [esp], edi
call sub.msvcrt.dll__wfullpath
mov dword [esp], edi
call sub.msvcrt.dll_wcslen
mov dword [esp], 0x44465c
mov esi, eax
call sub.msvcrt.dll_wcslen
mov dword [esp], 0x444660
mov ebx, eax
call sub.msvcrt.dll_wcslen
lea edx, [esi + ebx + 0x21d]
add eax, edx
add eax, eax
mov dword [esp], eax
call sub.msvcrt.dll_malloc
test eax, eax
mov ebx, eax
je 0x40b4c2
lea esi, [eax + 0x434]
mov dword [esp + 4], edi
mov dword [esp], esi
call sub.msvcrt.dll_wcscpy
cmp word [ebx + 0x434], 0
jne 0x40b423
mov dword [esp + 4], 0x444660
mov dword [esp], esi
call sub.msvcrt.dll_wcscat
lea edx, [ebx + 0x224]
mov ecx, 0x41
xor eax, eax
mov edi, edx
rep stosd dword es:[edi], eax
mov dword [ebx + 0x42c], 0xffffffff
mov dword [ebx + 0x430], 0
mov dword [ebx + 0x21c], 0
mov word [ebx + 0x220], 0
mov word [ebx + 0x222], 0
add esp, 0x230
mov eax, ebx
pop ebx
pop esi
pop edi
ret
lea esi, [esp + 0x28]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0x104
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.KERNEL32.dll_WideCharToMultiByte
sub esp, 0x20
mov dword [esp], esi
call sub.KERNEL32.dll_GetFileAttributesA
sub esp, 4
jmp 0x40b2e8
mov dword [esp + 4], 0x2f
mov dword [esp], esi
call sub.msvcrt.dll_wcsrchr
mov dword [esp], esi
mov edi, eax
call sub.msvcrt.dll_wcslen
lea eax, [ebx + eax*2 + 0x432]
cmp edi, eax
je 0x40b372
mov dword [esp + 4], 0x5c
mov dword [esp], esi
call sub.msvcrt.dll_wcsrchr
mov dword [esp], esi
mov edi, eax
call sub.msvcrt.dll_wcslen
lea eax, [ebx + eax*2 + 0x432]
cmp edi, eax
je 0x40b372
mov dword [esp + 4], 0x44465c
mov dword [esp], esi
call sub.msvcrt.dll_wcscat
jmp 0x40b372
call sub.msvcrt.dll__errno
xor ebx, ebx
mov dword [eax], 0x14
add esp, 0x230
mov eax, ebx
pop ebx
pop esi
pop edi
ret
call sub.msvcrt.dll__errno
xor ebx, ebx
mov dword [eax], 2
jmp 0x40b3c3
call sub.msvcrt.dll__errno
mov dword [eax], 0xc
jmp 0x40b3c3
call sub.msvcrt.dll__errno
mov dword [eax], 0xe
jmp 0x40b3c3