Function at 0x505010
Capabilities:
Get socket status

Disassembly:
sub esp, 0x334
mov eax, dword [0x6c75ac]
xor eax, esp
mov dword [esp + 0x330], eax
mov edx, dword [esp + 0x338]
mov dword [esp + 0x14], edx
push esi
test edx, edx
je 0x50504c
mov esi, dword [esp + 0x340]
xor eax, eax
test esi, esi
je 0x50504c
cmp dword [edx + eax*8], 0xffffffff
jne 0x50509a
inc eax
cmp eax, esi
jb 0x505041
mov ecx, dword [esp + 0x344]
mov eax, ecx
mov edx, dword [esp + 0x348]
or eax, edx
je 0x505407
test edx, edx
jg 0x5053f3
jl 0x505076
test ecx, ecx
jae 0x5053e8
push 0x2726
call dword [sym.imp.WS2_32.dll_WSASetLastError]
or eax, 0xffffffff
pop esi
mov ecx, dword [esp + 0x330]
xor ecx, esp
call fcn.005926d8
add esp, 0x334
ret
push ebx
push ebp
push edi
xor ebx, ebx
mov dword [esp + 0x10], 0xffffffff
xor ebp, ebp
mov dword [esp + 0x34], ebx
xor edi, edi
mov dword [esp + 0x138], ebp
xor eax, eax
mov dword [esp + 0x23c], edi
mov dword [esp + 0x14], eax
xor ecx, ecx
mov word [edx + eax*8 + 6], cx
mov ecx, dword [edx + eax*8]
cmp ecx, 0xffffffff
je 0x5051ad
jae 0x5051eb
movzx edx, word [edx + eax*8 + 4]
test dl, 7
je 0x5051a9
cmp ecx, dword [esp + 0x10]
mov eax, ecx
cmovbe eax, dword [esp + 0x10]
mov dword [esp + 0x10], eax
test dl, 1
je 0x505125
xor eax, eax
test ebx, ebx
je 0x50510f
cmp dword [esp + eax*4 + 0x38], ecx
je 0x50510f
inc eax
cmp eax, ebx
jb 0x505104
cmp eax, ebx
jne 0x505125
cmp ebx, 0x40
jae 0x505125
mov dword [esp + eax*4 + 0x38], ecx
mov ebx, dword [esp + 0x34]
inc ebx
mov dword [esp + 0x34], ebx
test dl, 4
je 0x50515d
xor eax, eax
test ebp, ebp
je 0x50513e
cmp dword [esp + eax*4 + 0x13c], ecx
je 0x50513e
inc eax
cmp eax, ebp
jb 0x505130
cmp eax, ebp
jne 0x50515d
cmp ebp, 0x40
jae 0x50515d
mov dword [esp + eax*4 + 0x13c], ecx
mov ebp, dword [esp + 0x138]
inc ebp
mov dword [esp + 0x138], ebp
test dl, 2
je 0x5051a5
xor eax, eax
test edi, edi
je 0x50517e
nop dword [eax + eax]
cmp dword [esp + eax*4 + 0x240], ecx
je 0x50517e
inc eax
cmp eax, edi
jb 0x505170
cmp eax, edi
jne 0x50519d
cmp edi, 0x40
jae 0x50519d
mov dword [esp + eax*4 + 0x240], ecx
mov edi, dword [esp + 0x23c]
inc edi
mov dword [esp + 0x23c], edi
mov eax, dword [esp + 0x10]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x24]
inc eax
mov dword [esp + 0x14], eax
cmp eax, esi
jb 0x5050c3
test ebx, ebx
jne 0x505255
test ebp, ebp
jne 0x505255
test edi, edi
jne 0x505255
mov ecx, dword [esp + 0x350]
mov eax, ecx
mov edx, dword [esp + 0x354]
or eax, edx
jne 0x505212
jmp 0x505356
push 0x2726
call dword [sym.imp.WS2_32.dll_WSASetLastError]
or eax, 0xffffffff
pop edi
pop ebp
pop ebx
pop esi
mov ecx, dword [esp + 0x330]
xor ecx, esp
call fcn.005926d8
add esp, 0x334
ret
test edx, edx
jg 0x50523a
jl 0x50521c
test ecx, ecx
jae 0x50522f
push 0x2726
call dword [sym.imp.WS2_32.dll_WSASetLastError]
or eax, 0xffffffff
jmp 0x505356
test edx, edx
jl 0x505247
jg 0x50523a
cmp ecx, 0xffffffff
jb 0x505247
mov ecx, 0xfffffffe
mov dword [esp + 0x20], 0
push ecx
call dword [sym.imp.KERNEL32.dll_Sleep]
xor eax, eax
jmp 0x505356
mov ecx, dword [esp + 0x354]
lea eax, [esp + 0x14]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x350]
test ecx, ecx
jg 0x505294
jl 0x505275
test eax, eax
jae 0x505282
mov dword [esp + 0x1c], 0
jmp 0x50531e
test ecx, ecx
jl 0x50530e
jg 0x505294
test eax, eax
je 0x50530e
push 0
push 0x3e8
push ecx
push eax
call fcn.00593320
push 0
push 0x3e8
mov esi, edx
mov dword [esp + 0x1c], eax
push esi
push eax
call fcn.00593860
mov ecx, dword [esp + 0x350]
sub ecx, eax
mov eax, dword [esp + 0x354]
push 0
push 0x3e8
sbb eax, edx
push eax
push ecx
call fcn.00593860
mov ecx, eax
test esi, esi
jl 0x505300
jg 0x5052e9
mov eax, dword [esp + 0x14]
cmp eax, 0x7fffffff
jbe 0x505304
mov eax, accept
mov dword [esp + 0x30], 0
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], ecx
jmp 0x50531e
mov eax, dword [esp + 0x14]
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], ecx
jmp 0x50531e
mov dword [esp + 0x14], 0
mov dword [esp + 0x18], 0
push dword [esp + 0x1c]
xor eax, eax
lea edx, [esp + 0x240]
test edi, edi
lea ecx, [esp + 0x13c]
cmove edx, eax
test ebp, ebp
push edx
cmove ecx, eax
xor esi, esi
test ebx, ebx
lea eax, [esp + 0x3c]
push ecx
cmove eax, esi
push eax
mov eax, dword [esp + 0x20]
inc eax
push eax
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jle 0x5051f9
mov esi, dword [esp + 0x24]
xor edi, edi
mov ebx, dword [esp + 0x34c]
add esi, 6
nop
xor eax, eax
mov word [esi], ax
mov eax, dword [esi - 6]
cmp eax, 0xffffffff
je 0x5053d9
lea ecx, [esp + 0x34]
push ecx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x505396
test byte [esi - 2], 1
je 0x505396
or word [esi], 1
lea eax, [esp + 0x138]
push eax
push dword [esi - 6]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x5053b4
test byte [esi - 2], 4
je 0x5053b4
or word [esi], 4
lea eax, [esp + 0x23c]
push eax
push dword [esi - 6]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x5053d2
test byte [esi - 2], 2
je 0x5053d2
or word [esi], 2
cmp word [esi], 0
je 0x5053d9
inc edi
add esi, 8
sub ebx, 1
jne 0x505370
mov eax, edi
jmp 0x5051f9
test edx, edx
jl 0x505400
jg 0x5053f3
cmp ecx, 0xffffffff
jb 0x505400
mov ecx, 0xfffffffe
mov dword [esp + 0x1c], 0
push ecx
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [esp + 0x334]
xor eax, eax
pop esi
xor ecx, esp
call fcn.005926d8
add esp, 0x334
ret