Function at 0x87cce0
Capabilities:
Check for time delay via gettickcount
Create thread
Terminate thread

Disassembly:
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0xb12a90
push 0xa847a0
mov eax, dword fs:[0]
push eax
sub esp, 0x9ac
mov eax, dword [0xb196ec]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp - 0x1c], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov dword [ebp - 0x18], esp
mov esi, dword [ebp + 0x18]
mov ebx, dword [ebp + 0xc]
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x9b0], eax
mov dword [ebp - 0x9ac], ecx
mov dword [ebp - 0x9a8], edx
mov eax, dword [ebp + 0x20]
mov dword [ebp - 0x9b8], eax
mov ecx, dword [ebp + 0x24]
mov dword [ebp - 0x99c], ecx
xor edi, edi
mov dword [ebp - 0x990], edi
push 0x850
push edi
lea edx, [ebp - 0x98c]
push edx
call fcn.00a7ffb0
add esp, 0xc
mov dword [ebp - 0x9a0], 1
mov dword [ebp - 4], edi
mov ecx, dword [ebp + 8]
lea edx, [ebp - 0x128]
lea esp, [esp]
mov al, byte [ecx]
mov byte [edx], al
inc ecx
inc edx
test al, al
jne 0x87cd80
push 0xab6800
lea eax, [ebp - 0x128]
push eax
call fcn.00a7a220
add esp, 8
cmp eax, edi
je 0x87cda5
mov byte [eax], 0
lea ecx, [esi - 0x2710]
cmp ecx, 0xc350
jbe 0x87cdd5
mov eax, 0xcccccccd
mul esi
shr edx, 3
lea edx, [edx + edx*4]
add edx, edx
mov eax, esi
sub eax, edx
cmp eax, 2
mov dword [ebp - 0x994], 0x2710
jne 0x87cddb
mov dword [ebp - 0x994], esi
lea ecx, [ebp - 0x128]
push ecx
lea edx, [ebp - 0x65c]
push edx
mov esi, dword [sym.imp.KERNEL32.dll_lstrcpyA]
call esi
push ebx
lea eax, [ebp - 0x350]
push eax
call esi
push 0xaa1543
lea ecx, [ebp - 0x760]
push ecx
call esi
push 0xaa1543
lea edx, [ebp - 0x346]
push edx
call esi
mov ecx, 0xaa8704
lea edx, [ebp - 0x558]
movzx eax, word [ecx]
mov word [edx], ax
add ecx, 2
add edx, 2
cmp ax, di
jne 0x87ce22
push 0xaa1543
lea eax, [ebp - 0x242]
push eax
call esi
mov dword [ebp - 0x764], edi
mov dword [ebp - 0x768], edi
mov dword [ebp - 0x988], edi
mov dword [ebp - 0x98c], edi
mov dword [ebp - 0x984], edi
mov ecx, dword [ebp + 0x14]
mov dword [ebp - 0x990], ecx
mov edx, dword [ebp - 0x994]
mov dword [ebp - 0x974], edx
cmp dword [ebp - 0x9a8], edi
je 0x87ce85
mov eax, dword [ebp - 0x9a8]
mov byte [eax], 0
mov eax, dword [ebp - 0x9ac]
cmp eax, edi
je 0x87ce92
mov byte [eax], 0
mov eax, dword [ebp - 0x9b0]
cmp eax, edi
je 0x87ce9f
mov byte [eax], 0
lea ecx, [ebp - 0x998]
push ecx
push 0
lea edx, [ebp - 0x990]
push edx
push 0x87c530
push 0
push 0
call fcn.00a7b1a7
add esp, 0x18
mov edi, eax
mov dword [ebp - 0x9bc], edi
test edi, edi
jne 0x87cefd
mov eax, dword [ebp - 0x99c]
test eax, eax
je 0x87cedc
mov dword [eax], 1
mov eax, dword [ebp - 0x9b8]
test eax, eax
je 0x87ceec
mov dword [eax], 0
mov dword [ebp - 4], 0xfffffffe
mov eax, 1
jmp 0x87d378
mov dword [ebp - 0x9b4], 0
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x9a4], eax
cmp dword [0xb56e5c], 0
je 0x87cf39
lea eax, [ebp - 0x128]
push eax
mov ecx, dword [ebp - 0x998]
push ecx
push str.NEWTHREAD__x_:_IsConnectionActive___for___s_
push 0
call fcn.0096a780
add esp, 0x10
push ebx
call fcn.00a79090
add esp, 4
movzx eax, ax
mov edx, 2
mov word [ebp - 0x138], dx
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x136], ax
lea eax, [ebp - 0x128]
push eax
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [ebp - 0x134], eax
cmp eax, 0xffffffff
je 0x87cf99
mov dword [ebp - 0x9b4], 1
mov eax, dword [ebp - 0x9ac]
test eax, eax
je 0x87cf99
lea ecx, [ebp - 0x128]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
nop
cmp dword [ebp - 0x98c], 0
jne 0x87cfaf
push 1
call esi
jmp 0x87cfa0
mov eax, dword [ebp - 0x9b8]
test eax, eax
je 0x87cfbb
mov dword [eax], edi
mov eax, dword [ebp - 0x99c]
test eax, eax
je 0x87cfcb
mov dword [eax], 1
cmp dword [0xb56e5c], 0
je 0x87cfe3
push str.WaitForSingleObjectEx...
push 0
call fcn.0096a780
add esp, 8
cmp dword [0xb56d54], 0
jne 0x87cffe
push 0
mov ebx, dword [ebp - 0x994]
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObjectEx]
jmp 0x87d015
mov edx, dword [ebp - 0x994]
push edx
mov ebx, edi
call fcn.0087ba90
add esp, 4
mov ebx, dword [ebp - 0x994]
mov esi, eax
cmp dword [0xb56e5c], 0
je 0x87d050
cmp esi, 0x102
jne 0x87d030
push eax
push str.WaitForSingleObjectEx_Returned__WaitRes___d__WAIT_TIMEOUT__...
jmp 0x87d042
test esi, esi
jne 0x87d03c
push esi
push str.WaitForSingleObjectEx_Returned__WaitRes___d__WAIT_OBJECT_0__...
jmp 0x87d042
push esi
push str.WaitForSingleObjectEx_Returned__WaitRes___d__NON_WAIT_TIMEOUT__...
push 0
call fcn.0096a780
add esp, 0xc
lea esp, [esp]
cmp esi, 0x102
jne 0x87d2a6
mov eax, dword [ebp + 0x28]
test eax, eax
je 0x87d0ad
cmp dword [eax], 1
jne 0x87d0ad
cmp dword [ebp - 0x980], 0
je 0x87d0ad
lea eax, [ebp - 0x99c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetExitCodeThread]
cmp eax, 1
jne 0x87d2a6
cmp dword [ebp - 0x99c], 0x103
jne 0x87d2a6
mov ecx, dword [ebp - 0x980]
mov dword [ecx], eax
push 0x14
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x87d2a6
cmp dword [0xb56e5c], 0
je 0x87d0cc
mov edx, dword [ebp - 0x768]
push edx
push str._Stage:__d._Wait_Timeout
push 0
call fcn.0096a780
add esp, 0xc
mov eax, dword [ebp - 0x768]
cmp eax, 3
je 0x87d1d1
cmp eax, 1
je 0x87d1c7
inc dword [ebp - 0x9a0]
cmp dword [0xb56d54], 0
jne 0x87d0ff
push 0
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObjectEx]
jmp 0x87d116
mov eax, dword [ebp - 0x994]
push eax
mov ebx, edi
call fcn.0087ba90
add esp, 4
mov ebx, dword [ebp - 0x994]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x9a4]
cmp eax, 0x7148
jbe 0x87d050
push ebx
mov eax, dword [ebp - 0x998]
push eax
push eax
mov ecx, dword [ebp - 0x768]
push ecx
push str._TOX___Stage:__d._Terminating_Thread__0x_x_:__d___TO:__d
push 0
call fcn.0096a780
add esp, 0x18
push 0
push edi
call dword [sym.imp.KERNEL32.dll_TerminateThread]
cmp dword [0xb56e5c], 0
je 0x87d183
cmp eax, 1
mov eax, dword [ebp - 0x998]
push eax
push eax
jne 0x87d174
push str._TOX___ThreadTerm_Success__0x_x_:__d_
jmp 0x87d179
push str._TOX___ThreadTerm_Failure__0x_x_:__d_
push 0
call fcn.0096a780
add esp, 0x10
mov eax, 0x10624dd3
mul ebx
shr edx, 6
imul edx, dword [ebp - 0x9a0]
push edx
push str.Unable_to_connect__Timed_Out_within__d_secs__
lea edx, [ebp - 0x760]
push edx
call fcn.00a78f30
add esp, 0xc
cmp dword [0xb56e5c], 0
je 0x87d2a6
lea eax, [ebp - 0x760]
push eax
push str._TOX___s
jmp 0x87d29c
cmp eax, 3
je 0x87d1d1
cmp eax, 1
jne 0x87d20b
cmp dword [ebp - 0x980], 0
je 0x87d20b
lea ecx, [ebp - 0x9a4]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_GetExitCodeThread]
cmp eax, 1
jne 0x87d261
cmp dword [ebp - 0x9a4], 0x103
jne 0x87d261
mov edx, dword [ebp - 0x980]
mov dword [edx], eax
push 0x14
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x87d261
cmp dword [0xb56e5c], 0
je 0x87d22c
mov ecx, dword [ebp - 0x998]
push ecx
push ecx
push eax
push str._Stage:__d._Terminating_Thread__0x_x_:__d_
push 0
call fcn.0096a780
add esp, 0x14
push 0
push edi
call dword [sym.imp.KERNEL32.dll_TerminateThread]
cmp dword [0xb56e5c], 0
je 0x87d261
cmp eax, 1
mov eax, dword [ebp - 0x998]
push eax
push eax
jne 0x87d252
push str._ThreadTerm_Success__0x_x_:__d_
jmp 0x87d257
push str._ThreadTerm_Failure__0x_x_:__d_
push 0
call fcn.0096a780
add esp, 0x10
mov eax, 0x10624dd3
mul ebx
shr edx, 6
imul edx, dword [ebp - 0x9a0]
push edx
push str.Unable_to_connect__Timed_Out_within__d_secs__
lea eax, [ebp - 0x760]
push eax
call fcn.00a78f30
add esp, 0xc
cmp dword [0xb56e5c], 0
je 0x87d2a6
lea ecx, [ebp - 0x760]
push ecx
push 0xaa1544
push 0
call fcn.0096a780
add esp, 0xc
mov esi, dword [ebp + 0x28]
test esi, esi
je 0x87d2b2
cmp dword [esi], 1
je 0x87d2d3
cmp dword [ebp - 0x9b4], 0
jne 0x87d2d3
mov eax, dword [ebp - 0x9ac]
test eax, eax
je 0x87d2d3
lea edx, [ebp - 0x346]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp - 0x9bc]
push eax
call fcn.00985290
test esi, esi
je 0x87d2e8
cmp dword [esi], 1
je 0x87d330
mov eax, dword [ebp - 0x9b0]
test eax, eax
je 0x87d309
cmp byte [ebp - 0x760], 0
je 0x87d309
lea ecx, [ebp - 0x760]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov eax, dword [ebp - 0x9a8]
test eax, eax
je 0x87d330
cmp byte [ebp - 0x242], 0
je 0x87d330
mov edx, dword [ebp + 0x1c]
push edx
lea ecx, [ebp - 0x242]
push ecx
push eax
call fcn.00a7a620
add esp, 0xc
cmp dword [0xb56e5c], 0
je 0x87d348
push str.Exiting_IsConnectionActive__...
push 0
call fcn.0096a780
add esp, 8
mov eax, dword [ebp - 0x984]
mov dword [ebp - 4], 0xfffffffe
jmp 0x87d378
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x1c]
xor ecx, ebp
call fcn.00a78f21
mov esp, ebp
pop ebp
ret