Function at 0x40b140
Capabilities:
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x20568
call fcn.00445a80
mov eax, dword [0x4635a0]
xor eax, ebp
mov dword [ebp - 4], eax
push 0x1ffff
lea eax, [ebp - 0x20003]
mov dword [ebp - 0x20540], 0xffffffff
push 0
push eax
mov byte [ebp - 0x20004], 0
call sub.MSVCR120.dll_memset
add esp, 0xc
mov dword [ebp - 0x20548], 0
cmp dword [0x463cd0], 0
mov dword [ebp - 0x2054c], 0x80
jne 0x40b9e9
push ebx
xor eax, eax
mov dword [ebp - 0x20114], 0xffffffff
push esi
push edi
mov word [ebp - 0x2010c], ax
mov word [ebp - 0x20084], ax
mov dword [ebp - 0x2039c], eax
lea eax, [ebp - 0x20298]
push 0x80
push eax
mov dword [ebp - 0x2008c], 0xffffffff
call fcn.004011b3
mov ax, word [0x463c20]
push 0x40abe0
mov word [ebp - 0x20298], ax
call fcn.004010c3
push dword [0x463b80]
lea eax, [ebp - 0x20560]
xor edx, edx
push eax
mov dword [ebp - 0x20218], edx
call fcn.00401078
mov eax, dword [0x463b80]
xor esi, esi
add esp, 0x14
mov dword [ebp - 0x20544], 0
mov dword [ebp - 0x20538], esi
test eax, eax
jle 0x40b9e2
lea edi, [ebp - 0x2010c]
mov ebx, 0x463a80
mov dword [ebp - 0x2053c], edi
push ebx
push dword [ebp + 8]
push 2
call fcn.0040103c
mov ecx, eax
add esp, 0xc
mov dword [edi - 8], ecx
cmp ecx, 0xffffffff
jne 0x40b293
cmp dword [0x463c18], 0
jle 0x40b2fb
call sub.WS2_32.dll_WSAGetLastError
push eax
call fcn.0041fbf0
add esp, 4
push eax
push 0x80
push ebx
call fcn.0041f840
add esp, 8
push eax
push str.do_listen___s__:__s_n
call fcn.004011ea
add esp, 0xc
jmp 0x40b2fb
mov edx, dword [ebp - 0x20218]
xor eax, eax
test edx, edx
je 0x40b2ae
nop
cmp dword [ebp + eax*4 - 0x20214], ecx
je 0x40b2ae
inc eax
cmp eax, edx
jb 0x40b2a0
cmp eax, edx
jne 0x40b2c4
cmp edx, 0x40
jae 0x40b2c4
mov dword [ebp + eax*4 - 0x20214], ecx
inc dword [ebp - 0x20218]
push ecx
lea eax, [ebp - 0x20560]
push eax
call fcn.0040123f
inc dword [ebp - 0x20544]
mov ecx, 0x20
mov esi, ebx
add esp, 8
rep movsd dword es:[edi], dword [esi]
mov edi, dword [ebp - 0x2053c]
mov esi, dword [ebp - 0x20538]
add edi, 0x88
mov dword [ebp - 0x2053c], edi
mov eax, dword [0x463b80]
inc esi
sub ebx, 0xffffff80
mov dword [ebp - 0x20538], esi
cmp esi, eax
jl 0x40b241
mov ebx, dword [ebp - 0x20544]
test ebx, ebx
je 0x40b9e2
cmp dword [0x463c64], 0
lea eax, [ebp - 0x20568]
mov ecx, 0
cmovle eax, ecx
mov dword [ebp - 0x20538], eax
jmp 0x40b340
mov edx, dword [ebp - 0x20540]
cmp edx, 0xffffffff
je 0x40b434
mov edi, dword [ebp - 0x20218]
xor ecx, ecx
test edi, edi
je 0x40b3b3
imul eax, edx, 0x88
mov eax, dword [ebp + eax - 0x20114]
jmp 0x40b370
cmp dword [ebp + ecx*4 - 0x20214], eax
je 0x40b380
inc ecx
cmp ecx, edi
jb 0x40b370
jmp 0x40b3b3
lea eax, [edi - 1]
cmp ecx, eax
jae 0x40b3ac
jmp 0x40b390
mov eax, dword [ebp + ecx*4 - 0x20210]
mov dword [ebp + ecx*4 - 0x20214], eax
inc ecx
mov edi, dword [ebp - 0x20218]
lea eax, [edi - 1]
cmp ecx, eax
jb 0x40b390
dec edi
mov dword [ebp - 0x20218], edi
imul esi, edx, 0x88
lea eax, [ebp - 0x20560]
push dword [ebp + esi - 0x20114]
push eax
call fcn.0040114a
lea eax, [ebp - 0x2010c]
add eax, esi
push eax
push dword [ebp + 8]
push 2
call fcn.0040103c
add esp, 0x14
mov dword [ebp + esi - 0x20114], eax
cmp eax, 0xffffffff
je 0x40b9f3
xor ecx, ecx
test edi, edi
je 0x40b40e
jmp 0x40b400
cmp dword [ebp + ecx*4 - 0x20214], eax
je 0x40b40e
inc ecx
cmp ecx, edi
jb 0x40b400
cmp ecx, edi
jne 0x40b424
cmp edi, 0x40
jae 0x40b424
mov dword [ebp + ecx*4 - 0x20214], eax
inc dword [ebp - 0x20218]
push eax
lea eax, [ebp - 0x20560]
push eax
call fcn.0040123f
add esp, 8
mov dword [ebp - 0x20540], 0xffffffff
mov dword [ebp - 0x2053c], 0xffffffff
mov dword [ebp - 0x20530], 0
cmp dword [0x463c18], 1
jle 0x40b46e
push dword [ebp - 0x20554]
push str.selecting__fdmax__d_n
call fcn.004011ea
add esp, 8
mov eax, dword [0x463c64]
lea esi, [ebp - 0x20218]
lea edi, [ebp - 0x20530]
mov ecx, 0x41
rep movsd dword es:[edi], dword [esi]
mov esi, dword [ebp - 0x20538]
test eax, eax
jle 0x40b49a
push eax
push esi
call fcn.00401212
add esp, 8
call fcn.0040ac00
test eax, eax
lea eax, [ebp - 0x20530]
je 0x40b4c6
push esi
push 0
push 0
push eax
mov eax, dword [ebp - 0x20554]
inc eax
push eax
call fcn.0041f280
mov esi, eax
mov dword [ebp - 0x20550], esi
jmp 0x40b4e2
push 0
push 0
push 0
push eax
mov eax, dword [ebp - 0x20554]
inc eax
push eax
call fcn.0041f280
mov esi, eax
mov dword [ebp - 0x20550], eax
add esp, 0x14
cmp dword [0x463c18], 1
jle 0x40b4fc
push esi
push str.select_returned__d_fds_ready_n
call fcn.004011ea
add esp, 8
test esi, esi
je 0x40ba0c
xor edi, edi
cmp dword [ebp - 0x20554], edi
jl 0x40b55d
mov edi, edi
test esi, esi
jle 0x40b55d
lea eax, [ebp - 0x20530]
push eax
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40b554
xor esi, esi
test ebx, ebx
je 0x40b543
lea eax, [ebp - 0x20114]
cmp edi, dword [eax]
je 0x40b5c7
inc esi
add eax, 0x88
cmp esi, ebx
jb 0x40b531
mov eax, dword [ebp - 0x20540]
cmp eax, 0xffffffff
jne 0x40b56a
mov esi, dword [ebp - 0x20550]
inc edi
cmp edi, dword [ebp - 0x20554]
jle 0x40b510
cmp dword [ebp - 0x20540], 0xffffffff
je 0x40b452
mov esi, dword [ebp - 0x2053c]
lea eax, [ebp - 0x2054c]
push eax
lea eax, [ebp - 0x20298]
push eax
push 2
push 0x20000
lea eax, [ebp - 0x20004]
push eax
push esi
call dword [sym.imp.WS2_32.dll_recvfrom]
mov dword [ebp - 0x20534], eax
test eax, eax
js 0x40b9ac
call fcn.0040ac00
cmp eax, dword [0x463cb0]
jl 0x40b5f1
cmp dword [0x463c14], 0
je 0x40b619
push eax
push str.New_connection_denied:_connection_limit_reached___d__n
call fcn.00401186
add esp, 8
jmp 0x40b619
cmp dword [0x463c18], 1
jle 0x40b5de
push edi
push str.Valid_descriptor__d__n
call fcn.004011ea
add esp, 8
mov eax, esi
mov dword [ebp - 0x2053c], edi
mov dword [ebp - 0x20540], eax
jmp 0x40b549
lea eax, [ebp - 0x20298]
push eax
call fcn.004011e0
add esp, 4
test eax, eax
jne 0x40b651
cmp dword [0x463c14], eax
je 0x40b619
push str.New_connection_denied:_not_allowed_n
call fcn.00401186
add esp, 4
push 0
push 0x20000
lea eax, [ebp - 0x20004]
push eax
push esi
call dword [sym.imp.WS2_32.dll_recv]
mov dword [ebp - 0x20534], eax
test eax, eax
js 0x40b9ac
push eax
lea eax, [ebp - 0x20004]
push eax
call fcn.00401136
add esp, 8
jmp 0x40b452
cmp dword [0x463c14], 0
je 0x40b674
lea eax, [ebp - 0x20298]
push eax
call fcn.0040100a
push eax
push str.Connection_from__s._n
call fcn.00401186
add esp, 0xc
push dword [ebp - 0x2054c]
inc dword [0x463ed8]
lea eax, [ebp - 0x20298]
push eax
push esi
call fcn.00401028
lea eax, [ebp - 0x20004]
push 0x20000
push eax
call fcn.004011b3
mov ebx, dword [0x463cb8]
add esp, 0x14
test ebx, ebx
je 0x40b711
push 0x88
lea eax, [ebp - 0x20424]
push 0
push eax
call sub.MSVCR120.dll_memset
add esp, 0xc
mov dword [ebp - 0x2042c], esi
cmp dword [0x463c30], 0
lea esi, [ebp - 0x20298]
mov ecx, 0x20
lea edi, [ebp - 0x20424]
lea eax, [ebp - 0x2042c]
push ebx
rep movsd dword es:[edi], dword [esi]
push eax
je 0x40b6fe
call fcn.00401230
mov ebx, dword [ebp - 0x20544]
add esp, 8
jmp 0x40b340
call fcn.00401271
mov ebx, dword [ebp - 0x20544]
add esp, 8
jmp 0x40b340
mov ebx, 1
mov dword [ebp - 0x20398], esi
mov dword [ebp - 0x2039c], ebx
xor eax, eax
cmp dword [ebp + eax*4 - 0x20398], 0
je 0x40b734
inc eax
cmp eax, 1
jb 0x40b724
cmp eax, 1
jne 0x40b750
mov ebx, 2
mov dword [ebp - 0x20394], 0
mov dword [ebp - 0x2039c], ebx
mov edi, edi
cmp dword [0x463c18], 1
lea esi, [ebp - 0x2039c]
mov ecx, 0x41
lea edi, [ebp - 0x20218]
rep movsd dword es:[edi], dword [esi]
jle 0x40b779
push str.udp_selecting_n
call fcn.004011ea
add esp, 4
mov eax, dword [0x463c64]
test eax, eax
jle 0x40b791
push eax
push dword [ebp - 0x20538]
call fcn.00401212
add esp, 8
push dword [ebp - 0x20538]
mov esi, dword [ebp - 0x2053c]
lea eax, [ebp - 0x20218]
push 0
push 0
push eax
lea eax, [esi + 1]
push eax
call fcn.0041f280
add esp, 0x14
test eax, eax
je 0x40ba0c
lea eax, [ebp - 0x20218]
push eax
push 0
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40b933
push 0x20000
lea eax, [ebp - 0x20004]
push eax
push 0
call fcn.0040102d
mov edx, eax
add esp, 0xc
mov dword [ebp - 0x20534], edx
test edx, edx
jg 0x40b8a0
jns 0x40b823
cmp dword [0x463c14], 0
je 0x40b821
call dword [sym.imp.MSVCR120.dll__errno]
push dword [eax]
call dword [sym.imp.MSVCR120.dll_strerror]
push eax
push str.Error_reading_from_stdin:__s_n
call fcn.004011ea
add esp, 0xc
jmp 0x40b83b
test edx, edx
jne 0x40b841
cmp dword [0x463c18], 0
je 0x40b841
push str.EOF_on_stdin_n
call fcn.004011ea
add esp, 4
mov edx, dword [ebp - 0x20534]
xor ecx, ecx
test ebx, ebx
je 0x40b893
jmp 0x40b850
cmp dword [ebp + ecx*4 - 0x20398], 0
je 0x40b861
inc ecx
cmp ecx, ebx
jb 0x40b850
jmp 0x40b893
lea eax, [ebx - 1]
cmp ecx, eax
jae 0x40b88c
jmp 0x40b870
mov eax, dword [ebp + ecx*4 - 0x20394]
mov dword [ebp + ecx*4 - 0x20398], eax
inc ecx
mov ebx, dword [ebp - 0x2039c]
lea eax, [ebx - 1]
cmp ecx, eax
jb 0x40b870
dec ebx
mov dword [ebp - 0x2039c], ebx
test edx, edx
jns 0x40b750
jmp 0x40b9cc
cmp dword [0x463c68], 0
je 0x40b8d1
push 0x463ed4
lea eax, [ebp - 0x20548]
push eax
lea eax, [ebp - 0x20534]
push eax
lea eax, [ebp - 0x20004]
push eax
call fcn.00401032
mov edx, dword [ebp - 0x20534]
add esp, 0x10
cmp dword [0x463c38], 0
jne 0x40b915
mov eax, dword [ebp - 0x20548]
push 0
push edx
test eax, eax
jne 0x40b8ed
lea eax, [ebp - 0x20004]
push eax
push esi
call dword [sym.imp.WS2_32.dll_send]
mov ecx, eax
mov eax, dword [ebp - 0x20534]
cmp ecx, eax
jl 0x40b9ac
push eax
lea eax, [ebp - 0x20004]
push eax
call fcn.00401253
add esp, 8
mov eax, dword [ebp - 0x20548]
test eax, eax
je 0x40b933
push eax
call dword [sym.imp.MSVCR120.dll_free]
add esp, 4
mov dword [ebp - 0x20548], 0
lea eax, [ebp - 0x20218]
push eax
push esi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40b993
push 0
push 0x20000
lea eax, [ebp - 0x20004]
push eax
push esi
call dword [sym.imp.WS2_32.dll_recv]
mov dword [ebp - 0x20534], eax
test eax, eax
js 0x40b9ac
push eax
lea eax, [ebp - 0x20004]
push eax
call fcn.00401136
add esp, 8
cmp dword [0x463c34], 0
jne 0x40b993
push dword [ebp - 0x20534]
lea eax, [ebp - 0x20004]
push eax
push 1
call fcn.004011a9
add esp, 0xc
lea eax, [ebp - 0x20004]
push 0x20000
push eax
call fcn.004011b3
add esp, 8
jmp 0x40b750
call sub.WS2_32.dll_WSAGetLastError
push eax
call fcn.0041fbf0
push eax
push str._s._n
call fcn.00401186
add esp, 0xc
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [ebp - 4]
mov eax, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0044590e
mov esp, ebp
pop ebp
ret
cmp eax, 1
je 0x40ba1c
jmp 0x40ba48
push str.DTLS_is_not_supported_in_listen_mode_n
call fcn.004010f0
call sub.WS2_32.dll_WSAGetLastError
push eax
call fcn.0041fbf0
add esp, 4
push eax
push str.do_listen:__s
call fcn.004010f0
push dword [0x463c64]
push str.Idle_timeout_expired___d_ms_.
call fcn.004010f0
call sub.WS2_32.dll_WSAGetLastError
push eax
call fcn.0041fbf0
add esp, 4
push eax
push 0x80
push 0x463a80
call fcn.0041f840
add esp, 8
push eax
push str.Unable_to_open_listening_socket_on__s:__s
call fcn.004010f0
push str.Unable_to_open_any_listening_sockets.
call fcn.004010f0
int3