Function at 0x10020870
Capabilities:
Create tcp socket
Create thread
Create udp socket
Set socket configuration

Disassembly:
push ebp
lea ebp, [esp - 0x20c]
sub esp, 0x20c
push 0xfffffffffffffffe
push 0x10185dd8
push 0x10132540
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
mov eax, dword [0x10189710]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp + 0x208], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov dword [ebp - 0x18], esp
mov ebx, ecx
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 4], 0
call fcn.10016ab0
or edi, 0xffffffff
mov dword [ebx + 0x120], edi
mov dword [ebx + 0x11c], edi
push 6
push 1
push 2
call sub.WS2_32.dll_socket
mov dword [ebx + 0x11c], eax
cmp eax, edi
jne 0x1002091c
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebx + 0x150], eax
push 0x104
mov edi, eax
lea esi, [ebp + 0x104]
call fcn.100652a0
mov eax, esi
push eax
push str._COMM__Failure_to_create_TCP_Listen_Socket__Error:__s
call fcn.10017540
add esp, 0xc
jmp 0x10020eb6
cmp dword [ebp + 0x214], 0
je 0x100209af
mov dword [ebp - 0x24], 1
lea ecx, [ebp - 0x24]
push ecx
push str.EServEventsOnlyTCP
mov ecx, str.SoftwareMicroWorld
mov edx, reloc.WS2_32.dll_bind
call fcn.10059e30
test al, al
jne 0x10020966
mov eax, dword [ebp - 0x24]
mov esi, str.EServEventsOnlyTCP
mov ebx, str.SoftwareMicroWorld
mov ecx, reloc.WS2_32.dll_bind
call fcn.10059bf0
mov ebx, dword [ebp - 0x2c]
cmp dword [ebp - 0x24], 0
jne 0x100209af
push 0x11
push 2
push 2
call sub.WS2_32.dll_socket
mov dword [ebx + 0x120], eax
cmp eax, edi
jne 0x100209af
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebx + 0x150], eax
push 0x104
mov edi, eax
lea esi, [ebp + 0x104]
call fcn.100652a0
mov edx, esi
push edx
push str._COMM__Failure_to_create_UDP_Listen_Socket__Error:__s
call fcn.10017540
add esp, 0xc
cmp dword [ebx + 0x11c], 0xffffffff
je 0x10020b24
movzx eax, word [ebx + 0x138]
push eax
call sub.WS2_32.dll_htons
mov word [ebx + 0x12a], ax
lea esi, [ebx + 0x128]
mov ecx, 2
mov word [esi], cx
lea eax, [ebx + 0x13a]
push eax
call sub.WS2_32.dll_inet_addr
mov dword [ebx + 0x12c], eax
push 0x10
push esi
mov edx, dword [ebx + 0x11c]
push edx
call sub.WS2_32.dll_bind
mov edi, eax
mov dword [ebp - 0x20], edi
cmp edi, 0xffffffff
jne 0x10020af6
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2740
jne 0x10020a7e
mov dword [ebp - 0x1c], 0
cmp dword [ebp - 0x1c], 5
jge 0x10020a7e
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
movzx eax, word [ebx + 0x138]
push eax
call sub.WS2_32.dll_htons
mov word [ebx + 0x12a], ax
mov ecx, 2
mov word [esi], cx
lea eax, [ebx + 0x13a]
push eax
call sub.WS2_32.dll_inet_addr
mov dword [ebx + 0x12c], eax
push 0x10
push esi
mov edx, dword [ebx + 0x11c]
push edx
call sub.WS2_32.dll_bind
mov edi, eax
mov dword [ebp - 0x20], edi
cmp edi, 0xffffffff
jne 0x10020af6
inc dword [ebp - 0x1c]
jmp 0x10020a21
cmp edi, 0xffffffff
jne 0x10020af6
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebx + 0x150], eax
push 0x104
mov edi, eax
lea esi, [ebp + 0x104]
call fcn.100652a0
mov eax, esi
push eax
movzx ecx, word [ebx + 0x138]
push ecx
lea eax, [ebx + 0x13a]
push eax
push str._COMM__Failure_to_Bind_to_TCP_Listen_Socket___s:_u___Error:__s
lea edx, [ebp]
push edx
call fcn.10127dc0
lea eax, [ebp]
push eax
push 0x1014d8cc
call fcn.10017540
add esp, 0x20
mov eax, dword [ebx + 0x11c]
cmp eax, 0xffffffff
je 0x10020eb6
push eax
call sub.WS2_32.dll_closesocket
mov dword [ebx + 0x11c], 0xffffffff
jmp 0x10020eb6
movzx ecx, word [ebx + 0x138]
push ecx
lea eax, [ebx + 0x13a]
push eax
push str._COMM__TCP_Listener_started___s:_u_
lea edx, [ebp]
push edx
call fcn.10127dc0
lea eax, [ebp]
push eax
push 0x1014d8cc
call fcn.10017540
add esp, 0x18
cmp dword [ebx + 0x120], 0xffffffff
je 0x10020c9e
movzx ecx, word [ebx + 0x138]
push ecx
call sub.WS2_32.dll_htons
mov word [ebx + 0x12a], ax
lea esi, [ebx + 0x128]
mov edx, 2
mov word [esi], dx
lea eax, [ebx + 0x13a]
push eax
call sub.WS2_32.dll_inet_addr
mov dword [ebx + 0x12c], eax
push 0x10
push esi
mov eax, dword [ebx + 0x120]
push eax
call sub.WS2_32.dll_bind
mov edi, eax
mov dword [ebp - 0x20], edi
cmp edi, 0xffffffff
jne 0x10020c64
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2740
jne 0x10020bf3
mov dword [ebp - 0x1c], 0
cmp dword [ebp - 0x1c], 5
jge 0x10020bf3
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
movzx ecx, word [ebx + 0x138]
push ecx
call sub.WS2_32.dll_htons
mov word [ebx + 0x12a], ax
mov edx, 2
mov word [esi], dx
lea eax, [ebx + 0x13a]
push eax
call sub.WS2_32.dll_inet_addr
mov dword [ebx + 0x12c], eax
push 0x10
push esi
mov eax, dword [ebx + 0x120]
push eax
call sub.WS2_32.dll_bind
mov edi, eax
mov dword [ebp - 0x20], edi
cmp edi, 0xffffffff
jne 0x10020c64
inc dword [ebp - 0x1c]
jmp 0x10020b96
cmp edi, 0xffffffff
jne 0x10020c64
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebx + 0x150], eax
push 0x104
mov edi, eax
lea esi, [ebp + 0x104]
call fcn.100652a0
mov ecx, esi
push ecx
movzx edx, word [ebx + 0x138]
push edx
lea eax, [ebx + 0x13a]
push eax
push str._COMM__Failure_to_Bind_to_UDP_Listen_Socket___s:_u___Error:__s
lea eax, [ebp]
push eax
call fcn.10127dc0
lea ecx, [ebp]
push ecx
push 0x1014d8cc
call fcn.10017540
add esp, 0x20
mov eax, dword [ebx + 0x120]
cmp eax, 0xffffffff
je 0x10020c9e
push eax
call sub.WS2_32.dll_closesocket
mov dword [ebx + 0x120], 0xffffffff
jmp 0x10020c9e
mov edx, dword [ebx + 0x120]
call fcn.10020830
push eax
movzx edx, word [ebx + 0x138]
push edx
lea eax, [ebx + 0x13a]
push eax
push str._COMM__UDP_Listener_started___s:_u_._UDP_MaxLen:_u_bytes
lea eax, [ebp]
push eax
call fcn.10127dc0
lea ecx, [ebp]
push ecx
push 0x1014d8cc
call fcn.10017540
add esp, 0x1c
mov dword [ebp - 0x28], 1
push 4
lea edx, [ebp - 0x28]
push edx
push 4
push 0xffff
mov eax, dword [ebx + 0x11c]
push eax
mov esi, dword [sym.imp.WS2_32.dll_setsockopt]
call esi
cmp eax, 0xffffffff
jne 0x10020cf9
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebx + 0x150], eax
push 0x104
mov edi, eax
lea esi, [ebp + 0x104]
call fcn.100652a0
mov ecx, esi
push ecx
push str._COMM__SetSockOpt_failed__Error:__s
call fcn.10017540
add esp, 0xc
jmp 0x10020ad2
mov eax, dword [ebx + 0x120]
cmp eax, 0xffffffff
je 0x10020d14
push 4
lea edx, [ebp - 0x28]
push edx
push 4
push 0xffff
push eax
call esi
push bind
mov eax, dword [ebx + 0x11c]
push eax
call dword [sym.imp.WS2_32.dll_listen]
mov dword [ebp - 0x20], eax
cmp eax, 0xffffffff
jne 0x10020d8f
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebx + 0x150], eax
push 0x104
mov edi, eax
lea esi, [ebp + 0x104]
call fcn.100652a0
mov ecx, esi
push ecx
push str._COMM__Listen_on_socket_failed__Error:__s
call fcn.10017540
add esp, 0xc
mov eax, dword [ebx + 0x11c]
cmp eax, 0xffffffff
je 0x10020eb6
push 2
push eax
call dword [sym.imp.WS2_32.dll_shutdown]
mov edx, dword [ebx + 0x11c]
push edx
call sub.WS2_32.dll_closesocket
mov dword [ebx + 0x11c], 0xffffffff
jmp 0x10020eb6
push ebx
push 0
push 0x100201c0
call fcn.10127f7d
add esp, 0xc
cmp eax, 0xffffffff
jne 0x10020e05
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebx + 0x150], eax
push 0x104
mov edi, eax
lea esi, [ebp + 0x104]
call fcn.100652a0
mov eax, esi
push eax
push str._COMM__ThreadCreation_of_CommServerListenThreadTCP_failed__Error:__s
call fcn.10017540
add esp, 0xc
mov eax, dword [ebx + 0x11c]
cmp eax, 0xffffffff
je 0x10020eb6
push 2
push eax
call dword [sym.imp.WS2_32.dll_shutdown]
mov ecx, dword [ebx + 0x11c]
push ecx
call sub.WS2_32.dll_closesocket
mov dword [ebx + 0x11c], 0xffffffff
jmp 0x10020eb6
cmp dword [ebx + 0x120], 0xffffffff
je 0x10020e80
push ebx
push 0
push 0x1001fe50
call fcn.10127f7d
add esp, 0xc
cmp eax, 0xffffffff
jne 0x10020e80
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebx + 0x150], eax
push 0x104
mov edi, eax
lea esi, [ebp + 0x104]
call fcn.100652a0
mov edx, esi
push edx
push str._COMM__ThreadCreation_of_CommServerListenThreadUDP_failed__Error:__s
call fcn.10017540
add esp, 0xc
mov eax, dword [ebx + 0x120]
cmp eax, 0xffffffff
je 0x10020e80
push 2
push eax
call dword [sym.imp.WS2_32.dll_shutdown]
mov eax, dword [ebx + 0x120]
push eax
call sub.WS2_32.dll_closesocket
mov dword [ebx + 0x120], 0xffffffff
jmp 0x10020e80
cmp dword [ebx + 0x114], 0
jne 0x10020e90
call fcn.1005a8a0
jmp 0x10020e80
mov dword [ebp - 4], 0xfffffffe
mov eax, 1
jmp 0x10020ebf
mov dword [ebp - 4], 0xfffffffe
xor eax, eax
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x208]
xor ecx, ebp
call fcn.10127db1
add ebp, 0x20c
mov esp, ebp
pop ebp
ret