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

Disassembly:
push ebp
lea ebp, [esp - 0x1004]
mov eax, 0x1004
call fcn.0052f720
push 0xffffffffffffffff
push 0x54af6d
mov eax, dword fs:[0]
push eax
sub esp, 0x20
mov eax, dword [0x58bb30]
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 [0x5b3340], 0
je 0x40e33e
push 0
push 1
push 0x5b232a
mov ecx, 0x5c2bd0
call fcn.0040aa90
cmp eax, 1
jne 0x40e33e
mov eax, dword [0x5a7ef0]
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x10], 0
cmp eax, 3
je 0x40e120
cmp eax, 4
je 0x40e120
push 1
lea eax, [ebp - 0x10]
mov ecx, 0x5c2bd0
push eax
lea eax, [ebp - 0x14]
push eax
call fcn.00409a90
jmp 0x40e134
push 1
lea eax, [ebp - 0x10]
mov ecx, 0x5c2bd0
push eax
lea eax, [ebp - 0x18]
push eax
call fcn.00409c20
cmp dword [ebp - 0x10], 0
je 0x40e33e
push 0x800
lea eax, [ebp]
mov ecx, 0x5b332c
push eax
call fcn.004bd280
lea eax, [ebp]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40e1a0
push 0
push 0
push SysReAllocString
push SysReAllocString
push 0x800
lea eax, [ebp]
push eax
push 0x5a3ed8
call fcn.004c0680
cmp eax, 6
je 0x40e190
cmp eax, 1
je 0x40e190
cmp eax, 3
jne 0x40e1a0
push dword [ebp - 0x14]
call fcn.0052f90c
add esp, 4
jmp 0x40e33e
push 0x557d24
lea eax, [ebp]
push eax
call fcn.00491f50
mov esi, eax
test esi, esi
jne 0x40e1dd
lea eax, [ebp]
push eax
push 0x1f6
call fcn.004b68d0
push eax
push 0x5b232a
call fcn.00503540
push dword [ebp - 0x14]
call fcn.0052f90c
add esp, 0x10
jmp 0x40e33e
mov eax, dword [0x5a7ef0]
cmp eax, 3
jne 0x40e23b
push esi
push 0xff
call fcn.00538847
push esi
push 0xfe
call fcn.00538847
xor edi, edi
add esp, 0x10
cmp dword [ebp - 0x10], edi
jbe 0x40e325
jmp 0x40e210
mov eax, dword [ebp - 0x18]
push esi
movzx eax, word [eax + edi*2]
push eax
call fcn.00538847
mov eax, dword [ebp - 0x18]
push esi
movzx eax, byte [eax + edi*2 + 1]
push eax
call fcn.00538847
inc edi
add esp, 0x10
cmp edi, dword [ebp - 0x10]
jb 0x40e210
jmp 0x40e325
cmp eax, 4
jne 0x40e301
push esi
push 0xef
call fcn.00538847
push esi
push 0xbb
call fcn.00538847
push esi
push 0xbf
call fcn.00538847
mov eax, dword [ebp - 0x10]
xor edi, edi
mov dword [ebp - 0x2c], edi
add esp, 0x18
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x24], edi
lea ebx, [eax*4]
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x28], ebx
test ebx, ebx
je 0x40e2bf
cmp ebx, 0x20
jbe 0x40e293
mov eax, ebx
mov dword [ebp - 0x1c], ebx
jmp 0x40e29b
mov eax, 0x20
mov dword [ebp - 0x1c], eax
push eax
push 0
call fcn.00537b8a
mov edi, eax
add esp, 8
test edi, edi
jne 0x40e2b6
mov ecx, 0x5d281c
call fcn.004875a0
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x24], eax
mov dword [ebp - 4], 0
push ebx
push edi
push dword [ebp - 0x18]
call fcn.004c0df0
mov ecx, edi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40e2d5
push esi
sub ecx, edx
push ecx
push 1
push edi
call fcn.00538b43
add esp, 0x10
mov dword [ebp - 4], 0xffffffff
test edi, edi
je 0x40e325
push edi
call fcn.00537b6f
add esp, 4
jmp 0x40e325
cmp eax, 2
jne 0x40e314
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.00538b43
add esp, 0x10
push esi
call fcn.005386bd
push dword [ebp - 0x14]
call fcn.0052f90c
push dword [ebp - 0x18]
call fcn.0052f90c
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.0052f708
lea esp, [ebp + 0x1004]
pop ebp
ret 4