Function at 0x46cf77
Capabilities:
Create thread
Get socket status

Disassembly:
sub esp, 0x31c
mov eax, dword [0x6b0d44]
xor eax, esp
mov dword [esp + 0x318], eax
push esi
mov esi, ecx
test esi, esi
je 0x46d467
push ebx
push ebp
xor ebp, ebp
mov dword [esi + 0x304], ebp
mov dword [esi + 0x300], ebp
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [esi + 8], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push dword [esi + 8]
mov dword [esi + 0xc], eax
push ebp
push 0x1fffff
call dword [sym.imp.KERNEL32.dll_OpenThread]
mov dword [esi + 0x10], eax
mov eax, dword [0x76a594]
test eax, eax
push ebp
cmove eax, esi
xor ebx, ebx
push ebp
inc ebx
mov dword [0x76a594], eax
push ebx
push ebp
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [esi + 0x310], eax
cmp dword [esi + 0x30c], ebp
jne 0x46d00a
push ebp
push ebp
push esi
push 0x46ccfe
push ebp
push ebp
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [esi + 0x308], eax
push edi
mov dword [esp + 0x224], ebp
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x120], ebp
mov dword [esi + 4], ebx
jmp 0x46d2a3
cmp dword [esi + 0x2fc], 2
mov ecx, ebp
mov dword [esp + 0x224], ebp
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x120], ebp
mov dword [esp + 0x14], 0x15180
mov dword [esp + 0x18], ebp
jne 0x46d054
mov dword [esi + 0x2fc], ebp
mov eax, dword [esi + 0x2f0]
mov eax, dword [eax + 0xc]
mov dword [esi + 0x318], eax
mov dword [esi + 0x314], 0x5265c00
cmp eax, ebp
je 0x46d104
mov ecx, dword [esi + 0x318]
test ecx, ecx
je 0x46d083
mov ecx, dword [ecx]
jmp 0x46d085
mov ecx, ebp
test ecx, ecx
je 0x46d100
cmp dword [ecx], ebp
je 0x46d0c9
mov eax, dword [esi + 0x314]
mov dword [esp + 0x10], eax
lea eax, [esp + 0x10]
push eax
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x128]
push eax
lea eax, [esp + 0x230]
push eax
push ecx
call dword [ecx]
mov eax, dword [esp + 0x24]
add esp, 0x14
cmp eax, dword [esi + 0x314]
jge 0x46d0c9
mov dword [esi + 0x314], eax
mov ecx, dword [esi + 0x318]
call fcn.0046ff59
mov eax, dword [eax + 4]
test eax, eax
jle 0x46d0e9
cmp eax, dword [esi + 0x314]
jge 0x46d0e9
mov dword [esi + 0x314], eax
mov eax, dword [esi + 0x318]
mov eax, dword [eax + 8]
mov dword [esi + 0x318], eax
test eax, eax
jne 0x46d075
mov ecx, dword [esp + 0x1c]
mov eax, dword [esi + 0x314]
mov edi, 0x3e8
cdq
idiv edi
mov dword [esp + 0x14], eax
imul eax, edx, 0x3e8
mov edx, ebp
mov dword [esp + 0x18], eax
test ecx, ecx
je 0x46d137
mov eax, dword [esi + 0x2e0]
cmp dword [esp + edx*4 + 0x20], eax
je 0x46d137
inc edx
cmp edx, ecx
jb 0x46d12c
cmp edx, ecx
jne 0x46d14e
cmp ecx, 0x40
jae 0x46d14e
mov eax, dword [esi + 0x2e0]
mov dword [esp + edx*4 + 0x20], eax
inc dword [esp + 0x1c]
push 0xffffffffffffffff
push dword [0x76a59c]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x46d1ab
mov eax, dword [esi + 0x2f4]
mov edi, dword [eax + 0xc]
mov dword [esi + 0x318], edi
test edi, edi
je 0x46d175
mov edi, dword [edi]
jmp 0x46d177
mov edi, ebp
mov ecx, dword [esi + 0x2f0]
mov edx, edi
call fcn.00470014
mov ecx, dword [esi + 0x318]
call fcn.0046ffc4
test edi, edi
je 0x46d1ab
mov eax, dword [edi + 8]
test eax, eax
je 0x46d19e
push edi
call eax
pop ecx
or dword [edi + 0x18], 0xffffffff
push ebx
push edi
call fcn.005cdee0
pop ecx
pop ecx
mov eax, dword [esi + 0x2f4]
cmp dword [eax + 4], ebp
jg 0x46d15e
push ebp
push ebx
push dword [0x76a59c]
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
inc dword [esi + 0x300]
cmp dword [esp + 0x224], ebp
jne 0x46d1ee
cmp dword [esp + 0x120], ebp
jne 0x46d1ee
push ebx
push dword [esi + 0x314]
call dword [sym.imp.KERNEL32.dll_SleepEx]
or ebx, 0xffffffff
jmp 0x46d212
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x128]
push eax
lea eax, [esp + 0x230]
push eax
push 0x40
call dword [sym.imp.WS2_32.dll_select]
mov ebx, eax
inc dword [esi + 0x304]
cmp ebx, 0xffffffff
jne 0x46d22f
mov dword [esp + 0x224], ebp
mov dword [esp + 0x120], ebp
mov dword [esp + 0x1c], ebp
mov eax, dword [esi + 0x2f0]
mov eax, dword [eax + 0xc]
jmp 0x46d296
mov edi, dword [esi + 0x318]
test edi, edi
je 0x46d248
mov edi, dword [edi]
jmp 0x46d24a
mov edi, ebp
test edi, edi
je 0x46d2a0
mov eax, dword [edi + 4]
test eax, eax
je 0x46d271
lea ecx, [esp + 0x1c]
push ecx
lea ecx, [esp + 0x124]
push ecx
lea ecx, [esp + 0x22c]
push ecx
push ebx
push edi
call eax
add esp, 0x14
mov ecx, dword [esi + 0x318]
call fcn.0046ff59
mov eax, dword [eax]
test eax, eax
je 0x46d28d
push dword [esi + 0x318]
push edi
call eax
pop ecx
pop ecx
mov eax, dword [esi + 0x318]
mov eax, dword [eax + 8]
mov dword [esi + 0x318], eax
test eax, eax
jne 0x46d23a
push 1
pop ebx
cmp dword [esi], ebp
je 0x46d025
cmp dword [esi + 0x308], ebp
je 0x46d2bf
push dword [esi + 0x310]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov edi, dword [esi + 0x2ec]
test edi, edi
je 0x46d2fd
mov edi, dword [edi + 0xc]
jmp 0x46d2e8
mov ebx, dword [edi]
test ebx, ebx
je 0x46d2e5
push dword [ebx + 4]
push esi
call dword [ebx]
push 1
push ebx
call fcn.005cdee0
add esp, 0x10
mov edi, dword [edi + 8]
test edi, edi
jne 0x46d2ce
mov ecx, dword [esi + 0x2ec]
call fcn.004700b4
mov dword [esi + 0x2ec], ebp
mov eax, dword [esi + 0x2f0]
mov eax, dword [eax + 0xc]
mov dword [esi + 0x318], eax
test eax, eax
je 0x46d319
mov eax, dword [eax + 8]
mov dword [esi + 0x318], eax
xor ebx, ebx
inc ebx
mov dword [esi], ebx
cmp dword [esi + 0x318], ebp
je 0x46d367
mov edi, dword [esi + 0x318]
test edi, edi
je 0x46d334
mov edi, dword [edi]
jmp 0x46d336
mov edi, ebp
test edi, edi
je 0x46d367
mov eax, dword [edi + 8]
test eax, eax
je 0x46d345
push edi
call eax
pop ecx
or dword [edi + 0x18], 0xffffffff
push ebx
push edi
call fcn.005cdee0
pop ecx
pop ecx
mov ecx, dword [esi + 0x318]
call fcn.0046ffc4
mov dword [esi + 0x318], eax
test eax, eax
jne 0x46d326
mov eax, dword [0x76a594]
xor ecx, ecx
cmp eax, esi
cmove eax, ecx
mov dword [0x76a594], eax
mov eax, dword [esi + 0x2f0]
mov edi, dword [eax + 0xc]
mov dword [esi + 0x318], edi
test edi, edi
je 0x46d3a9
mov edi, dword [edi]
test edi, edi
je 0x46d3a9
push edi
call dword [edi + 8]
or dword [edi + 0x18], 0xffffffff
push ebx
push edi
call fcn.005cdee0
add esp, 0xc
mov dword [esi + 0x2e4], ebp
mov ecx, dword [esi + 0x2f0]
call fcn.004700b4
mov eax, dword [esi + 0x2f4]
mov eax, dword [eax + 0xc]
jmp 0x46d3f4
mov edi, dword [esi + 0x318]
test edi, edi
je 0x46d3cd
mov edi, dword [edi]
jmp 0x46d3cf
mov edi, ebp
test edi, edi
je 0x46d3fe
mov eax, dword [edi + 8]
test eax, eax
je 0x46d3de
push edi
call eax
pop ecx
or dword [edi + 0x18], 0xffffffff
push ebx
push edi
call fcn.005cdee0
mov eax, dword [esi + 0x318]
pop ecx
pop ecx
mov eax, dword [eax + 8]
mov dword [esi + 0x318], eax
test eax, eax
jne 0x46d3bf
mov ecx, dword [esi + 0x2f4]
call fcn.004700b4
mov ecx, dword [esi + 0x2f8]
pop edi
test ecx, ecx
je 0x46d41d
push ebp
xor edx, edx
call fcn.00470250
pop ecx
mov eax, dword [esi + 0x2e0]
cmp eax, 0xffffffff
je 0x46d436
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
or dword [esi + 0x2e0], 0xffffffff
call dword [sym.imp.WS2_32.dll_WSACleanup]
mov eax, dword [0x76a590]
cmp eax, ebx
jne 0x46d456
push dword [0x76a59c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x76a590]
dec eax
push ebx
push esi
mov dword [0x76a590], eax
call fcn.005cdee0
pop ecx
pop ecx
pop ebp
pop ebx
mov ecx, dword [esp + 0x31c]
pop esi
xor ecx, esp
call fcn.0059b3f0
add esp, 0x31c
ret