Function at 0x402b30
Capabilities:
Get socket status
Receive data
Receive data on socket
Set socket configuration

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x1cc
cmp byte [0x41d0a1], 0
mov dword [esp + 0x34], 0
mov ebx, dword [esp + 0x1e4]
mov dword [esp + 0x38], 0x2710
je 0x402b96
mov ebp, dword [sym.imp.msvcrt.dll__kbhit]
mov edi, dword [sym.imp.msvcrt.dll__getwch]
xor esi, esi
jmp 0x402b87
call edi
mov esi, eax
test ax, ax
je 0x402c38
cmp ax, 0xe0
je 0x402c38
call ebp
test eax, eax
jne 0x402b70
test si, si
jne 0x402db8
mov eax, dword [esp + 0x1e0]
mov dword [esp + 4], ebx
mov dword [esp], eax
call sym._PAL_receiveBe
mov edi, eax
test eax, eax
jne 0x402c27
mov eax, dword [0x414010]
cmp eax, 0xffffffff
je 0x402c48
mov dword [esp + 0xc0], eax
lea ebp, [esp + 0xbc]
lea eax, [esp + 0x34]
mov dword [esp + 0xbc], 1
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], ebp
mov dword [esp], 0
call dword [sym.imp.WS2_32.dll_select]
sub esp, 0x14
cmp eax, 0xffffffff
je 0x402e78
mov eax, dword [0x414010]
mov dword [esp + 4], ebp
mov dword [esp], eax
call sym.___WSAFDIsSet_8
sub esp, 8
test eax, eax
jne 0x402de0
add esp, 0x1cc
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
call edi
mov esi, eax
jmp 0x402b87
mov eax, dword [0x414014]
lea ebx, [esp + 0xbc]
mov dword [esp + 0xbc], 1
mov dword [esp + 0xc], 0
mov dword [esp + 0xc0], eax
lea eax, [esp + 0x34]
mov dword [esp + 0x10], eax
mov dword [esp + 8], 0
mov dword [esp + 4], ebx
mov dword [esp], 0
call dword [sym.imp.WS2_32.dll_select]
sub esp, 0x14
cmp eax, 0xffffffff
je 0x402f40
mov eax, dword [0x414014]
mov dword [esp + 4], ebx
mov dword [esp], eax
call sym.___WSAFDIsSet_8
sub esp, 8
test eax, eax
je 0x402c27
lea eax, [esp + 0x2c]
mov dword [esp + 0x2c], 0x10
mov dword [esp + 8], eax
mov eax, dword [0x414014]
mov dword [esp + 4], 0x41d060
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_accept]
mov dword [0x414010], eax
sub esp, 0xc
cmp eax, 0xffffffff
je 0x402e1e
lea edx, [esp + 0x30]
mov dword [esp + 0x30], 1
mov dword [esp + 8], edx
mov dword [esp + 4], 0x8004667e
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_ioctlsocket]
sub esp, 0xc
cmp eax, 0xffffffff
je 0x402f57
call sym._QSPY_reset
call sym._QSPY_txReset
mov eax, dword [0x41d064]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_inet_ntoa]
sub esp, 4
lea ebx, [esp + 0x3c]
mov dword [esp + 8], 0x7f
mov dword [esp], ebx
mov dword [esp + 4], eax
call sym._strncpy
movzx eax, word [0x41d062]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_ntohs]
sub esp, 4
movzx eax, ax
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], str.____COMMS__TCP_IP___Connected_to_Host_s_Port_d
mov dword [esp + 8], 0xffffffff
mov dword [esp + 4], 0x3e0
mov dword [esp], 0x45dde8
call dword [sym.imp.msvcrt.dll__snprintf_s]
lea edx, [eax - 1]
cmp edx, 0x3df
mov edx, 0x3e0
cmovae eax, edx
mov dword [0x45e1d0], eax
call sym._QSPY_printInfo
jmp 0x402c27
mov ecx, dword [esp + 0x1e0]
mov eax, esi
mov edi, 3
mov byte [ecx], al
mov eax, edi
mov dword [ebx], 1
add esp, 0x1cc
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0xc], 0
mov eax, dword [ebx]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x1e0]
mov dword [esp + 4], eax
mov eax, dword [0x414010]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_recv]
sub esp, 0x10
test eax, eax
jle 0x402e90
mov dword [ebx], eax
mov edi, 1
jmp 0x402c27
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [esp + 0xc], str.____COMMS__ERROR____Socket_accept_Err_d
mov dword [esp + 0x10], eax
mov dword [esp + 8], 0xffffffff
mov edi, 5
mov dword [esp + 4], 0x3e0
mov dword [esp], 0x45dde8
call dword [sym.imp.msvcrt.dll__snprintf_s]
lea edx, [eax - 1]
cmp edx, 0x3df
mov edx, 0x3e0
cmovae eax, edx
mov dword [0x45e1d0], eax
call sym._QSPY_printError
jmp 0x402c27
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [esp + 0xc], str.____COMMS__ERROR____Client_socket_select_Err_d
mov dword [esp + 0x10], eax
jmp 0x402e30
mov eax, dword [0x41d064]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_inet_ntoa]
sub esp, 4
lea ebx, [esp + 0x3c]
mov dword [esp + 8], 0x7f
mov dword [esp + 4], eax
mov dword [esp], ebx
call sym._strncpy
movzx eax, word [0x41d062]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_ntohs]
sub esp, 4
movzx eax, ax
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], str.____COMMS__TCP_IP___Disconn_from_Host_s_Port_d
mov dword [esp + 8], 0xffffffff
mov dword [esp + 4], 0x3e0
mov dword [esp], 0x45dde8
call dword [sym.imp.msvcrt.dll__snprintf_s]
lea edx, [eax - 1]
cmp edx, 0x3df
mov edx, 0x3e0
cmovae eax, edx
mov dword [0x45e1d0], eax
call sym._QSPY_printInfo
mov eax, dword [0x414010]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [0x414010], 0xffffffff
sub esp, 4
jmp 0x402c27
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [esp + 0xc], str.____COMMS__ERROR____Server_socket_select_Err_d
mov dword [esp + 0x10], eax
jmp 0x402e30
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [esp + 0xc], str.____COMMS__ERROR____Client_socket_non_blocking_Err_d
mov dword [esp + 0x10], eax
jmp 0x402e30