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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x59db28
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 0x515f23
mov eax, dword [ecx]
jmp 0x515f25
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.00514700
mov ecx, eax
mov dword [ebp - 4], 0xffffffff
call fcn.00514790
or edi, 0xffffffff
cmp dword [esi + 0x14], 8
jb 0x515f58
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 0x516168
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x7c], eax
cmp eax, 0xffffffff
je 0x516158
add eax, 2
push eax
call fcn.0056da06
mov esi, eax
add esp, 4
test esi, esi
je 0x516158
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 0x516142
mov eax, dword [ebp - 0x74]
cmp eax, dword [ebp - 0x7c]
jne 0x516142
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 0x516090
cmp eax, 2
jne 0x51603a
push esi
mov ecx, ebx
call fcn.004aef90
cmp byte [ebp + 8], 0
je 0x516140
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.0056d998
add esp, 4
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
jmp 0x51618e
cmp eax, 1
jne 0x516075
lea eax, [esi + 3]
push eax
lea ecx, [ebp - 0x28]
call fcn.004b6390
mov dword [ebp - 4], 1
lea edx, [ebp - 0x28]
lea ecx, [ebp - 0x40]
call fcn.0051aae0
push eax
mov ecx, ebx
call fcn.004af000
lea ecx, [ebp - 0x40]
call fcn.004a9470
lea ecx, [ebp - 0x28]
jmp 0x516134
cmp eax, 3
jne 0x516142
push esi
lea ecx, [ebp - 0x28]
call fcn.004b6390
mov dword [ebp - 4], 2
jmp 0x516052
mov al, byte [esi]
cmp al, 0xff
jne 0x5160de
cmp byte [esi + 1], 0xfe
jne 0x5160de
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.0056d998
add esp, 4
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
jmp 0x51618e
cmp al, 0xef
jne 0x516106
cmp byte [esi + 1], 0xbb
jne 0x516106
cmp byte [esi + 2], 0xbf
jne 0x516106
lea eax, [esi + 3]
push eax
lea ecx, [ebp - 0x28]
call fcn.004b6390
mov dword [ebp - 4], 3
jmp 0x516052
push esi
lea ecx, [ebp - 0x58]
call fcn.004b6390
lea edx, [ebp - 0x58]
mov dword [ebp - 4], 4
lea ecx, [ebp - 0x70]
call fcn.0051aae0
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.004b62f0
xor edi, edi
push esi
call fcn.0056d998
add esp, 4
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
jmp 0x51618e
or edi, 0xffffffff
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
jmp 0x51618e
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jb 0x51618b
cmp eax, 3
jbe 0x516184
cmp eax, 5
jne 0x51618b
mov eax, 0xffffffea
jmp 0x51618e
mov eax, 0xffffffe4
jmp 0x51618e
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.0053b526
mov esp, ebp
pop ebp
ret