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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x1c
push ebx
push esi
push edi
xor edi, edi
xor ebx, ebx
inc ebx
mov dword [esp + 0x24], edi
mov dword [esp + 0x1c], ebx
mov esi, edi
mov dword [esp + 0x20], edi
mov dword [esp + 0x18], edi
mov dword [esp + 0x10], esi
test ecx, ecx
je 0x409564
lea eax, [esp + 0x10]
push eax
push ecx
call fcn.00409728
test eax, eax
js 0x409560
lea eax, [esp + 0x20]
push eax
call dword [sym.imp.iertutil.dll_Ordinal_34]
mov esi, dword [esp + 0x10]
test eax, eax
jns 0x40956a
mov ebx, edi
jmp 0x409714
mov esi, dword [esp + 0x10]
mov ebx, edi
mov dword [esp + 0x1c], ebx
cmp dword [esp + 0x20], edi
je 0x409589
lea ecx, [esp + 0x18]
call fcn.00409219
test eax, eax
js 0x409583
cmp dword [esp + 0x18], edi
jne 0x409589
mov ebx, edi
mov dword [esp + 0x1c], ebx
test ebx, ebx
je 0x409705
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [esp + 0x14], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
mov eax, dword [esp + 0x14]
cmp eax, 0xffffffff
jne 0x40960a
mov ebx, eax
cmp ecx, 2
je 0x4095b9
cmp ecx, 3
jne 0x4095f9
mov ecx, esi
call fcn.0040d178
test eax, eax
jne 0x4095f9
mov edx, esi
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
cmp ax, di
jne 0x4095c9
sub edx, ecx
mov ecx, esi
sar edx, 1
call fcn.0040d3ca
test eax, eax
js 0x4095f9
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
cmp ebx, 0xffffffff
je 0x4095af
mov dword [esp + 0x14], ebx
cmp ebx, 0xffffffff
mov ebx, dword [esp + 0x1c]
je 0x40962d
mov eax, dword [esp + 0x14]
test al, 0x10
jne 0x40962d
mov edx, esi
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
cmp ax, di
jne 0x409613
sub edx, ecx
mov ecx, esi
sar edx, 1
call fcn.0040d3ca
test eax, eax
js 0x40964c
push edi
push 0x2000000
push 3
push edi
push edi
push 0x20000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esp + 0x1c], eax
cmp eax, 0xffffffff
jne 0x409653
mov ebx, edi
jmp 0x409705
push edi
push edi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_GetFinalPathNameByHandleW]
mov edi, eax
test edi, edi
je 0x40968a
lea eax, [edi + edi]
push eax
call dword [sym.imp.ole32.dll_CoTaskMemAlloc]
mov dword [esp + 0x14], eax
test eax, eax
je 0x40968a
xor ecx, ecx
push ecx
push edi
push eax
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_GetFinalPathNameByHandleW]
mov edi, eax
test edi, edi
jne 0x409690
xor eax, eax
mov ebx, eax
jmp 0x4096fb
mov esi, dword [esp + 0x14]
inc edi
cmp edi, 8
jb 0x4096f7
mov ecx, esi
call fcn.004093bd
mov ebx, eax
test ebx, ebx
je 0x4096bb
cmp dword [esp + 0x20], 0
je 0x4096bb
mov edx, dword [esp + 0x18]
mov ecx, esi
call fcn.0040945f
mov ebx, eax
mov ecx, esi
call fcn.0040d178
test eax, eax
jne 0x4096f7
test ebx, ebx
je 0x4096f7
mov edx, edi
mov ecx, esi
call fcn.0040d3ca
mov ecx, eax
xor ebx, ebx
mov edi, esi
test ecx, ecx
setns bl
lea edx, [edi + 2]
mov ax, word [edi]
add edi, 2
cmp ax, word [esp + 0x24]
jne 0x4096e1
sub edi, edx
sar edi, 1
inc edi
test ecx, ecx
jns 0x409695
mov esi, dword [esp + 0x10]
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x18]
test eax, eax
je 0x409714
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
test esi, esi
je 0x40971f
push esi
call dword [sym.imp.ole32.dll_CoTaskMemFree]
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret