Function at 0x515cc1
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ebx
mov esi, dword [ebp + 8]
mov edi, dword [ebp + 0x10]
mov ebx, dword [ebp + 0xc]
test esi, esi
je 0x515cdb
cmp byte [esi + 0x5c], 0x72
je 0x515ce5
mov edx, 0xfffffffe
jmp 0x515ee6
mov ecx, dword [esi + 0x38]
cmp ecx, 0xfffffffd
sete dl
cmp ecx, 0xffffffff
sete al
or eax, edx
or edx, 0xffffffff
test al, 1
jne 0x515ee6
xor edx, edx
dec ecx
je 0x515ee6
mov dword [ebp - 0x10], ebx
mov dword [esi + 0xc], ebx
mov dword [esi + 0x10], edi
test edi, edi
je 0x515eb0
mov eax, dword [esi + 0x6c]
cmp eax, 0xffffffff
je 0x515d59
mov byte [ebx], al
inc ebx
inc dword [esi + 0xc]
mov dword [ebp - 0x10], ebx
dec dword [esi + 0x10]
mov dword [esi + 0x6c], 0xffffffff
inc dword [esi + 0x68]
cmp dword [esi + 0x70], 0
je 0x515d59
mov dl, 1
mov dword [esi + 0x38], 1
jmp 0x515ee6
mov dword [esi + 0x38], 0xffffffff
jmp 0x515eb0
cmp dword [esi + 0x10], 0
je 0x515eb0
cmp dword [esi + 0x58], 0
mov eax, dword [esi + 4]
je 0x515dd0
mov ebx, eax
mov eax, dword [esi + 0x10]
cmp ebx, eax
jbe 0x515d77
mov ebx, eax
test ebx, ebx
je 0x515d9a
push ebx
push dword [esi]
push dword [esi + 0xc]
call fcn.0052ef10
add dword [ebp - 0x10], ebx
add dword [esi], ebx
mov eax, dword [ebp - 0x10]
sub dword [esi + 0x10], ebx
mov dword [esi + 0xc], eax
sub dword [esi + 4], ebx
add esp, 0xc
mov eax, dword [esi + 0x10]
test eax, eax
je 0x515db5
push dword [esi + 0x40]
push eax
push 1
push dword [ebp - 0x10]
call sub.msvcrt.dll_fread
add esp, 0x10
sub dword [esi + 0x10], eax
sub edi, dword [esi + 0x10]
add dword [esi + 0x64], edi
add dword [esi + 0x68], edi
test edi, edi
jne 0x515dc9
mov dword [esi + 0x3c], 1
mov edx, edi
jmp 0x515ee6
test eax, eax
jne 0x515e1a
cmp dword [esi + 0x3c], 0
jne 0x515e1a
call sub.msvcrt.dll__errno
mov dword [eax], 0
push dword [esi + 0x40]
push 0x4000
push 1
push dword [esi + 0x44]
call sub.msvcrt.dll_fread
add esp, 0x10
test eax, eax
mov dword [esi + 4], eax
jne 0x515e15
mov eax, dword [esi + 0x40]
mov dword [esi + 0x3c], 1
test byte [eax + 0xc], 0x20
jne 0x515d4d
mov eax, dword [esi + 0x44]
mov dword [esi], eax
mov eax, dword [esi + 4]
add dword [esi + 0x64], eax
mov eax, dword [esi + 0x10]
add dword [esi + 0x68], eax
push 0
push esi
call fcn.00518941
mov edx, dword [esi + 0x64]
sub edx, dword [esi + 4]
mov dword [esi + 0x38], eax
mov dword [esi + 0x64], edx
mov edx, dword [esi + 0x68]
sub edx, dword [esi + 0x10]
dec eax
mov dword [esi + 0x68], edx
pop edx
pop ecx
jne 0x515ea0
mov eax, dword [esi + 0xc]
sub eax, ebx
push eax
push ebx
push dword [esi + 0x4c]
call fcn.0051831a
mov ebx, dword [esi + 0xc]
mov dword [esi + 0x4c], eax
mov eax, esi
call fcn.00515c7d
add esp, 0xc
cmp eax, dword [esi + 0x4c]
je 0x515e75
mov dword [esi + 0x38], 0xfffffffd
jmp 0x515ea0
mov eax, esi
call fcn.00515c7d
mov eax, esi
call fcn.005157be
cmp dword [esi + 0x38], 0
jne 0x515eb0
push esi
call fcn.00518670
push 0
push 0
push 0
call fcn.0051831a
add esp, 0x10
mov dword [esi + 0x4c], eax
cmp dword [esi + 0x38], 0
jne 0x515eb0
cmp dword [esi + 0x3c], 0
je 0x515d59
mov eax, dword [esi + 0xc]
sub eax, ebx
push eax
push ebx
push dword [esi + 0x4c]
call fcn.0051831a
mov ecx, dword [esi + 0x10]
add esp, 0xc
cmp edi, ecx
mov dword [esi + 0x4c], eax
jne 0x515ee2
mov eax, dword [esi + 0x38]
cmp eax, 0xfffffffd
sete dl
inc eax
sete al
or eax, edx
or edx, 0xffffffff
test al, 1
jne 0x515ee6
mov edx, edi
sub edx, ecx
lea esp, [ebp - 0xc]
mov eax, edx
pop ebx
pop esi
pop edi
pop ebp
ret