Function at 0x403b90
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 0x403bbe
mov eax, dword [esi + 0x24]
mov dword [esi + 0x2c], eax
cmp dword [esi + 0x24], ebx
jbe 0x403c78
mov ecx, dword [esi + 0x48]
mov edx, dword [esi + 0x24]
lea eax, [ecx + edx]
mov ecx, dword [esi + 0x28]
cmp eax, ecx
jae 0x403bd9
mov ecx, eax
mov eax, dword [esi + 0x2c]
cmp eax, ecx
ja 0x403c76
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 0x403ec6
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 0x403ec6
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 0x403f17
mov ecx, dword [ebx]
add ecx, 4
cmp eax, ecx
jne 0x403f17
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 0x403bc7
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 0x403cb0
dec eax
je 0x403ca4
mov eax, dword [esi + 0x40]
mov dword [esp + 0x10], eax
jmp 0x403cbd
mov ecx, dword [esi + 0x40]
inc ecx
shr ecx, 1
mov dword [esp + 0x10], ecx
jmp 0x403cbd
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 0x403d6d
call fcn.00402c20
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.004053b0
push ebx
push esi
call fcn.00405310
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.004053b0
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 [0x412620]
ja 0x403fdf
cmp dword [esi + 0x38], 0x32
jae 0x403fe5
cmp dword [esi + 0x34], eax
jae 0x403fdf
xor ebx, ebx
jmp 0x403bb3
cmp eax, ebx
je 0x403d1e
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 0x403f68
cmp eax, 4
jae 0x403dad
mov ecx, dword [esi + 0x446c]
push str.rcvd_packet_too_short
push ecx
push ebp
push 1
call fcn.004053b0
add esp, 0x10
jmp 0x403d40
mov dx, word [edi]
push edx
call sub.WSOCK32.dll_ntohs
cmp ax, 5
je 0x403fb7
mov ax, word [edi]
push eax
call sub.WSOCK32.dll_ntohs
cmp ax, 4
jne 0x403e9b
mov cx, word [edi + 2]
push ecx
call sub.WSOCK32.dll_ntohs
cmp ax, word [esi + 0x24]
jne 0x403e24
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 0x403e12
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.00404160
add esp, 4
jmp 0x403d40
cmp dword [esi + 0x38], 3
jae 0x403e54
cmp dword [esi + 0x24], 1
je 0x403e54
mov dx, word [edi + 2]
push edx
call sub.WSOCK32.dll_ntohs
mov cx, word [esi + 0x24]
dec cx
cmp ax, cx
jne 0x403e54
xor edx, edx
push ebx
mov dx, word [esi + 0x24]
push edx
push str.Ack_block__d_ignored__received_twice_
jmp 0x403e84
mov cx, word [edi + 2]
mov ebx, dword [esi + 0x24]
push ecx
call sub.WSOCK32.dll_ntohs
and eax, 0xffff
cmp eax, ebx
jbe 0x403d40
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.004053b0
add esp, 0x18
jmp 0x403d40
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.004053b0
add esp, 0x14
jmp 0x403d40
call fcn.00402c20
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.004053b0
push 0
push esi
call fcn.00405310
add esp, 0x2c
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x310
ret
call fcn.00402c20
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.004053b0
push 0
push esi
call fcn.00405310
add esp, 0x2c
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x310
ret
call fcn.00402c20
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.004053b0
push ebx
push esi
call fcn.00405310
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.004053b0
add esp, 0x14
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x310
ret
cmp dword [esi + 0x38], 0x32
jb 0x40401f
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.004053b0
push 0
push esi
call fcn.00405310
add esp, 0x20
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x310
ret
cmp dword [esi + 0x34], eax
jb 0x404054
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.004053b0
push 0
push esi
call fcn.00405310
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.004053b0
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 0x404091
dec ebp
mov eax, dword [esi + 0x4474]
mov ebx, 0x4144a4
cmp eax, 1
mov dword [esp + 0x18], 0x411b44
ja 0x4040ad
mov dword [esp + 0x18], ebx
cmp ebp, 1
jle 0x4040b7
mov ebx, 0x411b44
mov dx, word [esi + 0x4268]
push edx
call sub.WSOCK32.dll_ntohs
cmp ax, 1
mov edi, str.sent
je 0x4040d4
mov edi, str.rcvd
mov eax, dword [esp + 0x18]
mov ecx, dword [esi + 0x4474]
push eax
push ecx
push 0
call fcn.004096e6
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.004053b0
mov eax, dword [0x412644]
add esp, 0x30
test eax, eax
je 0x404147
push 0
call fcn.004096e6
mov edx, dword [esi + 0x447c]
add esp, 4
sub eax, edx
cmp eax, 0xa
jle 0x404147
push 0x40
call dword [sym.imp.USER32.dll_MessageBeep]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x310
ret