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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x59d778
mov eax, dword fs:[0]
push eax
sub esp, 0x74
mov eax, dword [0x6071d4]
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 0x515c73
mov eax, dword [ecx]
jmp 0x515c75
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.00514450
mov ecx, eax
mov dword [ebp - 4], 0xffffffff
call fcn.005144e0
or edi, 0xffffffff
cmp dword [esi + 0x14], 8
jb 0x515ca8
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 0x515eb8
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x7c], eax
cmp eax, 0xffffffff
je 0x515ea8
add eax, 2
push eax
call fcn.0056d6d6
mov esi, eax
add esp, 4
test esi, esi
je 0x515ea8
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 0x515e92
mov eax, dword [ebp - 0x74]
cmp eax, dword [ebp - 0x7c]
jne 0x515e92
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 0x515de0
cmp eax, 2
jne 0x515d8a
push esi
mov ecx, ebx
call fcn.004aef90
cmp byte [ebp + 8], 0
je 0x515e90
push 0xffffffffffffffff
push 1
lea eax, [ebp - 0x28]
mov ecx, ebx
push eax
call fcn.004b3a10
push eax
mov ecx, ebx
call fcn.004af000
lea ecx, [ebp - 0x28]
call fcn.004a9470
push esi
xor edi, edi
call fcn.0056d668
add esp, 4
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
jmp 0x515ede
cmp eax, 1
jne 0x515dc5
lea eax, [esi + 3]
push eax
lea ecx, [ebp - 0x28]
call fcn.004b6360
mov dword [ebp - 4], 1
lea edx, [ebp - 0x28]
lea ecx, [ebp - 0x40]
call fcn.0051a7e0
push eax
mov ecx, ebx
call fcn.004af000
lea ecx, [ebp - 0x40]
call fcn.004a9470
lea ecx, [ebp - 0x28]
jmp 0x515e84
cmp eax, 3
jne 0x515e92
push esi
lea ecx, [ebp - 0x28]
call fcn.004b6360
mov dword [ebp - 4], 2
jmp 0x515da2
mov al, byte [esi]
cmp al, 0xff
jne 0x515e2e
cmp byte [esi + 1], 0xfe
jne 0x515e2e
push esi
mov ecx, ebx
call fcn.004aef90
push 0xffffffffffffffff
push 1
lea eax, [ebp - 0x40]
mov ecx, ebx
push eax
call fcn.004b3a10
push eax
mov ecx, ebx
call fcn.004af000
lea ecx, [ebp - 0x40]
call fcn.004a9470
push esi
xor edi, edi
call fcn.0056d668
add esp, 4
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
jmp 0x515ede
cmp al, 0xef
jne 0x515e56
cmp byte [esi + 1], 0xbb
jne 0x515e56
cmp byte [esi + 2], 0xbf
jne 0x515e56
lea eax, [esi + 3]
push eax
lea ecx, [ebp - 0x28]
call fcn.004b6360
mov dword [ebp - 4], 3
jmp 0x515da2
push esi
lea ecx, [ebp - 0x58]
call fcn.004b6360
lea edx, [ebp - 0x58]
mov dword [ebp - 4], 4
lea ecx, [ebp - 0x70]
call fcn.0051a7e0
push eax
mov ecx, ebx
call fcn.004af000
lea ecx, [ebp - 0x70]
call fcn.004a9470
lea ecx, [ebp - 0x58]
mov dword [ebp - 4], 0xffffffff
call fcn.004b62c0
xor edi, edi
push esi
call fcn.0056d668
add esp, 4
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
jmp 0x515ede
or edi, 0xffffffff
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
jmp 0x515ede
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jb 0x515edb
cmp eax, 3
jbe 0x515ed4
cmp eax, 5
jne 0x515edb
mov eax, 0xffffffea
jmp 0x515ede
mov eax, 0xffffffe4
jmp 0x515ede
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.0053b206
mov esp, ebp
pop ebp
ret