Function at 0x596c80
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 0x5970c1
cmp dword [esp + 0x10], ebp
jne 0x5970c1
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 0x596d80
test esi, esi
jne 0x596d80
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 0x5970c1
cmp dword [esp + 0x10], esi
jne 0x5970c1
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.005e7a50
add ebp, eax
adc esi, edx
test esi, esi
jg 0x596d6e
jl 0x5970c1
cmp ebp, 0x10
jb 0x5970c1
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
add ebp, 0xfffffff0
adc esi, 0xffffffff
mov dword [esp + 0x18], esi
jmp 0x596dbd
test ebp, ebp
jne 0x596da0
test esi, esi
jne 0x596da2
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 0x596dbd
test esi, esi
jg 0x596db3
jl 0x5970c1
cmp ebp, 8
jb 0x5970c1
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 0x596e15
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 0x5970c1
mov ecx, dword [esp + 0x10]
cmp ecx, ebp
jne 0x5970c1
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.00597220
jmp 0x59706c
lea eax, [esp + 0x28]
mov edx, str.sidx
mov ecx, dword [eax]
mov eax, dword [edx]
cmp ecx, eax
jne 0x596e6d
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 0x5970c1
mov ecx, dword [esp + 0x10]
cmp ecx, ebp
jne 0x5970c1
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.005970d0
jmp 0x59706c
lea eax, [esp + 0x28]
mov edx, str.mdat
mov ecx, dword [eax]
mov eax, dword [edx]
cmp ecx, eax
jne 0x596f86
mov eax, dword [ebx + 0x8c]
xor edx, edx
cmp eax, edx
je 0x596eaf
cmp dword [ebx + 0x64], edx
jne 0x596eaf
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 0x5970a3
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 0x596edb
jl 0x596ed5
cmp ecx, dword [esp + 0x40]
jae 0x596edb
mov esi, ebp
sub esi, edx
jmp 0x596edf
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 0x5970c1
mov eax, dword [esp + 0x10]
cmp eax, esi
jne 0x5970c1
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 0x5970c1
mov ecx, dword [esp + 0x44]
mov eax, dword [esp + 0x10]
cmp eax, ecx
jne 0x5970c1
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 0x597068
jl 0x596f79
mov eax, esi
cmp eax, ebp
jae 0x597068
mov edx, dword [esp + 0x1c]
mov esi, dword [esp + 0x18]
jmp 0x596ebb
lea edx, [esp + 0x28]
mov ecx, str.moov
mov eax, dword [edx]
mov edx, dword [ecx]
cmp eax, edx
jne 0x59708b
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 0x5970c1
mov eax, dword [esp + 0x10]
cmp eax, ebp
jne 0x5970c1
push eax
call fcn.005fdccd
add esp, 4
mov dword [ebx + 0x1c], eax
test eax, eax
je 0x5970c1
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 0x597063
call fcn.00597ac0
mov eax, dword [ebx + 0x94]
test eax, eax
je 0x5970c1
mov edx, dword [esp + 0x10]
push edx
call fcn.005fdccd
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 0x5970c1
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.00597ac0
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 0x59706c
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x59706c
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret 0x10