Function at 0x406750
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 ebx
mov ebx, dword [esp + 8]
push ebp
mov ebp, dword [ebx + 0x10]
push esi
xor esi, esi
cmp dword [ebx + 0x4494], esi
push edi
mov dword [esp + 0x14], ebp
mov dword [ebx + 0x30], 1
je 0x40677f
lea eax, [ebx + 0x4498]
push eax
call fcn.00403860
add esp, 4
mov dword [ebx + 0x3c], esi
mov dword [ebx + 0x38], esi
cmp dword [ebx + 0x38], 0
jbe 0x406791
mov ecx, dword [ebx + 0x28]
mov dword [ebx + 0x30], ecx
cmp dword [ebx + 0x28], 0
jbe 0x406887
jmp 0x4067a0
mov edx, dword [ebx + 0x4c]
mov eax, dword [ebx + 0x28]
mov ecx, dword [ebx + 0x2c]
add eax, edx
cmp eax, ecx
jae 0x4067b1
mov ecx, eax
mov eax, dword [ebx + 0x30]
cmp eax, ecx
ja 0x406887
mov ecx, dword [ebx + 0x1c]
add eax, 0xffffffff
imul eax, dword [ebx + 0x40]
push 0
push 0
push eax
push ecx
lea esi, [ebx + 0x58]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x406a6d
mov edx, dword [ebx + 0x40]
mov eax, dword [ebx + 0x1c]
push 0
lea edi, [ebx + 0x34]
push edi
push edx
lea ebp, [esi + 4]
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x406a6d
cmp dword [ebx + 0x4494], 0
je 0x40681a
mov ecx, dword [edi]
push ecx
lea edx, [ebx + 0x4498]
push ebp
push edx
call fcn.00403f60
add esp, 0xc
push 3
call sub.WSOCK32.dll_htons
mov word [esi], ax
movzx eax, word [ebx + 0x30]
push eax
call sub.WSOCK32.dll_htons
push ebx
mov word [esi + 2], ax
call fcn.00408ff0
add esp, 4
cmp dword [ebx + 0x24], 0
je 0x40684c
push ebx
call fcn.004053a0
add esp, 4
jmp 0x40685e
mov ecx, dword [edi]
mov edx, dword [ebx + 0x18]
push 0
add ecx, 4
push ecx
push esi
push edx
call sub.WSOCK32.dll_send
test eax, eax
jl 0x406a83
mov ecx, dword [edi]
add ecx, 4
cmp eax, ecx
jne 0x406a83
mov ebp, dword [esp + 0x14]
mov eax, 1
add dword [ebx + 0x3c], eax
add dword [ebx + 0x30], eax
jmp 0x4067a0
mov edi, ebx
call fcn.00405e90
test eax, eax
je 0x4069f7
mov edx, dword [ebx + 0x18]
xor edi, edi
push edi
push 0x204
lea esi, [ebx + 0x405c]
push esi
push edx
call sub.WSOCK32.dll_recv
cmp eax, edi
jle 0x406a99
cmp eax, 4
jae 0x4068d7
mov eax, dword [ebx + 0x4474]
push str.rcvd_packet_too_short
push eax
push ebp
push 1
call fcn.004098c0
add esp, 0x10
jmp 0x406a16
movzx ecx, word [esi]
push ecx
call sub.WSOCK32.dll_ntohs
cmp ax, 5
je 0x406aae
movzx edx, word [esi]
push edx
call sub.WSOCK32.dll_ntohs
cmp ax, 4
jne 0x4069d1
push ebx
call fcn.00408ff0
movzx eax, word [esi + 2]
add esp, 4
push eax
call sub.WSOCK32.dll_ntohs
cmp ax, word [ebx + 0x28]
jne 0x406947
mov ecx, dword [ebx + 0x38]
mov eax, dword [ebx + 0x28]
add dword [ebx + 0x447c], ecx
cmp eax, edi
mov dword [ebx + 0x38], edi
mov dword [ebx + 0x3c], edi
je 0x406935
mov edx, dword [ebx + 0x34]
add dword [ebx + 0x4478], edx
add eax, 1
mov esi, ebx
mov dword [ebx + 0x28], eax
call fcn.00405430
jmp 0x406a16
cmp dword [ebx + 0x3c], 3
jae 0x40698c
cmp dword [ebx + 0x28], 1
je 0x40698c
movzx eax, word [esi + 2]
push eax
call sub.WSOCK32.dll_ntohs
mov cx, word [ebx + 0x28]
sub cx, 1
cmp ax, cx
jne 0x40698c
movzx edx, word [ebx + 0x28]
mov eax, dword [ebx + 0x4474]
push edi
push edx
push str.Ack_block__d_ignored__received_twice_
push eax
push ebp
push 1
call fcn.004098c0
add esp, 0x18
jmp 0x406a16
cmp dword [ebx + 0x24], edi
jne 0x406a16
movzx ecx, word [esi + 2]
mov edi, dword [ebx + 0x28]
push ecx
call sub.WSOCK32.dll_ntohs
movzx edx, ax
cmp edx, edi
jbe 0x406a16
movzx eax, word [esi + 2]
push edi
push eax
call sub.WSOCK32.dll_ntohs
mov edx, dword [ebx + 0x4474]
movzx ecx, ax
push ecx
push str.Ack_of_block__d_received__last_block_sent__d___
push edx
push ebp
push 1
call fcn.004098c0
add esp, 0x18
jmp 0x406a16
movzx eax, word [esi]
push eax
call sub.WSOCK32.dll_ntohs
mov edx, dword [ebx + 0x4474]
movzx ecx, ax
push ecx
push str.ignore_unknown_opcode__d_received
push edx
push ebp
push 2
call fcn.004098c0
add esp, 0x14
jmp 0x406a16
mov eax, dword [ebx + 0x28]
mov ecx, dword [ebx + 0x4474]
push eax
push str.timeout_while_waiting_for_ack_blk__d
push ecx
push ebp
push 9
call fcn.004098c0
add esp, 0x14
add dword [ebx + 0x38], 1
mov edx, dword [ebx + 0x30]
cmp edx, dword [ebx + 0x2c]
mov eax, dword [0x41f388]
ja 0x406a32
cmp dword [ebx + 0x3c], 0x32
jae 0x406a3c
cmp dword [ebx + 0x38], eax
jb 0x406785
cmp dword [ebx + 0x3c], 0x32
jb 0x406ad0
movzx edx, word [ebx + 0x28]
mov eax, dword [ebx + 0x4474]
lea ecx, [ebx + 0x4272]
push ecx
push edx
push str.MAX_RETRIES_while_waiting_for_Ack_block__d._file___s_
push eax
push ebp
push 0
call fcn.004098c0
push 0
call fcn.00405810
add esp, 0x1c
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
ret
push 0
mov esi, 0x41a33c
mov ecx, ebx
call fcn.00405e10
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
ret
push 0
mov esi, str.send
mov ecx, ebx
call fcn.00405e10
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
ret
push edi
mov esi, str.recv
mov ecx, ebx
call fcn.00405e10
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
ret
mov eax, dword [ebx + 0x4474]
add esi, 4
push esi
push str.Peer_returns_ERROR___s_____aborting_transfer
push eax
push ebp
push 1
call fcn.004098c0
add esp, 0x14
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
ret
cmp dword [ebx + 0x38], eax
mov ecx, dword [ebx + 0x28]
mov edx, dword [ebx + 0x4474]
jb 0x406afe
push ecx
push str.TIMEOUT_waiting_for_Ack_block__d
push edx
push ebp
push 1
call fcn.004098c0
push 0
call fcn.00405810
add esp, 0x18
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
ret
mov eax, dword [ebx + 0x30]
push eax
push ecx
push str.Count__d__Last_pkt__d
push edx
push ebp
push 0xa
call fcn.004098c0
add esp, 0x18
cmp dword [ebx + 0x4494], 0
je 0x406b2a
cmp dword [ebx + 0x24], 0
jne 0x406b2a
mov esi, ebx
call fcn.00405200
push ebx
call fcn.00405700
add esp, 4
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
ret