Function at 0x411dc7
Capabilities:
Get socket status
Initialize winsock library
Print debug messages
Read .ini file
Read and send data from client to server
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3ac
mov dword [ebp - 0x19c], 0
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp + 0xc]
push eax
push 0
push str.WMC____4.4X___wmc_Connect:_AppName_s_n
push 0x44d880
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
push 0x44d880
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
cmp dword [0x4310be], 0
je 0x411e41
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [0x4310be]
mov eax, dword [edx + 4]
push eax
push str.WMC____4.4X___wmc_Connect:_AppName_s_still_connected___n
push 0x44d880
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
push 0x44d880
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
xor eax, eax
jmp 0x41228e
mov dword [0x4310c8], 0
mov dword [0x4310cc], 0
push 0
push 0xffffffffffffffff
call sub.WINDCS32.dll_Ordinal_69
push eax
push str._s_syslogging.ini
lea ecx, [ebp - 0x2a0]
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea edx, [ebp - 0x2a0]
push edx
push 1
push str.EnableUserLogging
push str.Global
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntA]
mov dword [0x43189c], eax
call fcn.00411d1a
mov eax, dword [ebp + 8]
mov dword [0x43105c], eax
lea ecx, [ebp - 0x198]
push ecx
push 0x101
call sub.WSOCK32.dll_WSAStartup
test eax, eax
je 0x411ebb
xor eax, eax
jmp 0x41228e
push 0x13
mov edx, dword [ebp + 0xc]
push edx
push 0x431048
call fcn.0041eea0
add esp, 0xc
push 0xfe08
push 0x42
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov dword [0x43106e], eax
push 0xff0
push 0x42
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [0x431072], eax
push 0xfa5c
push 0x42
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [0x431062], eax
push 0xfa5c
push 0x42
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [0x431066], eax
push 0xfe08
push 0x42
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [0x43106a], eax
cmp dword [0x43106e], 0
je 0x411f53
cmp dword [0x431072], 0
je 0x411f53
cmp dword [0x431062], 0
je 0x411f53
cmp dword [0x43106a], 0
jne 0x411f7d
push str.WMC___wmc_Connect:_Out_of_memory____call_wmc_Disconnect___..._n
push 0x44d880
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 8
push 0x44d880
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call fcn.004123a9
xor eax, eax
jmp 0x41228e
push 0x431880
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push 0x4318a0
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov dword [ebp - 8], 0x100007f
mov eax, dword [ebp - 8]
push eax
call fcn.00411d3d
add esp, 4
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0xffffffff
jne 0x411fbb
call sub.WSOCK32.dll_WSACleanup
xor eax, eax
jmp 0x41228e
push 0x10022
push 0x42
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov dword [ebp - 0x19c], eax
cmp dword [ebp - 0x19c], 0
jne 0x411ff3
mov ecx, dword [ebp - 4]
push ecx
call sub.WSOCK32.dll_closesocket
call sub.WSOCK32.dll_WSACleanup
xor eax, eax
jmp 0x41228e
push 0x780
push 0x42
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov edx, dword [ebp - 0x19c]
mov dword [edx + 0xfe20], eax
mov eax, dword [ebp - 0x19c]
cmp dword [eax + 0xfe20], 0
jne 0x412058
mov ecx, dword [ebp - 4]
push ecx
call sub.WSOCK32.dll_closesocket
mov edx, dword [ebp - 0x19c]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalHandle]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov eax, dword [ebp - 0x19c]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalHandle]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
call sub.WSOCK32.dll_WSACleanup
xor eax, eax
jmp 0x41228e
mov ecx, dword [ebp - 0x19c]
mov edx, dword [0x4310be]
mov dword [ecx], edx
mov eax, dword [ebp - 0x19c]
mov dword [0x4310be], eax
mov ecx, dword [ebp - 0x19c]
mov edx, dword [ebp - 8]
mov dword [ecx + 8], edx
mov eax, dword [ebp - 0x19c]
mov ecx, dword [ebp - 4]
mov dword [eax + 4], ecx
mov edx, dword [ebp - 0x19c]
add edx, 0x18
mov eax, dword [ebp - 0x19c]
mov dword [eax + 0xc], edx
mov ecx, dword [ebp - 0x19c]
mov edx, dword [ecx + 0xc]
add edx, 0x20
mov eax, dword [ebp - 0x19c]
mov dword [eax + 0x10], edx
mov dword [0x431898], 0
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp - 0x19c]
mov eax, dword [edx + 4]
push eax
push str.WMC____4.4X___wmc_Connect:_Init_wmc_communication_for_Appl_s_n
push 0x44d880
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
push 0x44d880
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push 0x21
push 0x7d19
mov ecx, dword [ebp + 8]
push ecx
mov edx, dword [ebp - 4]
push edx
call sub.WSOCK32.dll_WSAAsyncSelect
push 0x431880
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push 0x20
push 0
mov eax, dword [0x43106e]
push eax
call fcn.0041ee40
add esp, 0xc
mov ecx, dword [0x43106e]
mov edx, dword [ebp + 8]
mov dword [ecx], edx
mov eax, dword [0x43106e]
mov dword [eax + 4], 0x7d05
mov ecx, dword [ebp + 0xc]
push ecx
call fcn.0041efa0
add esp, 4
add eax, 1
mov edx, dword [0x43106e]
mov word [edx + 8], ax
mov eax, dword [0x43106e]
xor ecx, ecx
mov cx, word [eax + 8]
add ecx, 0x20
mov edx, dword [0x43106e]
mov word [edx + 0xc], cx
mov eax, dword [0x43106e]
mov word [eax + 0xe], 0x400
call sub.WINDCS32.dll_sysini_GetAreaForApplikation
mov ecx, dword [0x43106e]
mov byte [ecx + 0x10], al
call sub.WINDCS32.dll_Ordinal_53_1
mov edx, dword [0x43106e]
mov byte [edx + 0x11], al
mov eax, dword [0x43106e]
xor ecx, ecx
mov cx, word [eax + 8]
push ecx
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [0x43106e]
add eax, 0x20
push eax
call fcn.0041f530
add esp, 0xc
mov dword [ebp - 0x2a8], 0
mov dword [ebp - 0x2a4], 0x7a120
mov dword [ebp - 0x3ac], 0
cmp dword [ebp - 0x3ac], 0x40
jae 0x4121f3
mov ecx, dword [ebp - 0x3ac]
mov edx, dword [ebp - 0x19c]
mov eax, dword [edx + 4]
mov dword [ebp + ecx*4 - 0x3a8], eax
mov ecx, dword [ebp - 0x3ac]
add ecx, 1
mov dword [ebp - 0x3ac], ecx
xor edx, edx
test edx, edx
jne 0x4121c5
lea eax, [ebp - 0x2a8]
push eax
push 0
lea ecx, [ebp - 0x3ac]
push ecx
push 0
push 0
call sub.WSOCK32.dll_select
push 0
mov edx, dword [0x43106e]
xor eax, eax
mov ax, word [edx + 0xc]
push eax
mov ecx, dword [0x43106e]
push ecx
mov edx, dword [ebp - 0x19c]
mov eax, dword [edx + 4]
push eax
call sub.WSOCK32.dll_send
cmp eax, 0xffffffff
jne 0x41227e
call sub.WSOCK32.dll_WSAGetLastError
push eax
mov ecx, dword [ebp - 0x19c]
mov edx, dword [ecx + 4]
push edx
push str.WMC____4.4X___wmc_Connect:_Send_FAILED_with__d___n
push 0x44d880
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
push 0x44d880
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push 0x431880
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call fcn.004123a9
xor eax, eax
jmp 0x41228e
push 0x431880
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, 1
mov esp, ebp
pop ebp
ret