Function at 0x4044d0
Capabilities:
Get socket status
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:
sub esp, 0x310
push ebx
push ebp
push esi
mov esi, dword [esp + 0x320]
xor ebx, ebx
push edi
mov ebp, dword [esi + 0x10]
mov dword [esi + 0x2c], 1
mov dword [esi + 0x38], ebx
mov dword [esi + 0x34], ebx
cmp dword [esi + 0x34], ebx
jbe 0x4044fe
mov eax, dword [esi + 0x24]
mov dword [esi + 0x2c], eax
cmp dword [esi + 0x24], ebx
jbe 0x4045b8
mov ecx, dword [esi + 0x48]
mov edx, dword [esi + 0x24]
lea eax, [ecx + edx]
mov ecx, dword [esi + 0x28]
cmp eax, ecx
jae 0x404519
mov ecx, eax
mov eax, dword [esi + 0x2c]
cmp eax, ecx
ja 0x4045b6
dec eax
push 0
imul eax, dword [esi + 0x3c]
push 0
push eax
mov eax, dword [esi + 0x1c]
lea edi, [esi + 0x50]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x404806
mov ecx, dword [esi + 0x3c]
mov eax, dword [esi + 0x1c]
lea ebx, [esi + 0x30]
push 0
push ebx
lea edx, [edi + 4]
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x404806
push 3
call sub.WSOCK32.dll_htons
mov word [edi], ax
mov cx, word [esi + 0x2c]
push ecx
call sub.WSOCK32.dll_htons
mov word [edi + 2], ax
mov edx, dword [ebx]
mov eax, dword [esi + 0x18]
add edx, 4
push 0
push edx
push edi
push eax
call sub.WSOCK32.dll_send
test eax, eax
jl 0x404857
mov ecx, dword [ebx]
add ecx, 4
cmp eax, ecx
jne 0x404857
mov ecx, dword [esi + 0x38]
mov eax, dword [esi + 0x2c]
inc ecx
inc eax
mov dword [esi + 0x38], ecx
mov dword [esi + 0x2c], eax
jmp 0x404507
xor ebx, ebx
mov eax, dword [esi + 0x34]
mov edx, dword [esi + 0x18]
sub eax, ebx
mov dword [esp + 0x220], edx
mov dword [esp + 0x21c], 1
mov dword [esp + 0x14], ebx
je 0x4045f0
dec eax
je 0x4045e4
mov eax, dword [esi + 0x40]
mov dword [esp + 0x10], eax
jmp 0x4045fd
mov ecx, dword [esi + 0x40]
inc ecx
shr ecx, 1
mov dword [esp + 0x10], ecx
jmp 0x4045fd
mov edx, dword [esi + 0x40]
add edx, 3
shr edx, 2
mov dword [esp + 0x10], edx
lea eax, [esp + 0x10]
lea ecx, [esp + 0x21c]
push eax
push ebx
push ebx
push ecx
push 1
call sub.WSOCK32.dll_select
cmp eax, 0xffffffff
jne 0x4046ad
call fcn.004031a0
push eax
push str.select
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea edx, [esp + 0x28]
push str.error__d_in_system_call__s__s
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
mov ecx, dword [esi + 0x446c]
mov edx, dword [esi + 0x10]
lea eax, [esp + 0x30]
push eax
push ecx
push edx
push ebx
call fcn.00407550
push ebx
push esi
call fcn.00405c90
add esp, 0x2c
mov eax, dword [esi + 0x24]
mov ecx, dword [esi + 0x446c]
push eax
push str.timeout_while_waiting_for_ack_blk__d
push ecx
push ebp
push 9
call fcn.00407550
mov eax, dword [esi + 0x34]
add esp, 0x14
inc eax
mov dword [esi + 0x34], eax
mov edx, dword [esi + 0x2c]
mov eax, dword [esi + 0x28]
cmp edx, eax
mov eax, dword [0x413810]
ja 0x40491f
cmp dword [esi + 0x38], 0x32
jae 0x404925
cmp dword [esi + 0x34], eax
jae 0x40491f
xor ebx, ebx
jmp 0x4044f3
cmp eax, ebx
je 0x40465e
mov eax, dword [esi + 0x18]
lea edi, [esi + 0x4054]
push ebx
push 0x204
push edi
push eax
call sub.WSOCK32.dll_recv
cmp eax, ebx
jle 0x4048a8
cmp eax, 4
jae 0x4046ed
mov ecx, dword [esi + 0x446c]
push str.rcvd_packet_too_short
push ecx
push ebp
push 1
call fcn.00407550
add esp, 0x10
jmp 0x404680
mov dx, word [edi]
push edx
call sub.WSOCK32.dll_ntohs
cmp ax, 5
je 0x4048f7
mov ax, word [edi]
push eax
call sub.WSOCK32.dll_ntohs
cmp ax, 4
jne 0x4047db
mov cx, word [edi + 2]
push ecx
call sub.WSOCK32.dll_ntohs
cmp ax, word [esi + 0x24]
jne 0x404764
mov edx, dword [esi + 0x34]
mov edi, dword [esi + 0x4474]
mov eax, dword [esi + 0x24]
add edi, edx
cmp eax, ebx
mov dword [esi + 0x4474], edi
mov dword [esi + 0x34], ebx
mov dword [esi + 0x38], ebx
je 0x404752
mov ecx, dword [esi + 0x30]
mov edx, dword [esi + 0x4470]
add edx, ecx
mov dword [esi + 0x4470], edx
inc eax
push esi
mov dword [esi + 0x24], eax
call fcn.00404aa0
add esp, 4
jmp 0x404680
cmp dword [esi + 0x38], 3
jae 0x404794
cmp dword [esi + 0x24], 1
je 0x404794
mov dx, word [edi + 2]
push edx
call sub.WSOCK32.dll_ntohs
mov cx, word [esi + 0x24]
dec cx
cmp ax, cx
jne 0x404794
xor edx, edx
push ebx
mov dx, word [esi + 0x24]
push edx
push str.Ack_block__d_ignored__received_twice_
jmp 0x4047c4
mov cx, word [edi + 2]
mov ebx, dword [esi + 0x24]
push ecx
call sub.WSOCK32.dll_ntohs
and eax, 0xffff
cmp eax, ebx
jbe 0x404680
mov dx, word [edi + 2]
push ebx
push edx
call sub.WSOCK32.dll_ntohs
and eax, 0xffff
push eax
push str.Ack_of_block__d_received__last_block_sent__d___
mov eax, dword [esi + 0x446c]
push eax
push ebp
push 1
call fcn.00407550
add esp, 0x18
jmp 0x404680
mov cx, word [edi]
push ecx
call sub.WSOCK32.dll_ntohs
mov edx, dword [esi + 0x446c]
and eax, 0xffff
push eax
push str.ignore_unknown_opcode__d_received
push edx
push ebp
push 2
call fcn.00407550
add esp, 0x14
jmp 0x404680
call fcn.004031a0
push eax
push str.ReadFile
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [esp + 0x28]
push str.error__d_in_system_call__s__s
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
mov edx, dword [esi + 0x446c]
mov eax, dword [esi + 0x10]
lea ecx, [esp + 0x30]
push ecx
push edx
push eax
push 0
call fcn.00407550
push 0
push esi
call fcn.00405c90
add esp, 0x2c
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x310
ret
call fcn.004031a0
push eax
push str.send
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [esp + 0x28]
push str.error__d_in_system_call__s__s
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
mov eax, dword [esi + 0x446c]
mov ecx, dword [esi + 0x10]
lea edx, [esp + 0x30]
push edx
push eax
push ecx
push 0
call fcn.00407550
push 0
push esi
call fcn.00405c90
add esp, 0x2c
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x310
ret
call fcn.004031a0
push eax
push str.recv
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea edx, [esp + 0x28]
push str.error__d_in_system_call__s__s
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
mov ecx, dword [esi + 0x446c]
mov edx, dword [esi + 0x10]
lea eax, [esp + 0x30]
push eax
push ecx
push edx
push ebx
call fcn.00407550
push ebx
push esi
call fcn.00405c90
add esp, 0x2c
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x310
ret
mov eax, dword [esi + 0x446c]
add edi, 4
push edi
push str.Peer_returns_ERROR___s_____aborting_transfer
push eax
push ebp
push 1
call fcn.00407550
add esp, 0x14
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x310
ret
cmp dword [esi + 0x38], 0x32
jb 0x40495f
mov eax, dword [esi + 0x446c]
xor edx, edx
mov dx, word [esi + 0x24]
lea ecx, [esi + 0x426a]
push ecx
push edx
push str.MAX_RETRIES_while_waiting_for_Ack_block__d._file___s_
push eax
push ebp
push 0
call fcn.00407550
push 0
push esi
call fcn.00405c90
add esp, 0x20
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x310
ret
cmp dword [esi + 0x34], eax
jb 0x404994
mov ecx, dword [esi + 0x24]
mov edx, dword [esi + 0x446c]
push ecx
push str.TIMEOUT_waiting_for_Ack_block__d
push edx
push ebp
push 1
call fcn.00407550
push 0
push esi
call fcn.00405c90
add esp, 0x1c
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x310
ret
mov eax, dword [esi + 0x2c]
mov ecx, dword [esi + 0x24]
mov edx, dword [esi + 0x446c]
push eax
push ecx
push str.Count__d__Last_pkt__d
push edx
push ebp
push 0xa
call fcn.00407550
mov cx, word [esi + 0x4268]
mov eax, dword [esi + 0x10]
add esp, 0x18
mov dword [esp + 0x10], eax
push ecx
call sub.WSOCK32.dll_ntohs
mov ebp, dword [esi + 0x24]
cmp ax, 1
jne 0x4049d1
dec ebp
mov eax, dword [esi + 0x4474]
mov ebx, 0x415c54
cmp eax, 1
mov dword [esp + 0x18], 0x412cf8
ja 0x4049ed
mov dword [esp + 0x18], ebx
cmp ebp, 1
jle 0x4049f7
mov ebx, 0x412cf8
mov dx, word [esi + 0x4268]
push edx
call sub.WSOCK32.dll_ntohs
cmp ax, 1
mov edi, str.sent
je 0x404a14
mov edi, str.rcvd
mov eax, dword [esp + 0x18]
mov ecx, dword [esi + 0x4474]
push eax
push ecx
push 0
call fcn.0040a446
mov ecx, dword [esi + 0x447c]
mov edx, dword [esi + 0x4470]
add esp, 4
sub eax, ecx
mov ecx, dword [esi + 0x446c]
push eax
push edx
mov edx, dword [esp + 0x20]
push ebx
push ebp
lea eax, [esi + 0x426a]
push edi
push eax
push str.__s_:__s__d_blk_s___d_bytes_in__d_s.__d_blk_s_resent
push ecx
push edx
push 2
call fcn.00407550
mov eax, dword [0x413838]
add esp, 0x30
test eax, eax
je 0x404a87
push 0
call fcn.0040a446
mov edx, dword [esi + 0x447c]
add esp, 4
sub eax, edx
cmp eax, 0xa
jle 0x404a87
push 0x40
call dword [sym.imp.USER32.dll_MessageBeep]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x310
ret