Function at 0x5be560
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x1c
push ebx
push ebp
push esi
push edi
xor edi, edi
mov esi, ecx
lea eax, [esp + 0x10]
push edi
mov edx, dword [esi + 0x28]
mov ebp, 8
push eax
lea ecx, [esp + 0x24]
push ebp
push ecx
push edx
mov dword [esp + 0x24], edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x5be7bd
cmp dword [esp + 0x10], ebp
jne 0x5be7bd
mov ebx, dword [esi + 0x30]
mov eax, dword [esp + 0x1c]
add ebx, ebp
push eax
mov dword [esi + 0x30], ebx
mov edx, dword [esi + 0x34]
adc edx, edi
mov dword [esi + 0x34], edx
call sub.WS2_32.dll_ntohl
cdq
mov edi, eax
mov ebx, edx
cmp edi, 1
jne 0x5be658
test ebx, ebx
jne 0x5be658
mov eax, dword [esi + 0x28]
lea ecx, [esp + 0x10]
push edx
push ecx
lea edx, [esp + 0x1c]
push ebp
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x5be649
cmp dword [esp + 0x10], ebp
jne 0x5be649
mov ebx, dword [esi + 0x30]
mov ecx, dword [esp + 0x14]
add ebx, ebp
push ecx
mov dword [esi + 0x30], ebx
mov edi, dword [esi + 0x34]
adc edi, 0
mov dword [esi + 0x34], edi
call sub.WS2_32.dll_ntohl
mov edx, dword [esp + 0x18]
mov ebp, eax
push edx
call sub.WS2_32.dll_ntohl
cdq
mov edi, eax
mov eax, ebp
mov ebx, edx
push 1
cdq
push 0
push edx
push eax
call fcn.005e9a70
add edi, eax
adc ebx, edx
test ebx, ebx
jg 0x5be644
jl 0x5be635
cmp edi, 0x10
jae 0x5be644
pop edi
pop esi
pop ebp
mov eax, 0xfffffffa
pop ebx
add esp, 0x1c
ret 8
add edi, 0xfffffff0
jmp 0x5be68e
pop edi
pop esi
pop ebp
mov eax, 0xfffffffb
pop ebx
add esp, 0x1c
ret 8
test edi, edi
jne 0x5be672
test ebx, ebx
jne 0x5be674
mov edi, dword [esi + 0x20]
mov ecx, dword [esi + 0x30]
mov ebx, dword [esi + 0x24]
mov eax, dword [esi + 0x34]
sub edi, ecx
sbb ebx, eax
jmp 0x5be691
test ebx, ebx
jg 0x5be68b
jl 0x5be67c
cmp edi, ebp
jae 0x5be68b
pop edi
pop esi
pop ebp
mov eax, 0xfffffff9
pop ebx
add esp, 0x1c
ret 8
add edi, 0xfffffff8
adc ebx, 0xffffffff
lea ecx, [esp + 0x20]
mov eax, str.sidx
mov edx, dword [ecx]
mov ecx, dword [eax]
cmp edx, ecx
jne 0x5be75c
mov ecx, dword [esp + 0x34]
xor eax, eax
cmp ebx, eax
jl 0x5be6c5
jg 0x5be6b6
cmp edi, ecx
jbe 0x5be6c5
pop edi
pop esi
pop ebp
mov eax, 0xfffffff8
pop ebx
add esp, 0x1c
ret 8
test ebx, ebx
jg 0x5be6df
jl 0x5be6d0
cmp edi, 0x18
jae 0x5be6df
pop edi
pop esi
pop ebp
mov eax, 0xfffffff4
pop ebx
add esp, 0x1c
ret 8
mov ebp, dword [esp + 0x30]
mov ecx, dword [esi + 0x28]
lea eax, [esp + 0x10]
push 0
push eax
push edi
push ebp
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x5be74d
mov eax, dword [esp + 0x10]
cmp eax, edi
jne 0x5be74d
push eax
push ebp
mov ecx, esi
call fcn.005be7d0
cmp eax, 1
jne 0x5be7c2
mov edx, dword [esi + 0x30]
mov ecx, dword [esi + 0x34]
mov ebp, dword [esi + 0x10]
add edx, edi
adc ecx, ebx
add ebp, edx
mov edi, dword [esi + 0x18]
mov dword [esi + 0x10], ebp
mov ebx, dword [esi + 0x14]
adc ebx, ecx
mov dword [esi + 0x14], ebx
mov edx, dword [esi + 0x10]
add edi, edx
mov ecx, ebx
mov dword [esi + 0x18], edi
mov edx, dword [esi + 0x1c]
adc edx, ecx
pop edi
mov dword [esi + 0x1c], edx
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 8
pop edi
pop esi
pop ebp
mov eax, 0xfffffff7
pop ebx
add esp, 0x1c
ret 8
mov eax, dword [esi + 0x30]
mov edx, dword [esi + 0x34]
add eax, edi
lea ecx, [esp + 0x28]
adc edx, ebx
push 0
mov dword [esp + 0x2c], edx
mov edx, dword [esi + 0x28]
push ecx
push eax
push edx
mov dword [esp + 0x34], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x5be79e
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x5be79e
pop edi
pop esi
pop ebp
mov eax, 0xfffffff6
pop ebx
add esp, 0x1c
ret 8
mov ecx, dword [esi + 0x30]
add ecx, edi
pop edi
mov dword [esi + 0x30], ecx
mov eax, dword [esi + 0x34]
adc eax, ebx
mov dword [esi + 0x34], eax
pop esi
pop ebp
mov eax, 0xfffffff5
pop ebx
add esp, 0x1c
ret 8
mov eax, 0xfffffffc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret 8