Function at 0x4010a0
Capabilities:
Create thread
Initialize winsock library
Terminate thread

Disassembly:
sub esp, 0x1c0
lea eax, [esp + 0x30]
push ebx
push ebp
push esi
push edi
push eax
mov esi, ecx
push 2
call sub.WS2_32.dll_WSAStartup
cmp dword [esp + 0x1d4], 5
jl 0x401394
mov ebp, dword [esp + 0x1d8]
mov ecx, dword [ebp + 8]
push ecx
call fcn.0040954e
add esp, 4
mov dword [esi + 0x124], eax
test eax, eax
je 0x401394
mov edx, dword [ebp + 0xc]
push edx
call fcn.0040954e
add esp, 4
mov dword [esi + 0x128], eax
test eax, eax
je 0x401394
lea ebx, [esi + 0x24]
mov ecx, 0xc
xor eax, eax
mov edi, ebx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov eax, dword [ebp + 0x10]
push 0x31
push eax
push ebx
call fcn.00409450
mov edi, ebx
or ecx, 0xffffffff
xor eax, eax
add esp, 0xc
repne scasb al, byte es:[edi]
not ecx
dec ecx
je 0x401394
lea edx, [esi + 0xba]
mov ecx, 0x19
mov edi, edx
push 0x63
rep stosd dword es:[edi], eax
mov ecx, dword [ebp + 0x14]
push ecx
push edx
call fcn.00409450
add esp, 0xc
mov ecx, esi
push 0x41e264
call fcn.00402910
lea edx, [esi + 0x56]
push edx
call fcn.00402fa0
add esp, 4
test eax, eax
jne 0x401394
xor ebp, ebp
mov dword [esp + 0x10], ebp
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [esi + 0x130], eax
lea eax, [esp + 0x10]
push eax
push ebp
push esi
push 0x4013e0
push ebp
push ebp
call dword [sym.imp.KERNEL32.dll_CreateThread]
cmp eax, ebp
mov dword [esi + 4], eax
jne 0x4011b5
push str.CreateThread___fail
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.CApp.Start
push 0xa
jmp 0x40138c
push str.Start_Message_Loop
push ebp
push str.CApp.Start
push 0x14
call fcn.00402a80
mov ebx, dword [sym.imp.USER32.dll_GetMessageA]
mov edi, dword [sym.imp.USER32.dll_PostThreadMessageA]
add esp, 0x10
push ebp
push ebp
lea ecx, [esp + 0x20]
push ebp
push ecx
call ebx
test eax, eax
je 0x40124b
mov eax, dword [esp + 0x1c]
cmp eax, 0x405
jne 0x40122c
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x20]
push edx
push eax
push str.WM_RECONNECT__d__d_
push ebp
push str.CApp.Start
push 0x14
call fcn.00402a80
mov ecx, dword [esp + 0x3c]
mov eax, dword [esp + 0x38]
mov edx, dword [esp + 0x28]
add esp, 0x18
mov dword [esi + 0x128], eax
push ecx
push eax
push 0x405
push edx
call edi
jmp 0x4011d6
cmp eax, 0x404
je 0x401268
lea eax, [esp + 0x18]
push eax
call dword [sym.imp.USER32.dll_TranslateMessage]
lea ecx, [esp + 0x18]
push ecx
call dword [sym.imp.USER32.dll_DispatchMessageA]
jmp 0x4011d6
push str.GetMessage___fail
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.CApp.Start
push 0x14
call fcn.00402a80
add esp, 0x10
jmp 0x401287
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x20]
push edx
push eax
push str.WM_TERMINATE__d__d_
push ebp
push str.CApp.Start
push 0x14
call fcn.00402a80
add esp, 0x18
push str.WaitForSingleObject_m_hTerminate__INFINITE__signals
push ebp
push str.CApp.Start
push 0x1e
call fcn.00402a80
mov eax, dword [esp + 0x20]
add esp, 0x10
push eax
push 0x4e2e
push 0x402
push eax
call edi
mov ecx, dword [esi + 0x124]
push ecx
push 1
push 0x1f0fff
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, eax
cmp edi, ebp
je 0x40132d
push 2
push ebp
lea edx, [esp + 0x1c]
push ebp
push edx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
mov eax, dword [esi + 0x128]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_DuplicateHandle]
cmp eax, 1
jne 0x40132a
mov eax, dword [esp + 0x14]
mov ecx, dword [esi + 0x12c]
push 0x3e8
lea edx, [esp + 0x38]
push 0xc
push edx
push eax
mov dword [esp + 0x44], 8
mov dword [esp + 0x48], ebp
mov dword [esp + 0x4c], ecx
call fcn.00408350
mov ecx, dword [esp + 0x24]
add esp, 0x10
push ecx
call sub.WS2_32.dll_closesocket
push edi
call ebx
mov edx, dword [esi + 0x120]
mov eax, dword [esi + 4]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x40135c
mov ecx, dword [esi + 4]
push ebp
push ecx
call dword [sym.imp.KERNEL32.dll_TerminateThread]
mov edx, dword [esp + 0x10]
push edx
push str.Force_kill_DLL_thread__d
jmp 0x401366
mov eax, dword [esp + 0x10]
push eax
push str.Gracefull_kill_DLL_thread__d
push ebp
push str.CApp.Start
push 0x14
call fcn.00402a80
mov ecx, dword [esi + 4]
add esp, 0x14
push ecx
call ebx
push str.Application_Stop...
push ebp
push str.CApp.Start
mov dword [esi + 4], ebp
push 0x14
call fcn.00402a80
add esp, 0x10
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x1c0
ret 8