Function at 0x51d570
Capabilities:
Get socket status

Disassembly:
sub esp, 0x330
mov eax, dword [0x5b3094]
xor eax, esp
mov dword [esp + 0x32c], eax
mov edx, dword [esp + 0x334]
mov dword [esp + 8], edx
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
push ebp
mov ebp, dword [esp + 0x340]
mov dword [esp + 0x10], ebp
test edx, edx
je 0x51d5cb
mov ecx, dword [esp + 0x33c]
xor eax, eax
test ecx, ecx
je 0x51d5cb
nop dword [eax]
cmp dword [edx + eax*8], 0xffffffff
jne 0x51d5fd
inc eax
cmp eax, ecx
jb 0x51d5c0
test ebp, ebp
je 0x51d916
jns 0x51d90f
push 0x2726
call dword [sym.imp.WS2_32.dll_WSASetLastError]
or eax, 0xffffffff
pop ebp
mov ecx, dword [esp + 0x32c]
xor ecx, esp
call fcn.00547055
add esp, 0x330
ret
test ebp, ebp
jle 0x51d612
call fcn.005152b0
mov dword [esp + 0x14], edx
mov edx, dword [esp + 0xc]
mov dword [esp + 0x18], eax
xor eax, eax
mov ecx, ebp
push ebx
test ebp, ebp
push esi
cmovle ecx, eax
xor ebx, ebx
push edi
xor edi, edi
mov dword [esp + 0x14], ecx
xor esi, esi
mov dword [esp + 0x30], edi
or eax, 0xffffffff
mov dword [esp + 0x134], ebx
mov dword [esp + 0x238], esi
xor ebp, ebp
mov dword [esp + 0x10], eax
xor ecx, ecx
mov word [edx + ebp*8 + 6], cx
mov ecx, dword [edx + ebp*8]
cmp ecx, 0xffffffff
je 0x51d725
movzx edx, word [edx + ebp*8 + 4]
test edx, 0x710
je 0x51d721
cmp ecx, eax
cmova eax, ecx
mov dword [esp + 0x10], eax
test edx, 0x300
je 0x51d6a1
xor eax, eax
test edi, edi
je 0x51d68b
nop
cmp dword [esp + eax*4 + 0x34], ecx
je 0x51d68b
inc eax
cmp eax, edi
jb 0x51d680
cmp eax, edi
jne 0x51d6a1
cmp edi, 0x40
jae 0x51d6a1
mov dword [esp + eax*4 + 0x34], ecx
mov edi, dword [esp + 0x30]
inc edi
mov dword [esp + 0x30], edi
test dl, 0x10
je 0x51d6dd
xor eax, eax
test ebx, ebx
je 0x51d6be
nop dword [eax]
cmp dword [esp + eax*4 + 0x138], ecx
je 0x51d6be
inc eax
cmp eax, ebx
jb 0x51d6b0
cmp eax, ebx
jne 0x51d6dd
cmp ebx, 0x40
jae 0x51d6dd
mov dword [esp + eax*4 + 0x138], ecx
mov ebx, dword [esp + 0x134]
inc ebx
mov dword [esp + 0x134], ebx
test edx, 0x600
je 0x51d71d
xor eax, eax
test esi, esi
je 0x51d6fe
nop dword [eax + eax]
cmp dword [esp + eax*4 + 0x23c], ecx
je 0x51d6fe
inc eax
cmp eax, esi
jb 0x51d6f0
cmp eax, esi
jne 0x51d71d
cmp esi, 0x40
jae 0x51d71d
mov dword [esp + eax*4 + 0x23c], ecx
mov esi, dword [esp + 0x238]
inc esi
mov dword [esp + 0x238], esi
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x18]
inc ebp
cmp ebp, dword [esp + 0x348]
jb 0x51d643
mov ebp, dword [esp + 0x1c]
test edi, edi
jne 0x51d77b
test ebx, ebx
jne 0x51d77b
test esi, esi
jne 0x51d77b
test ebp, ebp
je 0x51d777
jns 0x51d770
push 0x2726
call dword [sym.imp.WS2_32.dll_WSASetLastError]
or eax, 0xffffffff
pop edi
pop esi
pop ebx
pop ebp
mov ecx, dword [esp + 0x32c]
xor ecx, esp
call fcn.00547055
add esp, 0x330
ret
push ebp
call dword [sym.imp.KERNEL32.dll_Sleep]
xor eax, eax
jmp 0x51d757
xor ecx, ecx
lea eax, [esp + 0x28]
test ebp, ebp
cmovs eax, ecx
mov dword [esp + 0x1c], eax
mov ecx, dword [esp + 0x14]
nop
test ebp, ebp
jle 0x51d7bd
mov eax, 0x10624dd3
imul ecx
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [esp + 0x28], eax
imul eax, eax, 0x3e8
sub ecx, eax
imul eax, ecx, 0x3e8
mov dword [esp + 0x2c], eax
jmp 0x51d7cf
jne 0x51d7cf
mov dword [esp + 0x28], 0
mov dword [esp + 0x2c], 0
push dword [esp + 0x1c]
xor ecx, ecx
lea eax, [esp + 0x23c]
test esi, esi
cmove eax, ecx
test ebx, ebx
push eax
lea eax, [esp + 0x13c]
cmove eax, ecx
test edi, edi
push eax
lea eax, [esp + 0x3c]
cmove eax, ecx
push eax
mov eax, dword [esp + 0x20]
inc eax
push eax
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
jne 0x51d885
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x51d82c
cmp dword [0x64843c], 0
jne 0x51d754
cmp eax, 0x2714
jne 0x51d754
test ebp, ebp
jg 0x51d847
mov edi, dword [esp + 0x30]
mov ebx, dword [esp + 0x134]
mov esi, dword [esp + 0x238]
jmp 0x51d78a
push dword [esp + 0x20]
push dword [esp + 0x28]
call fcn.005152b0
push edx
push eax
call fcn.00515220
mov ecx, ebp
add esp, 0x10
sub ecx, eax
mov dword [esp + 0x14], ecx
test ecx, ecx
jle 0x51d777
mov edi, dword [esp + 0x30]
mov ebx, dword [esp + 0x134]
mov esi, dword [esp + 0x238]
jmp 0x51d790
test eax, eax
js 0x51d754
je 0x51d777
mov esi, dword [esp + 0x18]
xor edi, edi
add esi, 6
mov ebp, 0x300
mov ebx, 0x400
xor eax, eax
mov word [esi], ax
mov eax, dword [esi - 6]
cmp eax, 0xffffffff
je 0x51d8fb
lea ecx, [esp + 0x30]
push ecx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x51d8c5
or word [esi], bp
lea eax, [esp + 0x134]
push eax
push dword [esi - 6]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x51d8dd
or word [esi], 0x10
lea eax, [esp + 0x238]
push eax
push dword [esi - 6]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x51d8f4
or word [esi], bx
cmp word [esi], 0
je 0x51d8fb
inc edi
add esi, 8
sub dword [esp + 0x348], 1
jne 0x51d8a6
mov eax, edi
jmp 0x51d757
push ebp
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [esp + 0x330]
xor eax, eax
pop ebp
xor ecx, esp
call fcn.00547055
add esp, 0x330
ret