Function at 0x40d3f4
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffc4
mov byte [ebp - 0xc], dl
test dl, dl
jle 0x40d406
call fcn.004c2078
mov dword [ebp - 0x34], ecx
mov byte [ebp - 0x2d], dl
mov dword [ebp - 4], eax
mov eax, 0x4c8b80
call fcn.004b66dc
mov word [ebp - 0x1c], 8
mov ecx, dword [ebp - 0x34]
xor edx, edx
mov eax, dword [ebp - 4]
call fcn.004367b4
add dword [ebp - 0x10], 4
mov eax, dword [ebp - 4]
add eax, 0x88
call fcn.0040a760
inc dword [ebp - 0x10]
mov eax, dword [ebp - 4]
add eax, 0x8c
call fcn.0040a760
inc dword [ebp - 0x10]
push 0x10
push 0
mov edx, dword [ebp - 4]
add edx, 0x64
push edx
call fcn.004b633c
add esp, 0xc
call sym.Project1.exe__TcmSocket_wsa_startup_qv
test al, al
jne 0x40d491
call sub.WSOCK32.DLL_WSAGetLastError
push eax
push str.WSAStartup_failed_
push dword [ebp - 4]
call sym.Project1.exe__TcmSocket_ShowError_qpci
add esp, 0xc
mov ecx, dword [ebp - 0x2c]
mov dword fs:[0], ecx
jmp 0x40d62c
inc dword [0x4c7cf0]
mov eax, dword [ebp - 4]
mov byte [eax + 0x84], 0
mov edx, dword [ebp - 4]
mov dword [edx + 0x98], 0xffffffff
mov ecx, dword [ebp - 4]
mov byte [ecx + 0x61], 2
mov eax, dword [ebp - 4]
mov byte [eax + 0x60], 0
mov edx, dword [ebp - 4]
mov byte [edx + 0x85], 0
mov word [ebp - 0x1c], 0x14
lea eax, [ebp - 8]
xor edx, edx
call fcn.004c1984
inc dword [ebp - 0x10]
lea edx, [ebp - 8]
mov eax, dword [ebp - 4]
add eax, 0x88
call fcn.004c1a64
dec dword [ebp - 0x10]
lea eax, [ebp - 8]
mov edx, 2
call fcn.004c1a34
mov ecx, dword [ebp - 4]
xor eax, eax
mov dword [ecx + 0x90], eax
mov edx, dword [ebp - 4]
mov dword [edx + 0x94], eax
mov ecx, dword [ebp - 4]
xor eax, eax
mov dword [ecx + 0x48], eax
mov edx, dword [ebp - 4]
xor ecx, ecx
mov dword [edx + 0x4c], ecx
mov eax, dword [ebp - 4]
xor edx, edx
mov dword [eax + 0x40], edx
mov ecx, dword [ebp - 4]
xor eax, eax
mov dword [ecx + 0x44], eax
mov edx, dword [ebp - 4]
xor ecx, ecx
mov dword [edx + 0x50], ecx
mov eax, dword [ebp - 4]
xor edx, edx
mov dword [eax + 0x54], edx
mov ecx, dword [ebp - 4]
xor eax, eax
mov dword [ecx + 0x38], eax
mov edx, dword [ebp - 4]
xor ecx, ecx
mov dword [edx + 0x3c], ecx
mov eax, dword [ebp - 4]
xor edx, edx
mov dword [eax + 0x58], edx
mov ecx, dword [ebp - 4]
xor eax, eax
mov dword [ecx + 0x5c], eax
mov edx, dword [ebp - 4]
xor ecx, ecx
mov dword [edx + 0x30], ecx
mov eax, dword [ebp - 4]
xor edx, edx
mov dword [eax + 0x9c], edx
mov edx, 0x2000
mov eax, dword [ebp - 4]
call sym.Project1.exe__TcmSocket_SetBufferSize_qqri
push 0x10
call fcn.004b5838
pop ecx
mov ecx, dword [ebp - 4]
mov dword [ecx + 0xa0], eax
mov eax, dword [ebp - 4]
mov edx, dword [eax + 0xa0]
xor ecx, ecx
mov dword [edx], ecx
mov eax, dword [ebp - 4]
mov edx, dword [eax + 0xa0]
xor ecx, ecx
mov dword [edx + 4], ecx
mov eax, dword [ebp - 4]
mov edx, dword [eax + 0xa0]
xor ecx, ecx
mov dword [edx + 8], ecx
push 0
push 0
push 0
push 0
call sub.KERNEL32.DLL_CreateEventA
mov edx, dword [ebp - 4]
mov dword [edx + 0x78], eax
push 0
push 0
push 0
push 0
call sub.KERNEL32.DLL_CreateEventA
mov ecx, dword [ebp - 4]
mov dword [ecx + 0x7c], eax
push 0
push 0
push dword [ebp - 4]
push sym.Project1.exe__TcmSocket_ReadThreadProc_qqspv
push 0
push 0
call sub.KERNEL32.DLL_CreateThread
mov edx, dword [ebp - 4]
mov dword [edx + 0x80], eax
mov eax, dword [ebp - 4]
add eax, 0x1c
mov dl, 4
call fcn.0040b6f8
test al, al
jne 0x40d62c
mov dword [ebp - 0x3c], sym.Project1.exe__TcmSocket_OnSocketMessage_qqrr17Messages_TMessage
mov eax, dword [ebp - 4]
mov dword [ebp - 0x38], eax
lea ecx, [ebp - 0x3c]
push dword [ecx + 4]
push dword [ecx]
call fcn.004378f4
mov edx, dword [ebp - 4]
mov dword [edx + 0x74], eax
mov ecx, dword [ebp - 0x2c]
mov dword fs:[0], ecx
mov eax, dword [ebp - 4]
cmp byte [ebp - 0x2d], 0
je 0x40d644
call fcn.004c2085
mov esp, ebp
pop ebp
ret