Function at 0x40942f
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
mov edx, ecx
mov dword [esp + 0x24], edi
inc ebx
mov dword [esp + 0x20], edi
mov dword [esp + 0x1c], ebx
mov esi, edi
mov dword [esp + 0x18], edi
mov dword [esp + 0x10], esi
test edx, edx
je 0x40949f
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, di
jne 0x409461
sub ecx, esi
lea eax, [esp + 0x10]
push eax
sar ecx, 1
push ecx
push ecx
push edx
call fcn.00409663
test eax, eax
js 0x40949b
lea eax, [esp + 0x20]
push eax
call dword [sym.imp.iertutil.dll_Ordinal_34]
mov esi, dword [esp + 0x10]
test eax, eax
jns 0x4094a5
mov ebx, edi
jmp 0x40964f
mov esi, dword [esp + 0x10]
mov ebx, edi
mov dword [esp + 0x1c], ebx
cmp dword [esp + 0x20], edi
je 0x4094c4
lea ecx, [esp + 0x18]
call fcn.00409124
test eax, eax
js 0x4094be
cmp dword [esp + 0x18], edi
jne 0x4094c4
mov ebx, edi
mov dword [esp + 0x1c], ebx
test ebx, ebx
je 0x409640
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 0x409545
mov ebx, eax
cmp ecx, 2
je 0x4094f4
cmp ecx, 3
jne 0x409534
mov ecx, esi
call fcn.0040cfb2
test eax, eax
jne 0x409534
mov edx, esi
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
cmp ax, di
jne 0x409504
sub edx, ecx
mov ecx, esi
sar edx, 1
call fcn.0040d1f5
test eax, eax
js 0x409534
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 0x4094ea
mov dword [esp + 0x14], ebx
cmp ebx, 0xffffffff
mov ebx, dword [esp + 0x1c]
je 0x409568
mov eax, dword [esp + 0x14]
test al, 0x10
jne 0x409568
mov edx, esi
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
cmp ax, di
jne 0x40954e
sub edx, ecx
mov ecx, esi
sar edx, 1
call fcn.0040d1f5
test eax, eax
js 0x409587
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 0x40958e
mov ebx, edi
jmp 0x409640
push edi
push edi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_GetFinalPathNameByHandleW]
mov edi, eax
test edi, edi
je 0x4095c5
lea eax, [edi + edi]
push eax
call dword [sym.imp.ole32.dll_CoTaskMemAlloc]
mov dword [esp + 0x14], eax
test eax, eax
je 0x4095c5
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 0x4095cb
xor eax, eax
mov ebx, eax
jmp 0x409636
mov esi, dword [esp + 0x14]
inc edi
cmp edi, 8
jb 0x409632
mov ecx, esi
call fcn.004092de
mov ebx, eax
test ebx, ebx
je 0x4095f6
cmp dword [esp + 0x20], 0
je 0x4095f6
mov edx, dword [esp + 0x18]
mov ecx, esi
call fcn.00409382
mov ebx, eax
mov ecx, esi
call fcn.0040cfb2
test eax, eax
jne 0x409632
test ebx, ebx
je 0x409632
mov edx, edi
mov ecx, esi
call fcn.0040d1f5
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 0x40961c
sub edi, edx
sar edi, 1
inc edi
test ecx, ecx
jns 0x4095d0
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 0x40964f
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
test esi, esi
je 0x40965a
push esi
call dword [sym.imp.ole32.dll_CoTaskMemFree]
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret