Function at 0x4af500
Capabilities:
Get socket status

Disassembly:
sub esp, 0x33c
mov eax, dword [0x6009e4]
xor eax, esp
mov dword [esp + 0x334], eax
push ebx
push ebp
push esi
mov esi, ecx
push edi
test esi, esi
je 0x4afb24
mov dword [esi + 0x304], 0
mov dword [esi + 0x300], 0
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 0
push 0x1fffff
call dword [sym.imp.KERNEL32.dll_OpenThread]
mov dword [esi + 0x10], eax
mov eax, dword [0x6234ec]
test eax, eax
mov dword [esp + 0x238], 0
cmove eax, esi
mov dword [esp + 0x28], 0
cmp dword [esi], 0
mov dword [0x6234ec], eax
mov dword [esp + 0x130], 0
mov dword [esi + 4], 1
jne 0x4af8a2
mov ebp, dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
mov ebx, 0x3e8
mov eax, dword [esi + 0x2f0]
xor edi, edi
mov dword [esp + 0x238], 0
mov dword [esp + 0x28], edi
mov dword [esp + 0x130], edi
mov dword [esp + 0x14], 0x15180
mov dword [esp + 0x18], edi
mov eax, dword [eax + 0xc]
mov dword [esi + 0x318], eax
mov dword [esi + 0x314], 0x5265c00
test eax, eax
je 0x4af683
nop dword [eax + eax]
mov ecx, dword [esi + 0x318]
test ecx, ecx
je 0x4af67f
mov ecx, dword [ecx]
test ecx, ecx
je 0x4af67f
cmp dword [ecx], edi
je 0x4af646
mov eax, dword [esi + 0x314]
mov dword [esp + 0x10], eax
lea eax, [esp + 0x10]
push eax
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x138]
push eax
lea eax, [esp + 0x244]
push eax
mov eax, dword [ecx]
push ecx
call eax
mov eax, dword [esp + 0x24]
add esp, 0x14
cmp eax, dword [esi + 0x314]
jge 0x4af646
mov dword [esi + 0x314], eax
mov eax, dword [esi + 0x318]
test eax, eax
je 0x4af653
add eax, 0x14
mov eax, dword [eax + 4]
test eax, eax
jle 0x4af668
cmp eax, dword [esi + 0x314]
jge 0x4af668
mov dword [esi + 0x314], eax
mov eax, dword [esi + 0x318]
mov eax, dword [eax + 8]
mov dword [esi + 0x318], eax
test eax, eax
jne 0x4af5f0
mov edi, dword [esp + 0x28]
mov eax, dword [esi + 0x314]
xor ecx, ecx
cdq
idiv ebx
mov dword [esp + 0x14], eax
imul eax, edx, 0x3e8
mov dword [esp + 0x18], eax
test edi, edi
je 0x4af6b1
mov eax, dword [esi + 0x2e0]
cmp dword [esp + ecx*4 + 0x2c], eax
je 0x4af6b1
inc ecx
cmp ecx, edi
jb 0x4af6a6
cmp ecx, edi
jne 0x4af6c8
cmp edi, 0x40
jae 0x4af6c8
mov eax, dword [esi + 0x2e0]
mov dword [esp + ecx*4 + 0x2c], eax
inc dword [esp + 0x28]
push 0xffffffffffffffff
push dword [0x6234f4]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [esi + 0x2f4]
cmp dword [eax + 4], 0
jle 0x4af790
nop word [eax + eax]
mov eax, dword [esi + 0x2f4]
mov edi, dword [eax + 0xc]
mov dword [esi + 0x318], edi
test edi, edi
je 0x4af707
mov edi, dword [edi]
jmp 0x4af709
xor edi, edi
mov ecx, dword [esi + 0x2f0]
mov edx, edi
call fcn.004b2f20
mov ecx, dword [esi + 0x318]
test ecx, ecx
je 0x4af766
mov ebx, dword [ecx + 0xc]
mov edx, dword [ecx + 4]
test ebx, ebx
je 0x4af730
mov eax, dword [ecx + 8]
mov dword [ebx + 8], eax
mov ebx, dword [ecx + 8]
test ebx, ebx
je 0x4af73d
mov eax, dword [ecx + 0xc]
mov dword [ebx + 0xc], eax
cmp dword [edx + 0xc], ecx
jne 0x4af748
mov eax, dword [ecx + 8]
mov dword [edx + 0xc], eax
cmp dword [edx + 0x10], ecx
jne 0x4af75a
mov eax, dword [ecx + 8]
test eax, eax
jne 0x4af757
mov eax, dword [ecx + 0xc]
mov dword [edx + 0x10], eax
dec dword [edx + 4]
push ecx
call fcn.0058bf82
add esp, 4
test edi, edi
je 0x4af780
mov eax, dword [edi + 8]
test eax, eax
je 0x4af777
push edi
call eax
add esp, 4
push edi
call fcn.0058bf82
add esp, 4
mov eax, dword [esi + 0x2f4]
cmp dword [eax + 4], 0
jg 0x4af6f0
push 0
push 1
push dword [0x6234f4]
call ebp
inc dword [esi + 0x300]
cmp dword [esp + 0x238], 0
jne 0x4af7c9
cmp dword [esp + 0x130], 0
jne 0x4af7c9
push 1
push dword [esi + 0x314]
call dword [sym.imp.KERNEL32.dll_SleepEx]
or ebx, 0xffffffff
jmp 0x4af7ed
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x138]
push eax
lea eax, [esp + 0x244]
push eax
push 0x40
call dword [sym.imp.WS2_32.dll_select]
mov ebx, eax
inc dword [esi + 0x304]
cmp ebx, 0xffffffff
jne 0x4af816
mov dword [esp + 0x238], 0
mov dword [esp + 0x130], 0
mov dword [esp + 0x28], 0
mov eax, dword [esi + 0x2f0]
mov eax, dword [eax + 0xc]
mov dword [esi + 0x318], eax
test eax, eax
je 0x4af894
nop dword [eax]
mov edi, dword [esi + 0x318]
test edi, edi
je 0x4af894
mov edi, dword [edi]
test edi, edi
je 0x4af894
mov eax, dword [edi + 4]
test eax, eax
je 0x4af863
lea ecx, [esp + 0x28]
push ecx
lea ecx, [esp + 0x134]
push ecx
lea ecx, [esp + 0x240]
push ecx
push ebx
push edi
call eax
add esp, 0x14
mov eax, dword [esi + 0x318]
test eax, eax
jne 0x4af871
xor ecx, ecx
jmp 0x4af874
lea ecx, [eax + 0x14]
mov ecx, dword [ecx]
test ecx, ecx
je 0x4af881
push eax
push edi
call ecx
add esp, 8
mov eax, dword [esi + 0x318]
mov eax, dword [eax + 8]
mov dword [esi + 0x318], eax
test eax, eax
jne 0x4af830
cmp dword [esi], 0
mov ebx, 0x3e8
je 0x4af5a3
cmp dword [esi + 0x308], 0
je 0x4af8b7
push dword [esi + 0x310]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov edi, dword [esi + 0x2ec]
test edi, edi
je 0x4af8fb
mov edi, dword [edi + 0xc]
test edi, edi
je 0x4af8e6
mov ebx, dword [edi]
test ebx, ebx
je 0x4af8df
push dword [ebx + 4]
mov eax, dword [ebx]
push esi
call eax
push ebx
call fcn.0058bf82
add esp, 0xc
mov edi, dword [edi + 8]
test edi, edi
jne 0x4af8c8
mov ecx, dword [esi + 0x2ec]
call fcn.004b2f90
mov dword [esi + 0x2ec], 0
mov eax, dword [esi + 0x2f0]
mov eax, dword [eax + 0xc]
mov dword [esi + 0x318], eax
test eax, eax
je 0x4af917
mov eax, dword [eax + 8]
mov dword [esi + 0x318], eax
cmp dword [esi + 0x318], 0
mov dword [esi], 1
je 0x4af9c8
nop word [eax + eax]
mov edi, dword [esi + 0x318]
test edi, edi
je 0x4af9c8
mov edi, dword [edi]
test edi, edi
je 0x4af9c8
mov eax, dword [edi + 8]
test eax, eax
je 0x4af955
push edi
call eax
add esp, 4
push edi
call fcn.0058bf82
mov ecx, dword [esi + 0x318]
add esp, 4
test ecx, ecx
je 0x4af9be
mov eax, dword [ecx + 0xc]
mov edx, dword [ecx + 4]
mov edi, dword [ecx + 8]
test eax, eax
je 0x4af978
mov dword [eax + 8], edi
mov ebx, dword [ecx + 8]
test ebx, ebx
je 0x4af985
mov eax, dword [ecx + 0xc]
mov dword [ebx + 0xc], eax
cmp dword [edx + 0xc], ecx
jne 0x4af990
mov eax, dword [ecx + 8]
mov dword [edx + 0xc], eax
cmp dword [edx + 0x10], ecx
jne 0x4af9a2
mov eax, dword [ecx + 8]
test eax, eax
jne 0x4af99f
mov eax, dword [ecx + 0xc]
mov dword [edx + 0x10], eax
dec dword [edx + 4]
push ecx
call fcn.0058bf82
add esp, 4
mov dword [esi + 0x318], edi
test edi, edi
jne 0x4af930
jmp 0x4af9c8
mov dword [esi + 0x318], 0
mov eax, dword [0x6234ec]
xor ecx, ecx
cmp eax, esi
cmove eax, ecx
mov dword [0x6234ec], eax
mov eax, dword [esi + 0x2f0]
mov edi, dword [eax + 0xc]
mov dword [esi + 0x318], edi
test edi, edi
je 0x4afa0b
mov edi, dword [edi]
test edi, edi
je 0x4afa0b
mov eax, dword [edi + 8]
push edi
call eax
push edi
call fcn.0058bf82
add esp, 8
mov dword [esi + 0x2e4], 0
mov ecx, dword [esi + 0x2f0]
call fcn.004b2f90
mov eax, dword [esi + 0x2f4]
mov eax, dword [eax + 0xc]
mov dword [esi + 0x318], eax
test eax, eax
je 0x4afa69
nop dword [eax]
mov edi, dword [esi + 0x318]
test edi, edi
je 0x4afa69
mov edi, dword [edi]
test edi, edi
je 0x4afa69
mov eax, dword [edi + 8]
test eax, eax
je 0x4afa4d
push edi
call eax
add esp, 4
push edi
call fcn.0058bf82
mov eax, dword [esi + 0x318]
add esp, 4
mov eax, dword [eax + 8]
mov dword [esi + 0x318], eax
test eax, eax
jne 0x4afa30
mov ecx, dword [esi + 0x2f4]
call fcn.004b2f90
mov ebx, dword [esi + 0x2f8]
mov ebp, dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
je 0x4afadc
mov edi, dword [ebx]
lea eax, [esp + 0x1c]
xorps xmm0, xmm0
mov dword [esp + 0x24], 0
movq qword [esp + 0x1c], xmm0
mov edx, 0x4b3170
push 1
push eax
mov ecx, edi
mov dword [esp + 0x24], ebx
mov dword [esp + 0x28], 0
mov dword [esp + 0x2c], 0
call fcn.004b3a50
add esp, 8
push dword [edi + 0xc]
call ebp
push dword [edi]
call fcn.0058bf82
push edi
call fcn.0058bf82
push ebx
call fcn.0058bf82
add esp, 0xc
mov eax, dword [esi + 0x2e0]
cmp eax, 0xffffffff
je 0x4afaf8
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esi + 0x2e0], 0xffffffff
call dword [sym.imp.WS2_32.dll_WSACleanup]
mov eax, dword [0x6234e8]
cmp eax, 1
jne 0x4afb15
push dword [0x6234f4]
call ebp
mov eax, dword [0x6234e8]
dec eax
push esi
mov dword [0x6234e8], eax
call fcn.0058bf82
add esp, 4
mov ecx, dword [esp + 0x344]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00584a28
add esp, 0x33c
ret