Function at 0x5904c0
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 0x590901
cmp dword [esp + 0x10], ebp
jne 0x590901
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 0x5905c0
test esi, esi
jne 0x5905c0
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 0x590901
cmp dword [esp + 0x10], esi
jne 0x590901
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.005e09d0
add ebp, eax
adc esi, edx
test esi, esi
jg 0x5905ae
jl 0x590901
cmp ebp, 0x10
jb 0x590901
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
add ebp, 0xfffffff0
adc esi, 0xffffffff
mov dword [esp + 0x18], esi
jmp 0x5905fd
test ebp, ebp
jne 0x5905e0
test esi, esi
jne 0x5905e2
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 0x5905fd
test esi, esi
jg 0x5905f3
jl 0x590901
cmp ebp, 8
jb 0x590901
add ebp, 0xfffffff8
adc esi, 0xffffffff
mov dword [esp + 0x18], esi
lea ecx, [esp + 0x28]
mov eax, 0x6de268
mov edx, dword [ecx]
mov ecx, dword [eax]
cmp edx, ecx
jne 0x590655
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 0x590901
mov ecx, dword [esp + 0x10]
cmp ecx, ebp
jne 0x590901
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.00590a60
jmp 0x5908ac
lea eax, [esp + 0x28]
mov edx, 0x6de260
mov ecx, dword [eax]
mov eax, dword [edx]
cmp ecx, eax
jne 0x5906ad
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 0x590901
mov ecx, dword [esp + 0x10]
cmp ecx, ebp
jne 0x590901
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.00590910
jmp 0x5908ac
lea eax, [esp + 0x28]
mov edx, 0x6d8bdc
mov ecx, dword [eax]
mov eax, dword [edx]
cmp ecx, eax
jne 0x5907c6
mov eax, dword [ebx + 0x8c]
xor edx, edx
cmp eax, edx
je 0x5906ef
cmp dword [ebx + 0x64], edx
jne 0x5906ef
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 0x5908e3
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 0x59071b
jl 0x590715
cmp ecx, dword [esp + 0x40]
jae 0x59071b
mov esi, ebp
sub esi, edx
jmp 0x59071f
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 0x590901
mov eax, dword [esp + 0x10]
cmp eax, esi
jne 0x590901
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 0x590901
mov ecx, dword [esp + 0x44]
mov eax, dword [esp + 0x10]
cmp eax, ecx
jne 0x590901
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 0x5908a8
jl 0x5907b9
mov eax, esi
cmp eax, ebp
jae 0x5908a8
mov edx, dword [esp + 0x1c]
mov esi, dword [esp + 0x18]
jmp 0x5906fb
lea edx, [esp + 0x28]
mov ecx, 0x6de258
mov eax, dword [edx]
mov edx, dword [ecx]
cmp eax, edx
jne 0x5908cb
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 0x590901
mov eax, dword [esp + 0x10]
cmp eax, ebp
jne 0x590901
push eax
call fcn.005f6c5c
add esp, 4
mov dword [ebx + 0x1c], eax
test eax, eax
je 0x590901
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 0x5908a3
call fcn.00591300
mov eax, dword [ebx + 0x94]
test eax, eax
je 0x590901
mov edx, dword [esp + 0x10]
push edx
call fcn.005f6c5c
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 0x590901
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.00591300
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 0x5908ac
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x5908ac
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret 0x10