Function at 0x581780
Capabilities:
Get file size
Read file on windows

Disassembly:
sub esp, 0x24
push ebx
push ebp
mov ebp, dword [esp + 0x38]
push esi
lea ebx, [eax + 0xccc]
mov eax, dword [eax]
push ebp
push eax
mov dword [esp + 0x24], ebx
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x5817c1
push 0x5caac0
mov eax, 0x5caac0
call fcn.00583d30
add esp, 4
xor eax, eax
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
mov esi, dword [esp + 0x34]
xor edx, edx
xor ecx, ecx
add esi, 8
mov dword [esp + 0x28], ecx
mov dword [esp + 0x2c], edx
mov dword [esp + 0xc], edx
mov dword [esp + 0x14], esi
lea esp, [esp]
mov eax, dword [esp + 0xc]
cmp eax, dword [esp + 0x38]
jne 0x5817f4
mov eax, dword [ebp]
sub eax, ecx
mov ecx, dword [ebp + 4]
jmp 0x5817fc
mov eax, dword [esi - 8]
sub eax, ecx
mov ecx, dword [esi - 4]
sbb ecx, edx
mov edx, eax
shrd edx, ecx, 0xf
shr ecx, 0xf
and eax, 0x7fff
mov dword [esp + 0x10], edx
mov ebp, eax
jne 0x58181b
mov ebp, 0x8000
jmp 0x581820
inc edx
mov dword [esp + 0x10], edx
test edx, edx
jbe 0x5818d0
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x18]
push 0
push 0
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x5817a6
mov edx, dword [esp + 0x18]
push 0
lea ecx, [esp + 0x24]
push ecx
push ebp
push ebx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x5817a6
cmp ebp, dword [esp + 0x20]
jne 0x58194f
mov eax, fcn.00580010
test eax, eax
je 0x5818b7
mov esi, dword [edi + 0x20]
and esi, 0x3f
mov eax, ebp
test ebp, ebp
jbe 0x5818af
mov cl, byte [ebx]
mov byte [edi + esi + 0x28], cl
inc esi
inc ebx
add dword [edi + 0x20], 1
adc dword [edi + 0x24], 0
dec eax
mov dword [esp + 0x24], eax
cmp esi, 0x40
jne 0x5818ab
mov edx, edi
xor esi, esi
call fcn.00582f20
mov eax, dword [esp + 0x24]
test eax, eax
ja 0x581884
mov esi, dword [esp + 0x14]
mov ebx, dword [esp + 0x1c]
add dword [esp + 0x28], ebp
mov ebp, 0x8000
adc dword [esp + 0x2c], 0
sub dword [esp + 0x10], 1
jne 0x581828
mov edx, dword [esp + 0xc]
cmp edx, dword [esp + 0x38]
jae 0x581928
mov eax, dword [esi]
test eax, eax
je 0x5819a0
mov ecx, fcn.00580010
test ecx, ecx
je 0x581914
cmp dword [esi + 4], 0
je 0x581914
cmp eax, 0x8000
ja 0x58196a
push eax
push 0
push ebx
call fcn.0058e300
mov edx, dword [esi]
add esp, 0xc
push edx
push ebx
push edi
call fcn.00580010
test eax, eax
je 0x581985
mov eax, dword [esi]
xor ecx, ecx
add eax, dword [esi - 8]
mov dword [esp + 0x28], eax
mov eax, dword [esi - 4]
adc eax, ecx
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0xc]
inc eax
add esi, 0x18
mov dword [esp + 0xc], eax
mov dword [esp + 0x14], esi
cmp eax, dword [esp + 0x38]
ja 0x5819a0
mov ebp, dword [esp + 0x3c]
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x2c]
jmp 0x5817e0
mov eax, 1
push 0x5caac0
call fcn.00583da0
add esp, 4
xor eax, eax
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
mov eax, 8
push 0x5caac0
call fcn.00583da0
add esp, 4
xor eax, eax
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
mov eax, 0x11
push 0x5caac0
call fcn.00583da0
add esp, 4
xor eax, eax
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x24
ret