Function at 0x487f70
Capabilities:
Create thread
Initialize winsock library

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x51439d
mov eax, dword fs:[0]
push eax
sub esp, 0x1b8
mov eax, dword [0x58fa2c]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov edi, ecx
mov dword [ebp - 0x1c0], edi
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x1b8], eax
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x1b0], eax
mov eax, dword [ebp + 0x24]
mov dword [ebp - 0x1bc], eax
xor ebx, ebx
mov dword [ebp - 0x1b4], ebx
mov esi, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [edi + 0x14], ebx
jne 0x48800f
lea eax, [edi + 0x28]
push eax
call esi
cmp dword [edi + 0x14], ebx
jne 0x488005
mov dword [edi + 0x14], 1
lea eax, [ebp - 0x1a4]
push eax
push 0x202
call dword [sym.imp.WSOCK32.dll_WSAStartup]
test eax, eax
jne 0x488005
mov dword [edi], 1
lea eax, [edi + 0x28]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 0
call dword [sym.imp.WS2_32.dll_WSASetLastError]
lea eax, [edi + 0x28]
push eax
call esi
mov dword [ebp - 4], 0
push 0x60
call fcn.00472260
add esp, 4
mov esi, eax
mov dword [ebp - 0x1c4], esi
mov byte [ebp - 4], 1
test esi, esi
je 0x48804d
push 0x60
push 0
push esi
call fcn.004b8570
add esp, 0xc
jmp 0x48804f
xor esi, esi
mov byte [ebp - 4], 0
mov dword [ebp - 0x1a8], esi
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x1a8]
lock inc dword [eax + 0x40]
mov eax, dword [ebp - 0x1a8]
mov dword [eax + 4], edi
mov ecx, dword [ebp - 0x1a8]
mov eax, dword [ebp + 8]
mov dword [ecx], eax
mov ecx, dword [ebp - 0x1a8]
mov eax, dword [ebp + 0xc]
mov dword [ecx + 8], eax
mov ecx, dword [ebp - 0x1a8]
mov eax, dword [ebp + 0x10]
mov dword [ecx + 0xc], eax
mov eax, dword [ebp - 0x1a8]
mov ecx, dword [ebp - 0x1b8]
mov dword [eax + 0x10], ecx
mov ecx, dword [ebp - 0x1a8]
mov eax, dword [ebp + 0x1c]
mov dword [ecx + 0x24], eax
mov ecx, dword [ebp + 0x20]
mov eax, dword [ebp - 0x1a8]
mov dword [eax + 0x28], ecx
cmp byte [edi + 0x40], 0
je 0x488189
mov esi, dword [ebp - 0x1a8]
push 0
push 0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [esi + 0x34], eax
mov eax, dword [ebp - 0x1a8]
lock inc dword [eax + 0x40]
push dword [ebp - 0x1a8]
push 0
push 0x488250
call fcn.004c632b
add esp, 0xc
mov eax, dword [ebp - 0x1b8]
push dword [eax + 4]
mov eax, dword [ebp - 0x1a8]
push dword [eax + 0x34]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
sete al
mov byte [ebp - 0x1a9], al
mov esi, dword [ebp - 0x1b0]
test al, al
jne 0x488162
test esi, esi
je 0x488144
xor ecx, ecx
mov eax, dword [ebp - 0x1a8]
add eax, 0x20
xchg dword [eax], ecx
neg ecx
sbb ecx, ecx
and ecx, 0x2ed9
mov dword [esi], ecx
mov eax, dword [ebp - 0x1bc]
test eax, eax
je 0x488154
mov dword [eax], 0x2ed9
mov ebx, 0xffff
mov dword [ebp - 0x1b4], ebx
inc dword [edi + 0x18]
mov eax, dword [ebp - 0x1a8]
push dword [eax + 0x34]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x1a8]
mov dword [eax + 0x34], 0
cmp byte [ebp - 0x1a9], 0
je 0x4881dc
jmp 0x48819d
push dword [ebp - 0x1a8]
call fcn.00487cb0
add esp, 4
mov esi, dword [ebp - 0x1b0]
test esi, esi
je 0x4881ac
mov eax, dword [ebp - 0x1a8]
mov eax, dword [eax + 0x20]
mov dword [esi], eax
mov edx, dword [ebp - 0x1bc]
mov eax, dword [ebp - 0x1a8]
test edx, edx
je 0x4881c1
mov ecx, dword [eax + 0x2c]
mov dword [edx], ecx
mov ebx, dword [eax + 0x30]
mov dword [ebp - 0x1b4], ebx
cmp dword [eax + 0x2c], 0
je 0x4881d5
inc dword [edi + 0x18]
jmp 0x4881dc
mov dword [edi + 0x18], 0
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x1a8]
test eax, eax
je 0x4881f5
push 0x60
push eax
call fcn.004a42c5
add esp, 8
mov dword [ebp - 4], 0xffffffff
jmp 0x488217
lea ecx, [edi + 0x28]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.004a4566
mov esp, ebp
pop ebp
ret 0x20