Function at 0x5020b0
Capabilities:
Create tcp socket
Create thread
Create udp socket

Disassembly:
sub esp, 0x3c
mov eax, dword [0x632f90]
xor eax, esp
mov dword [esp + 0x38], eax
cmp dword [0x6452e4], 0
push ebx
mov ebx, dword [esp + 0x44]
push esi
push edi
jne 0x502208
push 0
push 1
push 2
mov dword [esp + 0x20], 0xb5367df1
mov dword [esp + 0x24], 0x11cfcbac
mov dword [esp + 0x28], 0x8000ca95
mov dword [esp + 0x2c], 0x92a1485f
mov dword [esp + 0x30], 0x25a207b9
mov dword [esp + 0x34], 0x4660ddf3
mov dword [esp + 0x38], 0xe576e98e
mov dword [esp + 0x3c], 0x3e06748c
mov dword [esp + 0x40], 0xb5367df2
mov dword [esp + 0x44], 0x11cfcbac
mov dword [esp + 0x48], 0x8000ca95
mov dword [esp + 0x4c], 0x92a1485f
call dword [sym.imp.WS2_32.dll_socket]
mov edi, eax
cmp edi, 0xffffffff
je 0x502208
mov esi, dword [sym.imp.WS2_32.dll_WSAIoctl]
lea eax, [esp + 0x10]
push 0
push 0
push eax
push 4
lea eax, [esp + 0x1c]
mov dword [esp + 0x1c], 0
push eax
push 0x10
lea eax, [esp + 0x2c]
mov dword [esp + 0x28], 0
push eax
push 0xc8000006
push edi
call esi
mov eax, dword [esp + 0xc]
push 0
push 0
mov dword [0x6452e8], eax
lea eax, [esp + 0x18]
push eax
push 4
lea eax, [esp + 0x1c]
mov dword [esp + 0x1c], 0
push eax
push 0x10
lea eax, [esp + 0x3c]
mov dword [esp + 0x28], 0
push eax
push 0xc8000006
push edi
call esi
mov eax, dword [esp + 0xc]
push 0
push 0
mov dword [0x6452ec], eax
lea eax, [esp + 0x18]
push eax
push 4
lea eax, [esp + 0x1c]
mov dword [esp + 0x1c], 0
push eax
push 0x10
lea eax, [esp + 0x4c]
mov dword [esp + 0x28], 0
push eax
push 0xc8000006
push edi
call esi
mov eax, dword [esp + 0xc]
push edi
mov dword [0x6452f0], eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [0x6452e4], 1
push 0x30
push 1
call fcn.004ef2c0
mov esi, eax
add esp, 8
test esi, esi
je 0x5022fd
test ebx, ebx
mov edi, 2
push 4
cmovg edi, ebx
lea eax, [edi + edi]
mov word [esi + 0x1c], ax
cwde
push eax
call fcn.004ef2c0
add esp, 8
mov dword [esi + 0x24], eax
test eax, eax
je 0x5022cb
push edi
push 0
push 0
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CreateIoCompletionPort]
mov dword [esi], eax
mov dword [esi + 0x20], 0xffffffff
test eax, eax
je 0x5022cb
push 0
push 1
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateSemaphoreA]
mov dword [esi + 0x2c], eax
test eax, eax
je 0x5022cb
xor eax, eax
xor edi, edi
cmp ax, word [esi + 0x1c]
jge 0x5022a8
nop
push esi
push 0
push 0x502440
call fcn.0056c51a
add esp, 0xc
cmp eax, 0xffffffff
je 0x5022cb
mov ecx, dword [esi + 0x24]
mov dword [ecx + edi*4], eax
inc edi
inc word [esi + 0x28]
movsx eax, word [esi + 0x1c]
cmp edi, eax
jl 0x502280
push 0x3e8
lea eax, [esi + 4]
push eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSectionAndSpinCount]
pop edi
mov eax, esi
pop esi
pop ebx
mov ecx, dword [esp + 0x38]
xor ecx, esp
call fcn.00526f37
add esp, 0x3c
ret
mov eax, dword [esi]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x5022da
push eax
call edi
mov eax, dword [esi + 0x24]
test eax, eax
je 0x5022ea
push eax
call fcn.004ef3b0
add esp, 4
mov eax, dword [esi + 0x2c]
test eax, eax
je 0x5022f4
push eax
call edi
push esi
call fcn.004ef3b0
add esp, 4
mov ecx, dword [esp + 0x44]
xor eax, eax
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00526f37
add esp, 0x3c
ret