Function at 0x10054990
Capabilities:
Read file on windows

Disassembly:
mov eax, dword [esp + 8]
push ebp
mov ebp, dword [esp + 8]
test ebp, ebp
push edi
mov edi, eax
je 0x10054c3a
cmp byte [ebp + 0x5c], 0x72
jne 0x10054c3a
mov ecx, dword [ebp + 0x38]
cmp ecx, 0xfffffffd
je 0x10054c34
or edx, 0xffffffff
cmp ecx, edx
je 0x10054c34
cmp ecx, 1
jne 0x100549cf
pop edi
xor eax, eax
pop ebp
ret
mov ecx, dword [esp + 0x14]
test ecx, ecx
push esi
mov dword [esp + 0x14], eax
mov dword [ebp + 0xc], eax
mov dword [ebp + 0x10], ecx
je 0x10054a21
mov ecx, dword [ebp + 0x6c]
cmp ecx, edx
je 0x10054a21
mov byte [eax], cl
mov edi, dword [ebp + 0xc]
mov esi, dword [ebp + 0x10]
mov ecx, dword [ebp + 0x68]
inc eax
inc edi
mov dword [ebp + 0xc], edi
dec esi
mov dword [esp + 0x14], eax
mov edi, eax
mov eax, dword [ebp + 0x70]
inc ecx
test eax, eax
mov dword [ebp + 0x10], esi
mov dword [ebp + 0x6c], edx
mov dword [ebp + 0x68], ecx
je 0x10054a21
pop esi
pop edi
mov dword [ebp + 0x38], 1
mov eax, 1
pop ebp
ret
mov eax, dword [ebp + 0x10]
test eax, eax
push ebx
je 0x10054bf7
mov ebx, dword [sym.imp.MSVCR80.dll_fread]
mov esi, dword [sym.imp.MSVCR80.dll__errno]
lea esp, [esp]
mov eax, dword [ebp + 0x58]
test eax, eax
jne 0x10054b5c
mov eax, dword [ebp + 4]
test eax, eax
jne 0x10054a96
mov eax, dword [ebp + 0x3c]
test eax, eax
jne 0x10054a96
call esi
mov dword [eax], 0
mov edx, dword [ebp + 0x40]
mov eax, dword [ebp + 0x44]
push edx
push 0x4000
push 1
push eax
call ebx
add esp, 0x10
test eax, eax
mov dword [ebp + 4], eax
jne 0x10054a90
mov ecx, dword [ebp + 0x40]
mov dword [ebp + 0x3c], 1
test byte [ecx + 0xc], 0x20
jne 0x10054bf0
mov edx, dword [ebp + 0x44]
mov dword [ebp], edx
mov ecx, dword [ebp + 0x64]
mov eax, dword [ebp + 4]
mov edx, dword [ebp + 0x68]
add ecx, eax
mov dword [ebp + 0x64], ecx
mov ecx, dword [ebp + 0x10]
add edx, ecx
push 0
push ebp
mov dword [ebp + 0x68], edx
call fcn.10056c90
mov edx, dword [ebp + 4]
mov ecx, dword [ebp + 0x64]
sub ecx, edx
mov edx, dword [ebp + 0x68]
mov dword [ebp + 0x64], ecx
mov ecx, dword [ebp + 0x10]
sub edx, ecx
add esp, 8
cmp eax, 1
mov dword [ebp + 0x38], eax
mov dword [ebp + 0x68], edx
jne 0x10054b2a
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp + 0x4c]
sub edx, edi
push edx
push edi
push eax
call fcn.10056a20
mov edi, dword [ebp + 0xc]
mov dword [ebp + 0x4c], eax
add esp, 0xc
mov eax, ebp
call fcn.10054650
cmp eax, dword [ebp + 0x4c]
jne 0x10054b50
mov eax, ebp
call fcn.10054650
mov eax, ebp
call fcn.100542c0
mov eax, dword [ebp + 0x38]
test eax, eax
jne 0x10054bf7
push ebp
call fcn.10056a40
push 0
push 0
push 0
call fcn.10056a20
add esp, 0x10
mov dword [ebp + 0x4c], eax
mov eax, dword [ebp + 0x38]
test eax, eax
jne 0x10054bf7
mov eax, dword [ebp + 0x3c]
test eax, eax
jne 0x10054bf7
mov eax, dword [ebp + 0x10]
test eax, eax
jne 0x10054a40
jmp 0x10054bf7
mov dword [ebp + 0x38], 0xfffffffd
jmp 0x10054bf7
mov eax, dword [ebp + 4]
mov ecx, dword [ebp + 0x10]
cmp eax, ecx
jbe 0x10054b68
mov eax, ecx
test eax, eax
jbe 0x10054ba7
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 + 0x18]
mov esi, dword [ebp]
mov edx, dword [ebp + 0x10]
add ecx, eax
mov dword [esp + 0x18], 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 0x10054bc7
mov ecx, dword [ebp + 0x40]
mov edx, dword [esp + 0x18]
push ecx
push eax
push 1
push edx
call ebx
mov ecx, dword [ebp + 0x10]
add esp, 0x10
sub ecx, eax
mov dword [ebp + 0x10], ecx
mov eax, dword [esp + 0x1c]
mov edi, dword [ebp + 0x10]
mov esi, dword [ebp + 0x64]
mov edx, dword [ebp + 0x68]
sub eax, edi
add esi, eax
add edx, eax
test eax, eax
mov dword [ebp + 0x64], esi
mov dword [ebp + 0x68], edx
jne 0x10054beb
mov dword [ebp + 0x3c], 1
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ebp + 0x38], 0xffffffff
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 0x4c]
sub eax, edi
push eax
push edi
push ecx
call fcn.10056a20
mov ecx, dword [ebp + 0x10]
mov dword [ebp + 0x4c], eax
mov eax, dword [esp + 0x28]
add esp, 0xc
cmp eax, ecx
jne 0x10054c2d
mov ebp, dword [ebp + 0x38]
cmp ebp, 0xfffffffd
je 0x10054c25
cmp ebp, 0xffffffff
jne 0x10054c2d
pop ebx
pop esi
pop edi
or eax, 0xffffffff
pop ebp
ret
pop ebx
pop esi
pop edi
sub eax, ecx
pop ebp
ret
pop edi
or eax, 0xffffffff
pop ebp
ret
pop edi
mov eax, 0xfffffffe
pop ebp
ret