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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x59f208
mov eax, dword fs:[0]
push eax
sub esp, 0x74
mov eax, dword [0x6091d4]
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 0x5175b3
mov eax, dword [ecx]
jmp 0x5175b5
mov eax, ecx
xor edx, edx
push 0xffffffffffffffff
push edx
push esi
mov word [eax], dx
call fcn.004a99e0
mov dword [ebp - 4], 0
call fcn.00515d90
mov ecx, eax
mov dword [ebp - 4], 0xffffffff
call fcn.00515e20
or edi, 0xffffffff
cmp dword [esi + 0x14], 8
jb 0x5175e8
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 0x5177f8
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x7c], eax
cmp eax, 0xffffffff
je 0x5177e8
add eax, 2
push eax
call fcn.0056f086
mov esi, eax
add esp, 4
test esi, esi
je 0x5177e8
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 0x5177d2
mov eax, dword [ebp - 0x74]
cmp eax, dword [ebp - 0x7c]
jne 0x5177d2
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 0x517720
cmp eax, 2
jne 0x5176ca
push esi
mov ecx, ebx
call fcn.004af770
cmp byte [ebp + 8], 0
je 0x5177d0
push 0xffffffffffffffff
push 1
lea eax, [ebp - 0x28]
mov ecx, ebx
push eax
call fcn.004b41f0
push eax
mov ecx, ebx
call fcn.004af7e0
lea ecx, [ebp - 0x28]
call fcn.004a9470
push esi
xor edi, edi
call fcn.0056f018
add esp, 4
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
jmp 0x51781e
cmp eax, 1
jne 0x517705
lea eax, [esi + 3]
push eax
lea ecx, [ebp - 0x28]
call fcn.004b7140
mov dword [ebp - 4], 1
lea edx, [ebp - 0x28]
lea ecx, [ebp - 0x40]
call fcn.0051c170
push eax
mov ecx, ebx
call fcn.004af7e0
lea ecx, [ebp - 0x40]
call fcn.004a9470
lea ecx, [ebp - 0x28]
jmp 0x5177c4
cmp eax, 3
jne 0x5177d2
push esi
lea ecx, [ebp - 0x28]
call fcn.004b7140
mov dword [ebp - 4], 2
jmp 0x5176e2
mov al, byte [esi]
cmp al, 0xff
jne 0x51776e
cmp byte [esi + 1], 0xfe
jne 0x51776e
push esi
mov ecx, ebx
call fcn.004af770
push 0xffffffffffffffff
push 1
lea eax, [ebp - 0x40]
mov ecx, ebx
push eax
call fcn.004b41f0
push eax
mov ecx, ebx
call fcn.004af7e0
lea ecx, [ebp - 0x40]
call fcn.004a9470
push esi
xor edi, edi
call fcn.0056f018
add esp, 4
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
jmp 0x51781e
cmp al, 0xef
jne 0x517796
cmp byte [esi + 1], 0xbb
jne 0x517796
cmp byte [esi + 2], 0xbf
jne 0x517796
lea eax, [esi + 3]
push eax
lea ecx, [ebp - 0x28]
call fcn.004b7140
mov dword [ebp - 4], 3
jmp 0x5176e2
push esi
lea ecx, [ebp - 0x58]
call fcn.004b7140
lea edx, [ebp - 0x58]
mov dword [ebp - 4], 4
lea ecx, [ebp - 0x70]
call fcn.0051c170
push eax
mov ecx, ebx
call fcn.004af7e0
lea ecx, [ebp - 0x70]
call fcn.004a9470
lea ecx, [ebp - 0x58]
mov dword [ebp - 4], 0xffffffff
call fcn.004b70a0
xor edi, edi
push esi
call fcn.0056f018
add esp, 4
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
jmp 0x51781e
or edi, 0xffffffff
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
jmp 0x51781e
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jb 0x51781b
cmp eax, 3
jbe 0x517814
cmp eax, 5
jne 0x51781b
mov eax, 0xffffffea
jmp 0x51781e
mov eax, 0xffffffe4
jmp 0x51781e
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.0053cb86
mov esp, ebp
pop ebp
ret