Function at 0x5051d0
Capabilities:
Create raw socket
Create tcp socket
Create udp socket
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push 0xffffffffffffffff
push 0x5cf36c
mov eax, dword fs:[0]
push eax
sub esp, 0x2c8
mov eax, dword [0x65b4e4]
xor eax, esp
mov dword [esp + 0x2c4], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x65b4e4]
xor eax, esp
push eax
lea eax, [esp + 0x2dc]
mov dword fs:[0], eax
push 1
push 3
mov edi, 2
push edi
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
jne 0x5052f2
push 1
push edi
lea ecx, [esp + 0x28]
call fcn.0040b160
mov dword [esp + 0x2e4], 0
call sub.WS2_32.dll_WSAGetLastError
push eax
lea eax, [esp + 0x24]
push str.socket:
push eax
call fcn.00409c80
add esp, 8
mov ecx, eax
call fcn.0041c060
lea ecx, [esp + 0x1b4]
push ecx
lea ecx, [esp + 0x24]
call fcn.00409610
mov esi, 0x10
cmp dword [eax + 0x18], esi
mov byte [esp + 0x2e4], 1
jb 0x505284
mov eax, dword [eax + 4]
jmp 0x505287
add eax, 4
push eax
push str.BaseLib::SocketPing
push 0x1280
push str..common_function.cpp
push 0xf0000000
call fcn.00409980
mov ecx, eax
call fcn.004fa910
cmp dword [esp + 0x1cc], esi
jb 0x5052c1
mov edx, dword [esp + 0x1b8]
push edx
call fcn.00594e98
add esp, 4
lea ecx, [esp + 0x6c]
mov dword [esp + 0x2e4], 0xffffffff
call fcn.00409f20
lea eax, [esp + 0x6c]
push eax
mov dword [esp + 0x70], vtable.std::ios_base.0
call fcn.005cccbe
add esp, 4
or eax, 0xffffffff
jmp 0x50559e
xor eax, eax
xor ebx, ebx
mov dword [esp + 0x1a4], eax
push ebx
mov dword [esp + 0x1ac], eax
mov dword [esp + 0x1b0], eax
mov dword [esp + 0x1b4], eax
mov word [esp + 0x1a8], di
call dword [sym.imp.WS2_32.dll_htons]
mov ecx, dword [esp + 0x2ec]
mov word [esp + 0x1a6], ax
xor eax, eax
mov dword [esp + 0x2b5], eax
mov dword [esp + 0x1a8], ecx
mov dword [esp + 0x2b9], eax
mov dword [esp + 0x2bd], eax
mov dword [esp + 0x2c1], eax
mov dword [esp + 0x2c5], eax
mov dword [esp + 0x2c9], eax
mov dword [esp + 0x2cd], eax
mov dword [esp + 0x2d1], eax
mov byte [esp + 0x2b4], 8
mov byte [esp + 0x2b5], bl
mov word [esp + 0x2b6], bx
call sub.KERNEL32.dll_GetCurrentProcessId
mov word [esp + 0x2b8], ax
mov word [esp + 0x2ba], 1
lea eax, [esp + 0x2b4]
xor ecx, ecx
mov edx, 4
lea ecx, [ecx]
movzx ebp, word [eax]
add ecx, ebp
add eax, edi
sub edx, 1
jne 0x5053b0
mov eax, ecx
sar eax, 0x10
and ecx, 0xffff
add eax, ecx
mov edx, eax
sar edx, 0x10
add eax, edx
not eax
mov word [esp + 0x2b6], ax
mov ebp, 0x10
push ebp
lea eax, [esp + 0x1a8]
push eax
push ebx
push 0x21
lea ecx, [esp + 0x2c4]
push ecx
push esi
call dword [sym.imp.WS2_32.dll_sendto]
test eax, eax
jge 0x5054cc
push 1
push edi
lea ecx, [esp + 0x28]
call fcn.0040b160
mov dword [esp + 0x2e4], edi
call sub.WS2_32.dll_WSAGetLastError
push eax
lea edx, [esp + 0x24]
push str.sendto:
push edx
call fcn.00409c80
add esp, 8
mov ecx, eax
call fcn.0041c060
lea eax, [esp + 0x1b4]
push eax
lea ecx, [esp + 0x24]
call fcn.00409610
cmp dword [eax + 0x18], ebp
mov byte [esp + 0x2e4], 3
jb 0x505457
mov eax, dword [eax + 4]
jmp 0x50545a
add eax, 4
push eax
push str.BaseLib::SocketPing
push 0x12a7
push str..common_function.cpp
push 0xf0000000
call fcn.00409980
mov ecx, eax
call fcn.004fa910
cmp dword [esp + 0x1cc], ebp
jb 0x505494
mov ecx, dword [esp + 0x1b8]
push ecx
call fcn.00594e98
add esp, 4
lea ecx, [esp + 0x6c]
mov dword [esp + 0x2e4], 0xffffffff
call fcn.00409f20
lea edx, [esp + 0x6c]
push edx
mov dword [esp + 0x70], vtable.std::ios_base.0
call fcn.005cccbe
add esp, 4
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
or eax, 0xffffffff
jmp 0x50559e
mov edi, dword [sym.imp.WS2_32.dll_recvfrom]
lea ebp, [esi + 1]
jmp 0x5054e0
mov eax, 1
mov dword [esp + 0x18], eax
mov dword [esp + 0xa0], eax
lea eax, [esp + 0x18]
push eax
push ebx
push ebx
lea ecx, [esp + 0xac]
push ecx
push ebp
mov dword [esp + 0x30], ebx
mov dword [esp + 0xb8], esi
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jle 0x50558b
lea edx, [esp + 0x14]
push edx
lea eax, [esp + 0x1b8]
push eax
push ebx
push 0xe4
lea ecx, [esp + 0x1e0]
push ecx
push esi
mov word [esp + 0x1fe], bx
mov word [esp + 0x200], bx
mov word [esp + 0x202], bx
mov dword [esp + 0x2c], 0x10
call edi
cmp eax, 0xffffffff
je 0x505592
cmp byte [esp + 0x1d9], 1
jne 0x5054e0
cmp byte [esp + 0x1e4], bl
jne 0x5054e0
mov dx, word [esp + 0x1e8]
cmp dx, word [esp + 0x2b8]
jne 0x5054e0
jmp 0x505595
mov ebx, 1
jmp 0x505595
or ebx, 0xffffffff
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, ebx
mov ecx, dword [esp + 0x2dc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x2c4]
xor ecx, esp
call fcn.005b0968
add esp, 0x2d4
ret