Function at 0x401786
Capabilities:
Check mutex on windows
Create thread
Initialize winsock library

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xd2c
mov eax, dword [0x41c050]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
xor eax, eax
lea edi, [ebp - 0x4d8]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
xor esi, esi
stosd dword es:[edi], eax
push esi
lea eax, [ebp - 0x320]
xor ebx, ebx
push eax
inc ebx
push esi
xor ecx, ecx
lea edx, [ebp - 0x110]
mov dword [ebp - 0x4bc], esi
mov dword [ebp - 0x4d8], esi
mov dword [ebp - 0x4d4], ebx
mov dword [ebp - 0x4cc], esi
call fcn.00401618
lea eax, [ebp - 0x110]
push eax
push esi
push 0x100000
call dword [sym.imp.KERNEL32.dll_OpenMutexA]
mov dword [ebp - 0x4c0], esi
cmp eax, esi
jne 0x4019c0
lea eax, [ebp - 0x110]
push eax
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov edi, dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [ebp - 0x4b8], eax
lea eax, [ebp - 0x320]
push eax
push esi
push ebx
push esi
call edi
push esi
push esi
push ebx
push esi
mov dword [ebp - 0x4b4], eax
call edi
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x4d0], eax
cmp dword [ebp - 0x4b8], esi
je 0x4019a2
push 0x844
lea eax, [ebp - 0xd28]
push esi
push eax
call fcn.0040b7d0
lea eax, [ebp - 0x4d8]
mov dword [ebp - 0xd20], eax
lea eax, [ebp - 0x4cc]
mov dword [ebp - 0xd18], eax
add esp, 0xc
lea eax, [ebp - 0x4d4]
mov dword [ebp - 0xd24], eax
push 0x104
lea eax, [ebp - 0x218]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
je 0x4018a5
lea eax, [ebp - 0x218]
push eax
call fcn.004019f1
pop ecx
mov dword [ebp - 0xd1c], eax
cmp eax, esi
jne 0x4018b9
mov dword [ebp - 0xd1c], str.7777
mov eax, dword [ebp - 0xd1c]
push 0x190
mov dword [ebp - 0x4c8], eax
lea eax, [ebp - 0x4b0]
push esi
push eax
call fcn.0040b7d0
add esp, 0xc
lea eax, [ebp - 0x4b0]
push eax
push 0x202
call sub.WS2_32.dll_WSAStartup
mov edi, dword [sym.imp.KERNEL32.dll_CreateThread]
push esi
push esi
lea eax, [ebp - 0x4d8]
push eax
push 0x401d39
push esi
push esi
call edi
push esi
push esi
mov dword [ebp - 0x4c4], eax
lea eax, [ebp - 0xd28]
push eax
push 0x401ebf
push esi
push esi
call edi
mov dword [ebp - 0x4dc], eax
cmp dword [ebp - 0x4c4], esi
je 0x401976
mov edi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push 0xffffffffffffffff
push dword [ebp - 0x4b4]
call edi
mov dword [ebp - 0x4c0], 1
mov dword [ebp - 0x4d4], esi
cmp dword [ebp - 0x4d0], esi
je 0x40196e
push 0xffffffffffffffff
push dword [ebp - 0x4d0]
call edi
push dword [ebp - 0x4d0]
call ebx
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
push dword [ebp - 0x4c4]
call ebx
push dword [ebp - 0x4b8]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push dword [ebp - 0x4b8]
call ebx
mov eax, 0x401ebf
test eax, eax
je 0x40199b
push dword [ebp - 0x4dc]
call ebx
call sub.WS2_32.dll_WSACleanup
jmp 0x4019ae
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x4bc], eax
cmp dword [ebp - 0x4b4], esi
je 0x4019c7
push dword [ebp - 0x4b4]
call ebx
jmp 0x4019c7
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x4c0], 1
jne 0x4019dc
push esi
call fcn.00401454
pop ecx
call fcn.00402e36
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x4bc]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040a6e5
leave
ret