Function at 0x578100
Capabilities:
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x24
push ebx
push ebp
push esi
xor esi, esi
push edi
mov ebx, ecx
lea eax, [esp + 0x10]
push esi
mov edx, dword [ebx + 0xd4]
mov edi, 8
push eax
lea ecx, [esp + 0x2c]
push edi
push ecx
push edx
mov dword [esp + 0x24], esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x578433
cmp dword [esp + 0x10], edi
jne 0x578433
mov ebp, dword [ebx + 0x68]
mov eax, dword [esp + 0x24]
add ebp, edi
push eax
mov dword [ebx + 0x68], ebp
mov edx, dword [ebx + 0x6c]
adc edx, esi
mov dword [ebx + 0x6c], edx
call sub.WS2_32.dll_ntohl
cdq
mov ebp, eax
mov esi, edx
cmp ebp, 1
jne 0x5781f6
test esi, esi
jne 0x5781f6
mov eax, dword [ebx + 0xd4]
lea ecx, [esp + 0x10]
push edx
push ecx
lea edx, [esp + 0x34]
push edi
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x578433
cmp dword [esp + 0x10], edi
jne 0x578433
mov edx, dword [ebx + 0x68]
add edx, edi
mov dword [ebx + 0x68], edx
mov ecx, dword [ebx + 0x6c]
adc ecx, esi
mov dword [ebx + 0x6c], ecx
mov ecx, dword [esp + 0x2c]
push ecx
call sub.WS2_32.dll_ntohl
mov edx, dword [esp + 0x30]
mov edi, eax
push edx
call sub.WS2_32.dll_ntohl
cdq
mov ebp, eax
mov eax, edi
mov esi, edx
push 1
cdq
push 0
push edx
push eax
call fcn.005c5810
add ebp, eax
adc esi, edx
test esi, esi
jg 0x5781ea
jl 0x578433
cmp ebp, 0x10
jb 0x578433
add ebp, 0xfffffff0
adc esi, 0xffffffff
mov dword [esp + 0x20], esi
jmp 0x578232
test ebp, ebp
jne 0x578216
test esi, esi
jne 0x578218
mov ebp, dword [ebx + 0x60]
mov edx, dword [ebx + 0x68]
mov eax, dword [ebx + 0x64]
mov ecx, dword [ebx + 0x6c]
sub ebp, edx
sbb eax, ecx
mov dword [esp + 0x20], eax
mov esi, eax
jmp 0x578232
test esi, esi
jg 0x578228
jl 0x578433
cmp ebp, edi
jb 0x578433
add ebp, 0xfffffff8
adc esi, 0xffffffff
mov dword [esp + 0x20], esi
lea ecx, [esp + 0x28]
mov eax, str.moof
mov edx, dword [ecx]
mov ecx, dword [eax]
cmp edx, ecx
jne 0x57828a
mov edi, dword [esp + 0x3c]
mov ecx, dword [ebx + 0xd4]
lea eax, [esp + 0x10]
push 0
push eax
push ebp
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x578433
mov ecx, dword [esp + 0x10]
cmp ecx, ebp
jne 0x578433
mov eax, dword [esp + 0x44]
mov edx, dword [eax + 4]
mov eax, dword [eax]
push edx
push eax
push ecx
push edi
mov ecx, ebx
call fcn.00578440
jmp 0x5783de
lea edx, [esp + 0x28]
mov ecx, str.mdat
mov eax, dword [edx]
mov edx, dword [ecx]
cmp eax, edx
jne 0x578370
mov edi, dword [esp + 0x44]
xor edx, edx
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], edx
mov ecx, ebp
mov eax, esi
mov esi, dword [esp + 0x18]
sub ecx, edx
sbb eax, esi
xor esi, esi
cmp eax, esi
jg 0x5782cd
jl 0x5782c7
cmp ecx, dword [esp + 0x40]
jae 0x5782cd
mov esi, ebp
sub esi, edx
jmp 0x5782d1
mov esi, dword [esp + 0x40]
mov edx, dword [esp + 0x3c]
mov eax, dword [ebx + 0xd4]
lea ecx, [esp + 0x10]
push 0
push ecx
push esi
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x578433
mov eax, dword [esp + 0x10]
cmp eax, esi
jne 0x578433
mov edx, dword [esp + 0x3c]
lea ecx, [esp + 0x44]
push 0
push ecx
push eax
mov eax, dword [esp + 0x44]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x578433
mov ecx, dword [esp + 0x44]
mov eax, dword [esp + 0x10]
cmp eax, ecx
jne 0x578433
mov esi, dword [edi]
xor eax, eax
add esi, ecx
mov dword [edi], esi
mov edx, dword [edi + 4]
mov esi, dword [esp + 0x14]
adc edx, eax
add esi, ecx
mov ecx, dword [esp + 0x18]
mov dword [edi + 4], edx
adc ecx, eax
mov eax, dword [esp + 0x20]
cmp ecx, eax
mov dword [esp + 0x14], esi
mov dword [esp + 0x18], ecx
jg 0x5783da
jl 0x578363
mov eax, esi
cmp eax, ebp
jae 0x5783da
mov edx, dword [esp + 0x14]
mov esi, dword [esp + 0x20]
jmp 0x5782ad
lea edx, [esp + 0x28]
mov ecx, str.moov
mov eax, dword [edx]
mov edx, dword [ecx]
cmp eax, edx
jne 0x5783fd
mov esi, dword [esp + 0x3c]
mov edx, dword [ebx + 0xd4]
lea ecx, [esp + 0x10]
push 0
push ecx
push ebp
push esi
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x578433
mov eax, dword [esp + 0x10]
cmp eax, ebp
jne 0x578433
push eax
call fcn.005db95d
add esp, 4
mov dword [ebx + 0x14], eax
test eax, eax
je 0x578433
mov ecx, dword [esp + 0x10]
mov edi, eax
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x10]
mov dword [ebx + 0x18], ecx
mov esi, dword [esp + 0x20]
mov ecx, dword [ebx + 0x68]
pop edi
add ecx, ebp
mov dword [ebx + 0x68], ecx
mov eax, dword [ebx + 0x6c]
adc eax, esi
pop esi
mov dword [ebx + 0x6c], eax
pop ebp
mov eax, 1
pop ebx
add esp, 0x24
ret 0x10
mov eax, dword [ebx + 0x68]
mov edx, dword [ebx + 0x6c]
add eax, ebp
lea ecx, [esp + 0x20]
adc edx, esi
push 0
mov dword [esp + 0x24], edx
mov edx, dword [ebx + 0xd4]
push ecx
push eax
push edx
mov dword [esp + 0x2c], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x5783de
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x5783de
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret 0x10