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

Disassembly:
sub esp, 0x370
push ebx
push ebp
push esi
mov esi, dword [esp + 0x380]
push edi
push 0x3e8
push 2
mov dword [esp + 0x18], ecx
push 6
lea ebp, [esi + 0x400]
lea edi, [esi + 0x800]
call sub.WSOCK32.dll_socket
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x408804
call sub.WSOCK32.dll_WSAGetLastError
cmp eax, 0x273f
mov dword [esp + 0x14], eax
jne 0x408756
push 0x8e
mov ecx, 0x424040
call fcn.004069e0
test esi, esi
je 0x4087f5
push 0x400
push edi
push 0x8e
mov ecx, 0x424040
call fcn.00406920
mov edi, 0x417368
or ecx, ebx
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
xor eax, eax
rep movsb byte es:[edi], byte [esi]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x370
ret 4
push eax
push 0x8f
push 0x424040
call fcn.00406a60
add esp, 0xc
test esi, esi
je 0x4087a7
mov ecx, dword [esp + 0x14]
push ecx
push 0x8f
push edi
push 0x424040
call fcn.00406ac0
mov edi, 0x417368
or ecx, 0xffffffff
xor eax, eax
add esp, 0x10
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x10]
push ebx
call sub.WSOCK32.dll_closesocket
mov esi, dword [sym.imp.KERNEL32.dll_InterlockedExchange]
lea eax, [edi + 0x1440]
push 0
push eax
call esi
push 0x94
mov ecx, 0x424040
call fcn.004069e0
push 0
push 0x424058
call esi
mov eax, dword [edi + 0x1428]
test eax, eax
je 0x4087eb
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov dword [edi + 0x1428], 0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x370
ret 4
lea eax, [esp + 0x18]
push 4
push eax
push 0x20
push 0xffff
push ebx
mov dword [esp + 0x2c], 1
call sub.WSOCK32.dll_setsockopt
test eax, eax
je 0x408857
call sub.WSOCK32.dll_WSAGetLastError
push eax
push 0x90
push 0x424040
mov dword [esp + 0x20], eax
call fcn.00406a60
add esp, 0xc
test esi, esi
je 0x4087a7
mov ecx, dword [esp + 0x14]
push ecx
push 0x90
jmp 0x408777
mov ecx, dword [esp + 0x10]
xor eax, eax
mov dword [esp + 0x20], eax
mov word [esp + 0x20], 6
mov dx, word [ecx + 4]
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
push edx
mov word [esp + 0x30], ax
call sub.WSOCK32.dll_htons
mov word [esp + 0x2c], ax
lea eax, [esp + 0x20]
push 0xe
push eax
push ebx
call sub.WSOCK32.dll_bind
test eax, eax
je 0x4088c8
call sub.WSOCK32.dll_WSAGetLastError
push eax
push 0x91
push 0x424040
mov dword [esp + 0x20], eax
call fcn.00406a60
add esp, 0xc
test esi, esi
je 0x4087a7
mov ecx, dword [esp + 0x14]
push ecx
push 0x91
jmp 0x408777
test esi, esi
je 0x4088ee
mov edi, 0x417370
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x10]
mov ecx, dword [edi + 4]
push ecx
push 0x92
push 0x424040
call fcn.00406a60
add esp, 0xc
mov ebp, 1
lea edx, [edi + 0x1440]
push ebp
push edx
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
mov eax, dword [0x424058]
test eax, eax
jne 0x4087ab
mov eax, dword [edi + 0x10]
lea ecx, [esp + 0x30]
push ecx
push 0
lea edx, [esp + 0x284]
push 0
push edx
push 0
mov dword [esp + 0x294], ebx
mov dword [esp + 0x290], ebp
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], 0
mov dword [esp + 0x30], 0x10
call sub.WSOCK32.dll_select
test eax, eax
je 0x40891b
cmp eax, 0xffffffff
je 0x40891b
xor eax, eax
lea ecx, [esp + 0x1c]
mov dword [esp + 0x68], eax
lea edx, [esp + 0x68]
mov dword [esp + 0x6c], eax
push ecx
mov dword [esp + 0x74], eax
push edx
mov dword [esp + 0x7c], eax
push eax
lea eax, [esp + 0x88]
push 0x200
push eax
push ebx
call sub.WSOCK32.dll_recvfrom
mov esi, eax
cmp esi, 0xffffffff
jne 0x4089c2
call sub.WSOCK32.dll_WSAGetLastError
push eax
push 0x93
push 0x424040
call fcn.00406a60
add esp, 0xc
jmp 0x40891b
lea ecx, [esp + 0x38]
lea edx, [esp + 0x6e]
push ecx
push edx
call fcn.00409b50
lea eax, [esp + 0x70]
push esi
push eax
call fcn.00409a50
add esp, 0x10
test eax, eax
je 0x40891b
lea ecx, [esp + 0x68]
push 0x10
push ecx
push 0
lea edx, [esp + 0x88]
push eax
push edx
push ebx
call sub.WSOCK32.dll_sendto
cmp eax, 0xffffffff
jne 0x40891b
call sub.WSOCK32.dll_WSAGetLastError
push eax
push 0x7c
push 0x424040
call fcn.00406a60
add esp, 0xc
jmp 0x40891b