Function at 0x52c960
Capabilities:
Read file on windows

Disassembly:
sub esp, 8
push ebx
push ebp
mov ebp, ecx
push esi
test ebp, ebp
push edi
mov dword [esp + 0x14], edx
mov esi, edx
je 0x52cb88
cmp byte [ebp + 0x5c], 0x72
jne 0x52cb88
mov eax, dword [ebp + 0x38]
cmp eax, 0xfffffffd
je 0x52cb7b
cmp eax, 0xffffffff
je 0x52cb7b
cmp eax, 1
jne 0x52c9a7
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 8
ret 4
mov ebx, dword [esp + 0x1c]
mov dword [esp + 0x10], edx
test ebx, ebx
mov dword [ebp + 0xc], edx
mov dword [ebp + 0x10], ebx
je 0x52cb57
mov eax, dword [ebp + 0x58]
test eax, eax
mov eax, dword [ebp + 4]
jne 0x52cab9
test eax, eax
jne 0x52ca19
mov eax, dword [ebp + 0x3c]
test eax, eax
jne 0x52ca19
call fcn.0059086e
mov dword [eax], 0
mov eax, dword [ebp + 0x40]
mov ecx, dword [ebp + 0x44]
push eax
push 0x4000
push 1
push ecx
call fcn.0058ba27
add esp, 0x10
mov dword [ebp + 4], eax
test eax, eax
jne 0x52ca13
mov edx, dword [ebp + 0x40]
mov dword [ebp + 0x3c], 1
test byte [edx + 0xc], 0x20
jne 0x52cb50
mov eax, dword [ebp + 0x44]
mov dword [ebp], eax
xor edx, edx
mov ecx, ebp
call fcn.0052d1f0
cmp eax, 1
mov dword [ebp + 0x38], eax
jne 0x52ca93
mov ecx, dword [ebp + 0xc]
mov edx, esi
sub ecx, esi
push ecx
mov ecx, dword [ebp + 0x4c]
call fcn.0052e8b0
mov edx, dword [ebp + 0xc]
mov ecx, ebp
mov dword [ebp + 0x4c], eax
mov dword [esp + 0x1c], edx
call fcn.0052cf70
cmp eax, dword [ebp + 0x4c]
je 0x52ca59
mov dword [ebp + 0x38], 0xfffffffd
jmp 0x52ca8f
mov ecx, ebp
call fcn.0052cf70
mov ecx, ebp
call fcn.0052c700
mov eax, dword [ebp + 0x38]
test eax, eax
jne 0x52ca8f
mov esi, dword [ebp + 8]
mov edi, dword [ebp + 0x14]
mov ecx, ebp
call fcn.0052d030
xor edx, edx
xor ecx, ecx
push 0
mov dword [ebp + 8], esi
mov dword [ebp + 0x14], edi
call fcn.0052e8b0
mov dword [ebp + 0x4c], eax
mov esi, dword [esp + 0x1c]
mov eax, dword [ebp + 0x38]
test eax, eax
jne 0x52cb57
mov eax, dword [ebp + 0x3c]
test eax, eax
jne 0x52cb57
mov eax, dword [ebp + 0x10]
test eax, eax
jne 0x52c9bd
jmp 0x52cb57
mov ecx, dword [ebp + 0x10]
cmp eax, ecx
jbe 0x52cac2
mov eax, ecx
test eax, eax
jbe 0x52cb01
mov esi, dword [ebp]
mov edi, dword [ebp + 0xc]
mov ecx, eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x14]
mov esi, dword [ebp]
mov edx, dword [ebp + 0x10]
add ecx, eax
mov dword [esp + 0x10], ecx
mov dword [ebp + 0xc], ecx
mov ecx, dword [ebp + 4]
add esi, eax
sub edx, eax
sub ecx, eax
mov dword [ebp], esi
mov dword [ebp + 0x10], edx
mov dword [ebp + 4], ecx
mov eax, dword [ebp + 0x10]
test eax, eax
jbe 0x52cb24
mov edx, dword [ebp + 0x40]
push edx
push eax
mov eax, dword [esp + 0x18]
push 1
push eax
call fcn.0058ba27
mov ecx, dword [ebp + 0x10]
add esp, 0x10
sub ecx, eax
mov dword [ebp + 0x10], ecx
mov esi, dword [ebp + 0x10]
mov edx, dword [ebp + 8]
mov ecx, dword [ebp + 0x14]
sub ebx, esi
add edx, ebx
add ecx, ebx
test ebx, ebx
mov dword [ebp + 8], edx
mov dword [ebp + 0x14], ecx
jne 0x52cb44
mov dword [ebp + 0x3c], 1
pop edi
pop esi
mov eax, ebx
pop ebp
pop ebx
add esp, 8
ret 4
mov dword [ebp + 0x38], 0xffffffff
mov ecx, dword [ebp + 0xc]
mov edx, esi
sub ecx, esi
push ecx
mov ecx, dword [ebp + 0x4c]
call fcn.0052e8b0
mov ecx, dword [ebp + 0x10]
mov dword [ebp + 0x4c], eax
pop edi
mov eax, ebx
pop esi
pop ebp
sub eax, ecx
pop ebx
add esp, 8
ret 4
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 8
ret 4
pop edi
pop esi
pop ebp
mov eax, 0xfffffffe
pop ebx
add esp, 8
ret 4