Function at 0x40c7cd
Capabilities:
Read and send data from client to server
Read file on windows
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
push ecx
push ebx
push esi
mov esi, eax
xor ebx, ebx
push edi
cmp esi, ebx
jne 0x40c7f3
push 0x2ae
push 0x428f74
push 0x428fac
call fcn.00410334
add esp, 0xc
mov dword [esi + 0x34], 1
cmp dword [esi + 0x4518], ebx
je 0x40c80f
lea eax, [esi + 0x451c]
push eax
call fcn.0040ecd8
pop ecx
mov eax, dword [esi + 0x48]
imul eax, dword [esi + 0x54]
mov dword [esi + 0x40], ebx
mov dword [esi + 0x3c], ebx
mov dword [esi + 0x44f4], eax
cmp dword [esi + 0x3c], ebx
jbe 0x40c82d
mov eax, dword [esi + 0x2c]
mov dword [esi + 0x34], eax
cmp dword [esi + 0x2c], ebx
jbe 0x40c8fd
mov eax, dword [esi + 0x2c]
add eax, dword [esi + 0x54]
mov ecx, dword [esi + 0x30]
cmp eax, ecx
jae 0x40c845
mov ecx, eax
mov eax, dword [esi + 0x34]
cmp eax, ecx
ja 0x40c8fd
dec eax
imul eax, dword [esi + 0x48]
push ebx
push ebx
push eax
push dword [esi + 0x24]
lea edi, [esi + 0x60]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x40caa0
push 0
lea ebx, [esi + 0x38]
push ebx
push dword [esi + 0x48]
lea eax, [edi + 4]
push eax
push dword [esi + 0x24]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40ca9e
cmp dword [esi + 0x4518], 0
je 0x40c8af
cmp dword [esi + 0x40], 0
jne 0x40c8af
push dword [ebx]
lea eax, [edi + 4]
push eax
lea eax, [esi + 0x451c]
push eax
call fcn.0040f477
add esp, 0xc
push 3
call dword [sym.imp.WS2_32.dll_htons]
mov word [edi], ax
movzx eax, word [esi + 0x34]
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [edi + 2], ax
mov eax, dword [ebx]
push 0
add eax, 4
push eax
push edi
push dword [esi + 0x20]
call dword [sym.imp.WS2_32.dll_send]
test eax, eax
js 0x40cab4
mov ecx, dword [ebx]
add ecx, 4
cmp eax, ecx
jne 0x40cab4
inc dword [esi + 0x40]
inc dword [esi + 0x34]
xor ebx, ebx
jmp 0x40c836
call fcn.0040bc98
test eax, eax
je 0x40ca84
push ebx
push 0x204
lea edi, [esi + 0x4064]
push edi
push dword [esi + 0x20]
call dword [sym.imp.WS2_32.dll_recv]
cmp eax, ebx
jle 0x40cabd
cmp eax, 4
jae 0x40c93d
push 0x428fe0
push 1
call fcn.00407001
pop ecx
pop ecx
jmp 0x40c99b
movzx eax, word [edi]
mov ebx, dword [sym.imp.WS2_32.dll_ntohs]
push eax
call ebx
cmp ax, 5
je 0x40cac4
movzx eax, word [edi]
push eax
call ebx
cmp ax, 4
jne 0x40ca66
movzx eax, word [edi + 2]
push eax
call ebx
cmp ax, word [esi + 0x2c]
jne 0x40c9f5
mov eax, dword [esi + 0x3c]
add dword [esi + 0x44f8], eax
mov eax, dword [esi + 0x2c]
and dword [esi + 0x3c], 0
and dword [esi + 0x40], 0
test eax, eax
je 0x40c995
mov ecx, dword [esi + 0x38]
add dword [esi + 0x44f4], ecx
inc eax
mov dword [esi + 0x2c], eax
xor ebx, ebx
mov eax, dword [esi + 0x34]
cmp eax, dword [esi + 0x30]
mov eax, dword [0x429b3c]
jbe 0x40c9b5
cmp dword [0x429e28], ebx
jne 0x40c9c4
cmp dword [esi + 0x40], ebx
je 0x40c9c4
cmp dword [esi + 0x40], 0x32
jae 0x40c9ce
cmp dword [esi + 0x3c], eax
jb 0x40c822
cmp dword [esi + 0x40], 0x32
jb 0x40cadb
lea eax, [esi + 0x42ea]
push eax
movzx eax, word [esi + 0x2c]
push eax
push str.MAX_RETRIES_while_waiting_for_Ack_block__d._file___s_
push ebx
call fcn.00407001
push ebx
mov ebx, esi
call fcn.0040b99f
add esp, 0x14
jmp 0x40cad7
cmp dword [esi + 0x40], 3
jae 0x40ca2e
cmp dword [esi + 0x2c], 1
je 0x40ca2e
movzx eax, word [edi + 2]
push eax
call ebx
mov cx, word [esi + 0x2c]
dec cx
cmp ax, cx
jne 0x40ca2e
movzx eax, word [esi + 0x2c]
push 0
push eax
push str.Ack_block__d_ignored__received_twice_
push 1
call fcn.00407001
add esp, 0x10
jmp 0x40c999
cmp dword [esi + 0x28], 0
jne 0x40c999
mov eax, dword [esi + 0x2c]
mov dword [ebp - 4], eax
movzx eax, word [edi + 2]
push eax
call ebx
movzx eax, ax
cmp eax, dword [ebp - 4]
jbe 0x40c999
movzx eax, word [edi + 2]
push dword [ebp - 4]
push eax
call ebx
movzx eax, ax
push eax
push str.Ack_of_block__d_received__last_block_sent__d___
jmp 0x40ca1f
movzx eax, word [edi]
push eax
call ebx
movzx eax, ax
push eax
push str.ignore_unknown_opcode__d_received
push 2
call fcn.00407001
add esp, 0xc
jmp 0x40c999
push dword [esi + 0x2c]
push str.timeout_while_waiting_for_ack_blk__d
push 9
call fcn.00407001
add esp, 0xc
inc dword [esi + 0x3c]
jmp 0x40c99b
xor ebx, ebx
push str.ReadFile
push ebx
mov eax, esi
call fcn.0040bc5f
pop ecx
pop ecx
jmp 0x40cb3f
push 0x428fd0
push 0
jmp 0x40caa6
push 0x428fd8
jmp 0x40caa5
add edi, 4
push edi
push str.Peer_returns_ERROR___s_____aborting_transfer
push 1
call fcn.00407001
add esp, 0xc
xor eax, eax
jmp 0x40cb3f
mov ecx, dword [esi + 0x3c]
cmp ecx, eax
jb 0x40cb0e
mov edx, dword [esi + 0x34]
cmp edx, dword [esi + 0x30]
jbe 0x40cb44
lea eax, [esi + 0x42ea]
push eax
movzx eax, word [esi + 0x2c]
push eax
push str.WARNING_:_Last_block__d_not_acked_for_file___s_
push 1
call fcn.00407001
mov eax, dword [esi + 0x3c]
add esp, 0x10
add dword [esi + 0x44f8], eax
push dword [esi + 0x34]
push dword [esi + 0x2c]
push str.Count__d__Last_pkt__d
push 0xa
call fcn.00407001
add esp, 0x10
cmp dword [esi + 0x4518], ebx
je 0x40cb37
cmp dword [esi + 0x28], ebx
jne 0x40cb37
mov ecx, esi
call fcn.0040ba8a
call fcn.0040c5db
xor eax, eax
inc eax
pop edi
pop esi
pop ebx
leave
ret
cmp ecx, eax
jb 0x40cb0e
push dword [esi + 0x2c]
push str.TIMEOUT_waiting_for_Ack_block__d
push 1
call fcn.00407001
push ebx
mov ebx, esi
call fcn.0040b99f
add esp, 0x10
jmp 0x40cad7