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

Disassembly:
push ebp
lea ebp, [esp - 0x1004]
mov eax, 0x1004
call fcn.0051dcc0
push 0xffffffffffffffff
push 0x538b6d
mov eax, dword fs:[0]
push eax
sub esp, 0x24
mov eax, dword [0x572844]
xor eax, ebp
mov dword [ebp + 0x1000], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
cmp dword [0x598034], 0
je 0x40bc29
push 0
push 1
push 0x59701a
mov ecx, 0x5a57a8
call fcn.00407f10
cmp eax, 1
jne 0x40bc29
mov eax, dword [0x58cad8]
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x10], 0
cmp eax, 3
je 0x40ba00
cmp eax, 4
je 0x40ba00
push 1
lea eax, [ebp - 0x10]
mov ecx, 0x5a57a8
push eax
lea eax, [ebp - 0x14]
push eax
call fcn.00406fc0
jmp 0x40ba14
push 1
lea eax, [ebp - 0x10]
mov ecx, 0x5a57a8
push eax
lea eax, [ebp - 0x18]
push eax
call fcn.00407150
cmp dword [ebp - 0x10], 0
je 0x40bc29
push 0x800
lea eax, [ebp]
mov ecx, 0x59801c
push eax
call fcn.004b0550
lea eax, [ebp]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40ba80
push 0
push 0
push SysReAllocString
push SysReAllocString
push 0x800
lea eax, [ebp]
push eax
push 0x588ac0
call fcn.004b3950
cmp eax, 6
je 0x40ba70
cmp eax, 1
je 0x40ba70
cmp eax, 3
jne 0x40ba80
push dword [ebp - 0x14]
call fcn.0051de88
add esp, 4
jmp 0x40bc29
push 0x542cac
lea eax, [ebp]
push eax
call fcn.00484ad0
mov esi, eax
test esi, esi
jne 0x40babd
lea eax, [ebp]
push eax
push 0x1f6
call fcn.004a9c90
push eax
push 0x59701a
call fcn.004f3130
push dword [ebp - 0x14]
call fcn.0051de88
add esp, 0x10
jmp 0x40bc29
mov eax, dword [0x58cad8]
cmp eax, 3
jne 0x40bb1b
push esi
push 0xff
call fcn.00526aa2
push esi
push 0xfe
call fcn.00526aa2
xor edi, edi
add esp, 0x10
cmp dword [ebp - 0x10], edi
jbe 0x40bc10
jmp 0x40baf0
mov eax, dword [ebp - 0x18]
push esi
movzx eax, word [eax + edi*2]
push eax
call fcn.00526aa2
mov eax, dword [ebp - 0x18]
push esi
movzx eax, byte [eax + edi*2 + 1]
push eax
call fcn.00526aa2
inc edi
add esp, 0x10
cmp edi, dword [ebp - 0x10]
jb 0x40baf0
jmp 0x40bc10
cmp eax, 4
jne 0x40bbec
push esi
push 0xef
call fcn.00526aa2
push esi
push 0xbb
call fcn.00526aa2
push esi
push 0xbf
call fcn.00526aa2
mov eax, dword [ebp - 0x10]
xor edi, edi
mov dword [ebp - 0x30], edi
add esp, 0x18
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x28], edi
lea ebx, [eax*4]
mov dword [ebp - 0x24], edi
mov byte [ebp - 0x20], 0
mov dword [ebp - 0x2c], ebx
test ebx, ebx
je 0x40bba3
cmp ebx, 0x20
jbe 0x40bb77
mov eax, ebx
mov dword [ebp - 0x1c], ebx
jmp 0x40bb7f
mov eax, 0x20
mov dword [ebp - 0x1c], eax
push eax
push 0
call fcn.00525bbb
mov edi, eax
add esp, 8
test edi, edi
jne 0x40bb9a
mov ecx, 0x5b68fc
call fcn.0047b030
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x30], edi
mov dword [ebp - 0x28], eax
mov dword [ebp - 4], 0
push ebx
push edi
push dword [ebp - 0x18]
call fcn.004b40a0
mov ecx, edi
lea edx, [ecx + 1]
lea esp, [esp]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40bbc0
push esi
sub ecx, edx
push ecx
push 1
push edi
call fcn.00526d9e
add esp, 0x10
mov dword [ebp - 4], 0xffffffff
test edi, edi
je 0x40bc10
push edi
call fcn.00525b95
add esp, 4
jmp 0x40bc10
cmp eax, 2
jne 0x40bbff
push dword [ebp - 0x10]
mov eax, dword [ebp - 0x14]
push eax
push eax
call dword [sym.imp.USER32.dll_CharToOemBuffA]
push esi
push dword [ebp - 0x10]
push 1
push dword [ebp - 0x14]
call fcn.00526d9e
add esp, 0x10
push esi
call fcn.00526918
push dword [ebp - 0x14]
call fcn.0051de88
push dword [ebp - 0x18]
call fcn.0051de88
add esp, 0xc
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x1000]
xor ecx, ebp
call fcn.0051dca8
lea esp, [ebp + 0x1004]
pop ebp
ret 4