Function at 0x4023a0
Capabilities:
Create tcp socket
Create thread
Create udp socket
Set socket configuration
Start tcp server

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [0x421c24]
xor eax, ebp
mov dword [ebp - 4], eax
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x20]
mov dword [eax + 0x34], ecx
cmp dword [ebp - 0x20], 0
jge 0x40240a
mov edx, dword [ebp + 8]
movzx eax, byte [edx + 0x48]
test eax, eax
je 0x402402
call fcn.00408a7c
mov ecx, dword [eax]
push ecx
call fcn.004088a9
add esp, 4
push eax
push str.Cannot_create_socket_server:__s_n
push 2
call fcn.00406578
add esp, 4
push eax
call fcn.00401950
add esp, 0xc
or eax, 0xffffffff
jmp 0x4025a5
mov dword [ebp - 0x24], 1
push 4
lea edx, [ebp - 0x24]
push edx
push 4
push 0xffff
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x34]
push ecx
call dword [sym.imp.WS2_32.dll_setsockopt]
mov edx, dword [ebp + 8]
mov dword [edx + 0x3c], 0
mov eax, dword [ebp + 8]
movzx ecx, word [eax + 0x32]
push ecx
call dword [sym.imp.WS2_32.dll_htons]
mov edx, dword [ebp + 8]
mov word [edx + 0x3a], ax
mov eax, 2
mov ecx, dword [ebp + 8]
mov word [ecx + 0x38], ax
push 0x10
mov edx, dword [ebp + 8]
add edx, 0x38
push edx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x34]
push ecx
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
jge 0x4024b6
mov edx, dword [ebp + 8]
movzx eax, byte [edx + 0x48]
test eax, eax
je 0x4024ac
call fcn.00408a7c
mov ecx, dword [eax]
push ecx
call fcn.004088a9
add esp, 4
push eax
mov edx, dword [ebp + 8]
movzx eax, word [edx + 0x32]
push eax
push str.Failed_to_bind_on_port__d:__s_n
push 2
call fcn.00406578
add esp, 4
push eax
call fcn.00401950
add esp, 0x10
mov eax, 0xfffffffe
jmp 0x4025a5
push 0x40
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x34]
push edx
call dword [sym.imp.WS2_32.dll_listen]
mov eax, 1
test eax, eax
je 0x4025a5
mov dword [ebp - 0x28], 0x10
mov dword [ebp - 0x18], 0
lea ecx, [ebp - 0x28]
push ecx
lea edx, [ebp - 0x14]
push edx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x34]
push ecx
call dword [sym.imp.WS2_32.dll_accept]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jge 0x402534
mov edx, dword [ebp + 8]
movzx eax, byte [edx + 0x48]
test eax, eax
je 0x402532
call fcn.00408a7c
mov ecx, dword [eax]
push ecx
call fcn.004088a9
add esp, 4
push eax
push str.Failed_to_accept_on_SOCKS5_server_:__s_n
push 2
call fcn.00406578
add esp, 4
push eax
call fcn.00401950
add esp, 0xc
jmp 0x4024c5
lea edx, [ebp - 0x14]
push edx
mov eax, dword [ebp - 0x18]
push eax
mov ecx, dword [ebp + 8]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x4c]
call eax
add esp, 0xc
push 0x18
call fcn.004089d4
add esp, 4
mov dword [ebp - 0x1c], eax
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x18]
mov dword [ecx + 4], edx
mov eax, dword [ebp - 0x1c]
add eax, 8
mov ecx, dword [ebp - 0x14]
mov dword [eax], ecx
mov edx, dword [ebp - 0x10]
mov dword [eax + 4], edx
mov ecx, dword [ebp - 0xc]
mov dword [eax + 8], ecx
mov edx, dword [ebp - 8]
mov dword [eax + 0xc], edx
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp + 8]
mov dword [eax], ecx
push 0
push 0
mov edx, dword [ebp - 0x1c]
push edx
push 0x401b50
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [ebp - 0x2c], eax
jmp 0x4024c5
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00403553
mov esp, ebp
pop ebp
ret