Function at 0x4017cb
Capabilities:
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov eax, 0x43b4
mov ebp, esp
call fcn.0041acd8
push ebx
push esi
push edi
mov ecx, dword [ebp + 8]
call fcn.0040584e
mov dword [ebp - 0x30], 0
mov esi, dword [ebp + 0x10]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x2c], 0
cmp dword [ebp - 0x30], 0
jne 0x401d6e
mov dword [ebp - 0x348], 0
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x344], eax
inc dword [ebp - 0x348]
cmp dword [ebp - 0x348], 0x40
jae 0x401863
mov ecx, dword [ebp - 0x348]
mov eax, dword [ebp + 0xc]
mov dword [ebp + ecx*4 - 0x344], eax
inc dword [ebp - 0x348]
cmp dword [ebp - 0x348], 0x40
jae 0x401863
mov eax, dword [ebp - 0x348]
mov dword [ebp + eax*4 - 0x344], esi
inc dword [ebp - 0x348]
mov ecx, dword [ebp - 0x1c]
mov eax, dword [ebp + 0xc]
cmp ecx, eax
jae 0x40186f
mov ecx, eax
cmp ecx, esi
jae 0x401875
mov ecx, esi
push 0
lea eax, [ebp - 0x348]
push 0
inc ecx
push 0
push eax
push ecx
call sub.WSOCK32.dll_select
lea ecx, [ebp - 0x348]
push ecx
push dword [ebp - 0x1c]
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x4018bd
push 0
lea eax, [ebp - 0x2348]
push 0x1fff
push eax
push dword [ebp - 0x1c]
call sub.WSOCK32.dll_recv
test eax, eax
jg 0x4018bd
mov dword [ebp - 0x30], 1
lea eax, [ebp - 0x348]
push eax
push dword [ebp + 0xc]
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x401bb9
lea eax, [ebp - 0x20]
lea ecx, [ebp - 0x58]
push eax
lea edx, [ebp - 0x2348]
mov dword [ebp - 0x20], 0x10
push ecx
push 0
push 0x1fff
push edx
push dword [ebp + 0xc]
call sub.WSOCK32.dll_recvfrom
test eax, eax
jle 0x401bb9
cmp dword [ebp - 0x10], 0
jne 0x401913
lea ecx, [ebp - 0x58]
mov edx, dword [ebp - 0x20]
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0x2c], edx
push eax
lea ecx, [ebp - 0x2348]
push ecx
lea edx, [ebp - 0x58]
push edx
mov ecx, dword [ebp + 8]
mov byte [ebp + eax - 0x2348], 0
call fcn.00405855
push eax
lea ecx, [ebp - 0xd4]
call fcn.00405482
mov ecx, dword [ebp + 8]
call fcn.004055ca
mov edi, eax
lea ecx, [ebp - 0xd4]
call fcn.004055ca
push eax
mov ebx, eax
push edi
call sub.MSVCRT20.dll_strcmp
add esp, 8
mov dword [ebp - 0x14], eax
push edi
call dword [sym.imp.MSVCRT20.dll_free]
add esp, 4
push ebx
call dword [sym.imp.MSVCRT20.dll_free]
add esp, 4
cmp dword [ebp - 0x14], 0
jne 0x401bae
mov ecx, dword [ebp + 8]
call fcn.0040555a
push eax
lea ecx, [ebp - 0xd4]
call fcn.0040555e
lea eax, [ebp - 1]
lea ecx, [ebp - 0xd4]
push eax
call fcn.00405708
test eax, eax
je 0x401bae
cmp byte [ebp - 1], 0
jne 0x401bae
lea eax, [ebp - 1]
lea ecx, [ebp - 0xd4]
push eax
call fcn.00405708
test eax, eax
je 0x401bae
cmp byte [ebp - 1], 0
jne 0x401bae
lea eax, [ebp - 1]
lea ecx, [ebp - 0xd4]
push eax
call fcn.00405708
test eax, eax
je 0x401bae
cmp byte [ebp - 1], 0
jne 0x401bae
lea eax, [ebp - 1]
lea ecx, [ebp - 0xd4]
push eax
call fcn.00405708
test eax, eax
je 0x401bae
movzx eax, byte [ebp - 1]
cmp eax, 1
je 0x401a20
cmp eax, 3
je 0x401a89
xor eax, eax
jmp 0x401af4
push 2
lea ecx, [ebp - 0xd4]
call fcn.004056a1
push 4
lea eax, [ebp - 0x38]
push eax
lea ecx, [ebp - 0xd4]
call fcn.00405770
push 4
lea eax, [ebp - 0x38]
push eax
lea ecx, [ebp - 0xd4]
call fcn.0040561d
push 2
lea eax, [ebp - 0x38]
push eax
lea ecx, [ebp - 0xd4]
call fcn.00405770
push 2
lea eax, [ebp - 0x38]
push eax
lea ecx, [ebp - 8]
push ecx
call sub.MSVCRT20.dll_memcpy
add esp, 0xc
movzx ecx, word [ebp - 8]
push ecx
lea ecx, [ebp - 0xd4]
call fcn.00405692
mov eax, 1
jmp 0x401af4
lea eax, [ebp - 2]
lea ecx, [ebp - 0xd4]
push eax
call fcn.00405708
movzx eax, byte [ebp - 2]
push eax
lea ecx, [ebp - 0x244]
push ecx
lea ecx, [ebp - 0xd4]
call fcn.00405770
push 2
lea ecx, [ebp - 0xc]
push ecx
lea ecx, [ebp - 0xd4]
call fcn.00405770
push 2
lea ecx, [ebp - 0xc]
push ecx
lea edx, [ebp - 6]
push edx
call sub.MSVCRT20.dll_memcpy
add esp, 0xc
movzx ecx, word [ebp - 6]
push ecx
lea ecx, [ebp - 0xd4]
call fcn.00405692
lea ecx, [ebp - 0x244]
push ecx
lea ecx, [ebp - 0xd4]
call fcn.00405630
test eax, eax
je 0x401bae
mov ecx, dword [ebp + 8]
call fcn.004055f2
test eax, eax
jne 0x401b46
mov ecx, dword [ebp + 8]
call fcn.00405602
mov edi, eax
lea ecx, [ebp - 0xd4]
call fcn.00405602
push eax
mov ebx, eax
push edi
call sub.MSVCRT20.dll_strcmp
add esp, 8
mov dword [ebp - 0x14], eax
push edi
call dword [sym.imp.MSVCRT20.dll_free]
add esp, 4
push ebx
call dword [sym.imp.MSVCRT20.dll_free]
add esp, 4
cmp dword [ebp - 0x14], 0
jne 0x401bae
lea eax, [ebp - 0xd4]
push eax
mov ecx, eax
call fcn.00405855
push eax
call fcn.00404d21
add esp, 8
test eax, eax
je 0x401bae
cmp dword [ebp - 0x18], 0
je 0x401b73
push dword [ebp - 0x18]
call dword [sym.imp.MSVCRT20.dll_free]
add esp, 4
lea eax, [ebp - 0x28]
lea ecx, [ebp - 0x18]
push eax
push ecx
lea ecx, [ebp - 0xd4]
call fcn.0040560a
lea ecx, [ebp - 0xd4]
call fcn.00405519
mov edi, eax
lea ecx, [ebp - 0xd4]
call fcn.00405528
push dword [ebp - 0x28]
push dword [ebp - 0x18]
push 0
push eax
push edi
push esi
call sub.WSOCK32.dll_sendto
lea ecx, [ebp - 0xd4]
call fcn.004054e5
lea eax, [ebp - 0x348]
push eax
push esi
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x401805
lea eax, [ebp - 0x20]
lea ecx, [ebp - 0x68]
push eax
lea edx, [ebp - 0x2348]
mov dword [ebp - 0x20], 0x10
push ecx
push 0
push 0x1fff
push edx
push esi
call sub.WSOCK32.dll_recvfrom
mov dword [ebp - 0x24], eax
test eax, eax
jle 0x401805
cmp dword [ebp - 0x18], 0
je 0x40180f
cmp dword [ebp - 0x10], 0
je 0x40180f
push 0x206c
lea eax, [ebp - 0x43b4]
push eax
lea ecx, [ebp - 0x68]
push ecx
mov ecx, dword [ebp + 8]
call fcn.00405855
push eax
lea ecx, [ebp - 0x140]
call fcn.00405482
mov ecx, dword [ebp + 8]
call fcn.004055f2
test eax, eax
jne 0x401c8e
mov ecx, dword [ebp + 8]
call fcn.00405602
mov edi, eax
lea ecx, [ebp - 0x140]
call fcn.004055ca
push eax
mov ebx, eax
push edi
call sub.MSVCRT20.dll_strcmp
add esp, 8
mov dword [ebp - 0x14], eax
push edi
call dword [sym.imp.MSVCRT20.dll_free]
add esp, 4
push ebx
call dword [sym.imp.MSVCRT20.dll_free]
add esp, 4
cmp dword [ebp - 0x14], 0
je 0x401c8e
lea ecx, [ebp - 0x140]
call fcn.004054e5
jmp 0x40180f
push 3
lea eax, [ebp - 0x48]
push eax
lea ecx, [ebp - 0x140]
mov byte [ebp - 0x48], 0
mov byte [ebp - 0x47], 0
mov byte [ebp - 0x46], 0
call fcn.004056b0
cmp dword [ebp - 0x10], 0
je 0x401d09
mov ecx, dword [ebp - 0x10]
mov cx, word [ecx]
movzx eax, cx
cmp eax, 2
jne 0x401d09
cmp cx, 2
jne 0x401d09
push 1
lea eax, [ebp - 4]
push eax
lea ecx, [ebp - 0x140]
mov byte [ebp - 4], 1
call fcn.004056b0
push 4
mov eax, dword [ebp - 0x10]
add eax, 4
lea ecx, [ebp - 0x140]
push eax
call fcn.004056b0
push 2
mov eax, dword [ebp - 0x10]
add eax, 2
lea ecx, [ebp - 0x140]
push eax
call fcn.004056b0
mov eax, 1
jmp 0x401d0b
xor eax, eax
test eax, eax
jne 0x401d1f
lea ecx, [ebp - 0x140]
call fcn.004054e5
jmp 0x40180f
push dword [ebp - 0x24]
lea ecx, [ebp - 0x2348]
push ecx
lea ecx, [ebp - 0x140]
call fcn.004056b0
lea ecx, [ebp - 0x140]
call fcn.0040553a
mov edi, eax
lea ecx, [ebp - 0x140]
call fcn.0040554b
push dword [ebp - 0x2c]
push dword [ebp - 0x10]
push 0
push eax
push edi
push dword [ebp + 0xc]
call sub.WSOCK32.dll_sendto
lea ecx, [ebp - 0x140]
call fcn.004054e5
jmp 0x401805
cmp dword [ebp - 0x18], 0
je 0x401d80
push dword [ebp - 0x18]
call dword [sym.imp.MSVCRT20.dll_free]
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret