Function at 0x500830
Capabilities:
Create tcp socket
Create udp socket

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffc0
xor edx, edx
mov dword [ebp - 0x40], edx
mov dword [ebp - 0x3c], edx
mov dword [ebp - 0x38], edx
mov dword [ebp - 0x34], edx
mov dword [ebp - 0x30], edx
mov dword [ebp - 4], eax
xor eax, eax
push ebp
push 0x500ab2
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 4]
cmp dword [eax + 0x1c1], 0
jne 0x50087a
mov ecx, 0x500ac8
mov dl, 1
mov eax, dword [0x40b6f8]
call fcn.004110b0
call fcn.00404cf0
mov eax, dword [ebp - 4]
mov word [eax + 0x20], 2
mov eax, dword [ebp - 4]
xor edx, edx
mov dword [eax + 0x24], edx
mov eax, 0x500adc
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
push eax
call sub.wsock32.dll_getprotobyname
mov edx, dword [ebp - 4]
mov dword [edx + 0x18], eax
mov eax, dword [ebp - 4]
cmp dword [eax + 0x18], 0
jne 0x5008e7
mov eax, 0x500ae0
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
push eax
call sub.wsock32.dll_getprotobyname
mov edx, dword [ebp - 4]
mov dword [edx + 0x18], eax
mov eax, dword [ebp - 4]
cmp dword [eax + 0x18], 0
jne 0x5008d5
mov eax, dword [ebp - 4]
xor edx, edx
mov dword [eax + 0x1c], edx
jmp 0x5008f7
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x18]
movsx eax, word [eax + 8]
mov edx, dword [ebp - 4]
mov dword [edx + 0x1c], eax
jmp 0x5008f7
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x18]
movsx eax, word [eax + 8]
mov edx, dword [ebp - 4]
mov dword [edx + 0x1c], eax
lea eax, [ebp - 0x2c]
mov edx, dword [ebp - 4]
mov edx, dword [edx + 0x1c1]
call fcn.0040db68
mov eax, dword [ebp - 0xc]
push eax
lea eax, [ebp - 0x2c]
push eax
call sub.wsock32.dll_getservbyname
mov edx, dword [ebp - 4]
mov dword [edx + 0x10], eax
mov eax, dword [ebp - 4]
cmp dword [eax + 0x10], 0
jne 0x500946
lea edx, [ebp - 0x30]
lea eax, [ebp - 0x2c]
call fcn.0040dcd8
mov eax, dword [ebp - 0x30]
call fcn.0040c9e4
push eax
call sub.wsock32.dll_htons
mov edx, dword [ebp - 4]
mov word [edx + 0x22], ax
jmp 0x500957
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x10]
mov ax, word [eax + 8]
mov edx, dword [ebp - 4]
mov word [edx + 0x22], ax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x1c]
push eax
push 1
push 2
call sub.wsock32.dll_socket
mov edx, dword [ebp - 4]
mov dword [edx + 0x1c9], eax
mov eax, dword [ebp - 4]
cmp dword [eax + 0x1c9], 0
jge 0x5009a8
lea eax, [ebp - 0x34]
push eax
call sub.wsock32.dll_WSAGetLastError
mov ecx, eax
mov edx, 6
mov eax, dword [ebp - 4]
call fcn.00500cf0
mov ecx, dword [ebp - 0x34]
mov dl, 1
mov eax, dword [0x40b6f8]
call fcn.004110b0
call fcn.00404cf0
push 0x10
mov eax, dword [ebp - 4]
add eax, 0x20
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x1c9]
push eax
call sub.wsock32.dll_bind
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x5009f5
lea eax, [ebp - 0x38]
push eax
call sub.wsock32.dll_WSAGetLastError
mov ecx, eax
mov edx, 7
mov eax, dword [ebp - 4]
call fcn.00500cf0
mov ecx, dword [ebp - 0x38]
mov dl, 1
mov eax, dword [0x40b6f8]
call fcn.004110b0
call fcn.00404cf0
push 5
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x1c9]
push eax
call sub.wsock32.dll_listen
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x500a3b
lea eax, [ebp - 0x3c]
push eax
call sub.wsock32.dll_WSAGetLastError
mov ecx, eax
mov edx, 8
mov eax, dword [ebp - 4]
call fcn.00500cf0
mov ecx, dword [ebp - 0x3c]
mov dl, 1
mov eax, dword [0x40b6f8]
call fcn.004110b0
call fcn.00404cf0
push 0x2b
push 0x400
mov eax, dword [ebp - 4]
call fcn.004ff6ec
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x1c9]
push eax
call sub.wsock32.dll_WSAAsyncSelect
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x500a97
mov eax, dword [ebp - 4]
call fcn.00500ae4
lea eax, [ebp - 0x40]
push eax
call sub.wsock32.dll_WSAGetLastError
mov ecx, eax
mov edx, 9
mov eax, dword [ebp - 4]
call fcn.00500cf0
mov ecx, dword [ebp - 0x40]
mov dl, 1
mov eax, dword [0x40b6f8]
call fcn.004110b0
call fcn.00404cf0
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x500ab9
lea eax, [ebp - 0x40]
mov edx, 5
call fcn.004053c0
ret