Function at 0x50e9e0
Capabilities:
Check if file exists
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x595f78
mov eax, dword fs:[0]
push eax
sub esp, 0x74
mov eax, dword [0x5ff1d4]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x80], edx
mov esi, ecx
mov ebx, dword [ebp + 0xc]
sub esp, 0x18
mov ecx, esp
mov dword [ebp - 0x78], esp
mov dword [ecx + 0x14], 7
mov dword [ecx + 0x10], 0
cmp dword [ecx + 0x14], 8
jb 0x50ea33
mov eax, dword [ecx]
jmp 0x50ea35
mov eax, ecx
xor edx, edx
push 0xffffffffffffffff
push edx
push esi
mov word [eax], dx
call fcn.004a4df0
mov dword [ebp - 4], 0
call fcn.0050d210
mov ecx, eax
mov dword [ebp - 4], 0xffffffff
call fcn.0050d2a0
or edi, 0xffffffff
cmp dword [esi + 0x14], 8
jb 0x50ea68
mov esi, dword [esi]
push 0
push 0
push 3
push 0
push 7
push 1
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x78], eax
cmp eax, 0xffffffff
je 0x50ec78
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x7c], eax
cmp eax, 0xffffffff
je 0x50ec68
add eax, 2
push eax
call fcn.00566443
mov esi, eax
add esp, 4
test esi, esi
je 0x50ec68
push 0
lea eax, [ebp - 0x74]
mov dword [ebp - 0x74], 0
push eax
push dword [ebp - 0x7c]
push esi
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x50ec52
mov eax, dword [ebp - 0x74]
cmp eax, dword [ebp - 0x7c]
jne 0x50ec52
mov byte [eax + esi], 0
mov eax, dword [ebp - 0x74]
mov byte [eax + esi + 1], 0
mov eax, dword [ebp - 0x80]
mov eax, dword [eax]
test eax, eax
je 0x50eba0
cmp eax, 2
jne 0x50eb4a
push esi
mov ecx, ebx
call fcn.004aa250
cmp byte [ebp + 8], 0
je 0x50ec50
push 0xffffffffffffffff
push 1
lea eax, [ebp - 0x28]
mov ecx, ebx
push eax
call fcn.004aecd0
push eax
mov ecx, ebx
call fcn.004aa2c0
lea ecx, [ebp - 0x28]
call fcn.004a4880
push esi
xor edi, edi
call fcn.00566428
add esp, 4
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
jmp 0x50ec9e
cmp eax, 1
jne 0x50eb85
lea eax, [esi + 3]
push eax
lea ecx, [ebp - 0x28]
call fcn.004b1620
mov dword [ebp - 4], 1
lea edx, [ebp - 0x28]
lea ecx, [ebp - 0x40]
call fcn.005135a0
push eax
mov ecx, ebx
call fcn.004aa2c0
lea ecx, [ebp - 0x40]
call fcn.004a4880
lea ecx, [ebp - 0x28]
jmp 0x50ec44
cmp eax, 3
jne 0x50ec52
push esi
lea ecx, [ebp - 0x28]
call fcn.004b1620
mov dword [ebp - 4], 2
jmp 0x50eb62
mov al, byte [esi]
cmp al, 0xff
jne 0x50ebee
cmp byte [esi + 1], 0xfe
jne 0x50ebee
push esi
mov ecx, ebx
call fcn.004aa250
push 0xffffffffffffffff
push 1
lea eax, [ebp - 0x40]
mov ecx, ebx
push eax
call fcn.004aecd0
push eax
mov ecx, ebx
call fcn.004aa2c0
lea ecx, [ebp - 0x40]
call fcn.004a4880
push esi
xor edi, edi
call fcn.00566428
add esp, 4
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
jmp 0x50ec9e
cmp al, 0xef
jne 0x50ec16
cmp byte [esi + 1], 0xbb
jne 0x50ec16
cmp byte [esi + 2], 0xbf
jne 0x50ec16
lea eax, [esi + 3]
push eax
lea ecx, [ebp - 0x28]
call fcn.004b1620
mov dword [ebp - 4], 3
jmp 0x50eb62
push esi
lea ecx, [ebp - 0x58]
call fcn.004b1620
lea edx, [ebp - 0x58]
mov dword [ebp - 4], 4
lea ecx, [ebp - 0x70]
call fcn.005135a0
push eax
mov ecx, ebx
call fcn.004aa2c0
lea ecx, [ebp - 0x70]
call fcn.004a4880
lea ecx, [ebp - 0x58]
mov dword [ebp - 4], 0xffffffff
call fcn.004b1580
xor edi, edi
push esi
call fcn.00566428
add esp, 4
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
jmp 0x50ec9e
or edi, 0xffffffff
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
jmp 0x50ec9e
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jb 0x50ec9b
cmp eax, 3
jbe 0x50ec94
cmp eax, 5
jne 0x50ec9b
mov eax, 0xffffffea
jmp 0x50ec9e
mov eax, 0xffffffe4
jmp 0x50ec9e
or eax, 0xffffffff
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00533fc6
mov esp, ebp
pop ebp
ret