Function at 0x405320
Capabilities:
Create tcp socket
Create thread
Create udp socket
Get hostname
Resolve dns

Disassembly:
sub esp, 0xc4
push ebx
push esi
push edi
push 1
push 0
push 0
push 6
push 1
push 2
mov ebx, ecx
call dword [sym.imp.WS2_32.dll_WSASocketA]
cmp eax, 0xffffffff
mov dword [ebx + 0x88], eax
jne 0x40537e
call fcn.00405c70
mov esi, eax
mov edi, dword [esi]
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.CServer::StartListenThread_WSASocket_failed._Error_code_:__d
push esi
call dword [edi + 4]
add esp, 0xc
call dword [sym.imp.WS2_32.dll_WSACleanup]
pop edi
pop esi
mov byte [ebx + 0x8e], 0
or eax, 0xffffffff
pop ebx
add esp, 0xc4
ret
call fcn.00405c70
mov ecx, dword [eax]
push str.WSASocket_OK
push eax
call dword [ecx + 4]
add esp, 8
call fcn.00407b40
mov ecx, eax
call fcn.00407860
call fcn.00407b40
mov ecx, eax
call fcn.00407860
push eax
call dword [sym.imp.WS2_32.dll_inet_addr]
cmp eax, 0xffffffff
mov dword [esp + 0x40], eax
jne 0x4053d8
call fcn.00405c70
mov edx, dword [eax]
push str.inet_addr_error
push eax
call dword [edx + 4]
add esp, 8
push 0
call dword [sym.imp.WS2_32.dll_htonl]
mov dword [esp + 0x40], eax
xor eax, eax
mov ax, word [ebx + 0x98]
mov word [esp + 0x3c], 2
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov edx, dword [ebx + 0x88]
push 0x10
lea ecx, [esp + 0x40]
push ecx
push edx
mov word [esp + 0x4a], ax
call dword [sym.imp.WS2_32.dll_bind]
cmp eax, 0xffffffff
jne 0x40543b
call fcn.00405c70
mov esi, eax
mov edi, dword [esi]
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.bind_Error._Error_Code:_d
push esi
call dword [edi + 4]
mov eax, dword [ebx + 0x88]
add esp, 0xc
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
jmp 0x405364
call fcn.00405c70
mov ecx, dword [eax]
push str.Bind_OK
push eax
call dword [ecx + 4]
mov byte [esp + 0x58], 0
xor eax, eax
mov ecx, 0x1f
lea edi, [esp + 0x59]
rep stosd dword es:[edi], eax
add esp, 8
stosw word es:[edi], ax
push 0x80
lea edx, [esp + 0x54]
push edx
stosb byte es:[edi], al
call dword [sym.imp.WS2_32.dll_gethostname]
test eax, eax
jne 0x405588
lea eax, [esp + 0x50]
push eax
call dword [sym.imp.WS2_32.dll_gethostbyname]
mov edi, eax
test edi, edi
je 0x405588
push ebp
xor ebp, ebp
mov ecx, dword [edi + 0xc]
cmp dword [ecx + ebp], 0
je 0x405587
xor edx, edx
mov dword [esp + 0x11], edx
mov dword [esp + 0x15], edx
mov dword [esp + 0x19], edx
xor esi, esi
cmp word [edi + 0xa], si
mov dword [esp + 0x1d], edx
mov byte [esp + 0x10], 0
mov dword [esp + 0x21], edx
jle 0x40557f
xor eax, eax
test esi, esi
mov dword [esp + 0x29], eax
mov dword [esp + 0x2d], eax
mov dword [esp + 0x31], eax
mov dword [esp + 0x35], eax
mov byte [esp + 0x28], 0
mov dword [esp + 0x39], eax
jle 0x40551d
mov ecx, 0x14
lea eax, [esp + 0x10]
nop
cmp byte [eax], 0
je 0x4054fb
inc eax
dec ecx
jne 0x4054f0
jmp 0x40551d
test ecx, ecx
je 0x40551d
mov eax, 0x14
sub eax, ecx
push 0x4febcc
mov ecx, 0x14
sub ecx, eax
push ecx
lea edx, [esp + eax + 0x18]
push edx
call fcn.00401bc0
mov eax, dword [edi + 0xc]
mov ecx, dword [eax + ebp]
movzx edx, byte [ecx + esi]
push edx
push 0x4ff190
lea eax, [esp + 0x30]
push 0x14
push eax
call fcn.00404e40
add esp, 0x10
mov ecx, 0x14
lea eax, [esp + 0x10]
cmp byte [eax], 0
je 0x405550
inc eax
dec ecx
jne 0x405545
jmp 0x405572
test ecx, ecx
je 0x405572
mov eax, 0x14
sub eax, ecx
lea ecx, [esp + 0x28]
push ecx
mov edx, 0x14
sub edx, eax
push edx
lea eax, [esp + eax + 0x18]
push eax
call fcn.00401bc0
movsx ecx, word [edi + 0xa]
inc esi
cmp esi, ecx
jl 0x4054c7
add ebp, 4
jmp 0x405493
pop ebp
call fcn.00405c70
mov ecx, dword [ebx + 0x98]
mov edx, dword [eax]
push ecx
lea ecx, [ebx + 0xc0]
push ecx
push str._s:_d
push eax
call dword [edx + 4]
mov edx, dword [ebx + 0x88]
add esp, 0x10
push 0x32
push edx
call dword [sym.imp.WS2_32.dll_listen]
cmp eax, 0xffffffff
jne 0x4055eb
call fcn.00405c70
mov esi, eax
mov edi, dword [esi]
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.Listen_error._Error_code:_d
push esi
call dword [edi + 4]
mov eax, dword [ebx + 0x88]
add esp, 0xc
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
jmp 0x405364
lea ecx, [esp + 0x4c]
push ecx
push 0
push ebx
push 0x404630
push 0
push 0
call dword [sym.imp.MSVCR71.dll__beginthreadex]
add esp, 0x18
test eax, eax
mov dword [ebx + 0x60], eax
jne 0x40563c
call fcn.00405c70
mov esi, eax
mov edi, dword [esi]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Server_Accept_Thread_Create_Failed_Error_code_:__d
push esi
call dword [edi + 4]
add esp, 0xc
pop edi
pop esi
mov byte [ebx + 0x8e], 0
or eax, 0xffffffff
pop ebx
add esp, 0xc4
ret
call fcn.00405c70
mov edx, dword [eax]
push str.Server_Accept_Thread_Create_OK
push eax
call dword [edx + 4]
add esp, 8
pop edi
pop esi
mov eax, 1
pop ebx
add esp, 0xc4
ret