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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4d6daa
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x54
push ebx
xor ebx, ebx
mov dword [ebp - 0x18], ebx
cmp dword [0x51069c], ebx
je 0x40b783
push esi
push 0x4dc7b0
mov dword [0x51069c], ebx
mov dword [ebp - 0x14], ebx
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov esi, eax
test esi, esi
je 0x40b782
push 0x4dc7e0
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x18], eax
test eax, eax
je 0x40b58d
lea eax, [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [ebp - 0x18]
push 0x4dc7cc
push esi
mov dword [ebp - 0x18], ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x40b5ad
lea ecx, [ebp - 0x18]
push ecx
push 0x40b4e0
push 4
call eax
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x40b782
push 0x104
push 0x5158a8
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0x5c
push 0x5158a8
call fcn.004a6a41
add esp, 8
test eax, eax
je 0x40b5e8
xor ecx, ecx
mov word [eax], cx
push 0x5158a8
lea ecx, [ebp - 0x30]
call fcn.00406df0
cmp dword [ebp - 0x14], 0
mov esi, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [ebp - 4], 0
je 0x40b667
push 0x4dc7f0
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x60]
push eax
call fcn.0040a5b0
add esp, 0xc
cmp dword [eax + 0x14], 8
mov ebx, 1
mov byte [ebp - 4], 1
mov dword [ebp - 0x18], ebx
jb 0x40b631
mov eax, dword [eax]
push eax
call esi
cmp eax, 0xffffffff
je 0x40b667
push 0x4dc80c
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x48]
push eax
call fcn.0040a5b0
add esp, 0xc
mov ebx, 3
cmp dword [eax + 0x14], 8
jb 0x40b65b
mov eax, dword [eax]
push eax
call esi
mov byte [ebp - 0xd], 1
cmp eax, 0xffffffff
jne 0x40b66b
mov byte [ebp - 0xd], 0
test bl, 2
je 0x40b698
and ebx, 0xfffffffd
cmp dword [ebp - 0x34], 8
jb 0x40b684
push dword [ebp - 0x48]
call fcn.004a46e7
add esp, 4
xor eax, eax
mov dword [ebp - 0x34], 7
mov dword [ebp - 0x38], 0
mov word [ebp - 0x48], ax
mov dword [ebp - 4], 0
test bl, 1
je 0x40b6b8
and ebx, 0xfffffffe
cmp dword [ebp - 0x4c], 8
jb 0x40b6b8
push dword [ebp - 0x60]
call fcn.004a46e7
add esp, 4
cmp byte [ebp - 0xd], 0
je 0x40b6c8
push 0x4dc80c
jmp 0x40b755
cmp dword [ebp - 0x14], 0
jne 0x40b729
push 0x4dc83c
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x48]
push eax
call fcn.0040a5b0
add esp, 0xc
or ebx, 4
mov byte [ebp - 4], 2
cmp dword [eax + 0x14], 8
mov dword [ebp - 0x18], ebx
jb 0x40b6f5
mov eax, dword [eax]
push eax
call esi
cmp eax, 0xffffffff
je 0x40b729
push 0x4dc854
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x60]
push eax
call fcn.0040a5b0
add esp, 0xc
or ebx, 8
cmp dword [eax + 0x14], 8
jb 0x40b71d
mov eax, dword [eax]
push eax
call esi
mov byte [ebp - 0xd], 1
cmp eax, 0xffffffff
jne 0x40b72d
mov byte [ebp - 0xd], 0
test bl, 8
je 0x40b73d
lea ecx, [ebp - 0x60]
and ebx, 0xfffffff7
call fcn.004042d0
test bl, 4
je 0x40b74a
lea ecx, [ebp - 0x48]
call fcn.004042d0
cmp byte [ebp - 0xd], 0
je 0x40b769
push 0x4dc854
push 0x104
push 0x5158a8
call fcn.004a69d5
add esp, 0xc
jmp 0x40b771
xor eax, eax
mov word [0x5158a8], ax
cmp dword [ebp - 0x1c], 8
jb 0x40b782
push dword [ebp - 0x30]
call fcn.004a46e7
add esp, 4
pop esi
mov ecx, dword [ebp - 0xc]
mov eax, 0x5158a8
pop ebx
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret