Function at 0x598dc0
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 edi, dword [sym.imp.KERNEL32.dll_ReadFile]
mov ebx, ecx
lea eax, [esp + 0x10]
push esi
mov ebp, 8
mov edx, dword [ebx + 0x100]
push eax
lea ecx, [esp + 0x2c]
push ebp
push ecx
push edx
mov dword [esp + 0x24], esi
call edi
test eax, eax
je 0x599201
cmp dword [esp + 0x10], ebp
jne 0x599201
mov eax, dword [ebx + 0x70]
add eax, ebp
mov dword [ebx + 0x70], eax
mov edx, dword [ebx + 0x74]
mov eax, dword [esp + 0x24]
adc edx, esi
push eax
mov dword [ebx + 0x74], edx
call sub.WS2_32.dll_ntohl
cdq
mov ebp, eax
mov esi, edx
cmp ebp, 1
jne 0x598ec0
test esi, esi
jne 0x598ec0
mov eax, dword [ebx + 0x100]
lea ecx, [esp + 0x10]
push edx
mov esi, 8
push ecx
lea edx, [esp + 0x34]
push esi
push edx
push eax
call edi
test eax, eax
je 0x599201
cmp dword [esp + 0x10], esi
jne 0x599201
mov edx, dword [ebx + 0x70]
add edx, esi
mov dword [ebx + 0x70], edx
mov ecx, dword [ebx + 0x74]
adc ecx, 0
mov dword [ebx + 0x74], 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.005e9a70
add ebp, eax
adc esi, edx
test esi, esi
jg 0x598eae
jl 0x599201
cmp ebp, 0x10
jb 0x599201
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
add ebp, 0xfffffff0
adc esi, 0xffffffff
mov dword [esp + 0x18], esi
jmp 0x598efd
test ebp, ebp
jne 0x598ee0
test esi, esi
jne 0x598ee2
mov ebp, dword [ebx + 0x68]
mov edx, dword [ebx + 0x70]
mov eax, dword [ebx + 0x6c]
mov ecx, dword [ebx + 0x74]
sub ebp, edx
sbb eax, ecx
mov dword [esp + 0x18], eax
mov esi, eax
jmp 0x598efd
test esi, esi
jg 0x598ef3
jl 0x599201
cmp ebp, 8
jb 0x599201
add ebp, 0xfffffff8
adc esi, 0xffffffff
mov dword [esp + 0x18], esi
lea ecx, [esp + 0x28]
mov eax, str.moof
mov edx, dword [ecx]
mov ecx, dword [eax]
cmp edx, ecx
jne 0x598f55
mov ecx, dword [esp + 0x3c]
mov edx, dword [ebx + 0x100]
lea eax, [esp + 0x10]
push 0
push eax
push ebp
push ecx
push edx
call edi
test eax, eax
je 0x599201
mov ecx, dword [esp + 0x10]
cmp ecx, ebp
jne 0x599201
mov eax, dword [esp + 0x44]
mov edx, dword [eax + 4]
mov eax, dword [eax]
push edx
push eax
push ecx
mov ecx, dword [esp + 0x48]
push ecx
mov ecx, ebx
call fcn.00599360
jmp 0x5991ac
lea eax, [esp + 0x28]
mov edx, str.sidx
mov ecx, dword [eax]
mov eax, dword [edx]
cmp ecx, eax
jne 0x598fad
mov eax, dword [esp + 0x3c]
mov ecx, dword [ebx + 0x100]
lea edx, [esp + 0x10]
push 0
push edx
push ebp
push eax
push ecx
call edi
test eax, eax
je 0x599201
mov ecx, dword [esp + 0x10]
cmp ecx, ebp
jne 0x599201
mov eax, dword [esp + 0x44]
mov edx, dword [eax + 4]
mov eax, dword [eax]
push edx
push eax
push ecx
mov ecx, dword [esp + 0x48]
push ecx
mov ecx, ebx
call fcn.00599210
jmp 0x5991ac
lea eax, [esp + 0x28]
mov edx, str.mdat
mov ecx, dword [eax]
mov eax, dword [edx]
cmp ecx, eax
jne 0x5990c6
mov eax, dword [ebx + 0x8c]
xor edx, edx
cmp eax, edx
je 0x598fef
cmp dword [ebx + 0x64], edx
jne 0x598fef
mov eax, dword [ebx + 0x70]
mov ecx, dword [ebx + 0x74]
add eax, ebp
push edx
adc ecx, esi
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], ecx
lea edx, [esp + 0x24]
jmp 0x5991e3
mov edi, dword [esp + 0x44]
mov dword [esp + 0x1c], edx
mov dword [esp + 0x20], edx
mov ecx, ebp
mov eax, esi
mov esi, dword [esp + 0x20]
sub ecx, edx
sbb eax, esi
xor esi, esi
cmp eax, esi
jg 0x59901b
jl 0x599015
cmp ecx, dword [esp + 0x40]
jae 0x59901b
mov esi, ebp
sub esi, edx
jmp 0x59901f
mov esi, dword [esp + 0x40]
mov edx, dword [esp + 0x3c]
mov eax, dword [ebx + 0x100]
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 0x599201
mov eax, dword [esp + 0x10]
cmp eax, esi
jne 0x599201
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 0x599201
mov ecx, dword [esp + 0x44]
mov eax, dword [esp + 0x10]
cmp eax, ecx
jne 0x599201
mov esi, dword [edi]
xor eax, eax
add esi, ecx
mov dword [edi], esi
mov edx, dword [edi + 4]
mov esi, dword [esp + 0x1c]
adc edx, eax
add esi, ecx
mov ecx, dword [esp + 0x20]
mov dword [edi + 4], edx
adc ecx, eax
mov eax, dword [esp + 0x18]
cmp ecx, eax
mov dword [esp + 0x1c], esi
mov dword [esp + 0x20], ecx
jg 0x5991a8
jl 0x5990b9
mov eax, esi
cmp eax, ebp
jae 0x5991a8
mov edx, dword [esp + 0x1c]
mov esi, dword [esp + 0x18]
jmp 0x598ffb
lea edx, [esp + 0x28]
mov ecx, str.moov
mov eax, dword [edx]
mov edx, dword [ecx]
cmp eax, edx
jne 0x5991cb
mov esi, dword [esp + 0x3c]
mov edx, dword [ebx + 0x100]
lea ecx, [esp + 0x10]
push 0
push ecx
push ebp
push esi
push edx
call edi
test eax, eax
je 0x599201
mov eax, dword [esp + 0x10]
cmp eax, ebp
jne 0x599201
push eax
call fcn.005ffe3f
add esp, 4
mov dword [ebx + 0x1c], eax
test eax, eax
je 0x599201
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 eax, dword [ebx + 0x8c]
mov dword [ebx + 0x20], ecx
mov ecx, ebx
test eax, eax
je 0x5991a3
call fcn.00599c00
mov eax, dword [ebx + 0x94]
test eax, eax
je 0x599201
mov edx, dword [esp + 0x10]
push edx
call fcn.005ffe3f
mov ecx, dword [ebx + 0x94]
add esp, 4
mov dword [ecx + 0x1c], eax
mov edx, dword [ebx + 0x94]
mov edi, dword [edx + 0x1c]
test edi, edi
je 0x599201
mov ecx, dword [esp + 0x10]
mov esi, dword [esp + 0x3c]
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 [ebx + 0x94]
mov edx, dword [esp + 0x10]
mov dword [ecx + 0x20], edx
mov ecx, dword [ebx + 0x94]
call fcn.00599c00
mov esi, dword [esp + 0x18]
mov ecx, dword [ebx + 0x70]
pop edi
add ecx, ebp
mov dword [ebx + 0x70], ecx
mov eax, dword [ebx + 0x74]
adc eax, esi
pop esi
mov dword [ebx + 0x74], eax
pop ebp
mov eax, 1
pop ebx
add esp, 0x24
ret 0x10
mov eax, dword [ebx + 0x70]
mov ecx, dword [ebx + 0x74]
add eax, ebp
push 0
adc ecx, esi
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], ecx
lea edx, [esp + 0x24]
push edx
push eax
mov eax, dword [ebx + 0x100]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x5991ac
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x5991ac
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret 0x10