Function at 0x514780
Capabilities:
Get socket status

Disassembly:
sub esp, 0x328
mov eax, dword [0x6218c0]
xor eax, esp
mov dword [esp + 0x324], eax
mov ecx, dword [esp + 0x32c]
mov dword [esp + 0x10], ecx
push ebp
test ecx, ecx
je 0x5147bc
mov ebp, dword [esp + 0x334]
xor eax, eax
test ebp, ebp
je 0x5147bc
cmp dword [ecx + eax*8], 0xffffffff
jne 0x51480a
inc eax
cmp eax, ebp
jb 0x5147b1
mov ecx, dword [esp + 0x338]
mov eax, ecx
mov edx, dword [esp + 0x33c]
or eax, edx
je 0x514adc
test edx, edx
jg 0x514ac8
jl 0x5147e6
test ecx, ecx
jae 0x514abd
push 0x2726
call dword [sym.imp.WS2_32.dll_WSASetLastError]
or eax, 0xffffffff
pop ebp
mov ecx, dword [esp + 0x324]
xor ecx, esp
call fcn.0057029b
add esp, 0x328
ret
push ebx
push esi
or eax, 0xffffffff
lea ebx, [ecx + 4]
push edi
xor edi, edi
mov dword [esp + 0x10], eax
xor esi, esi
mov dword [esp + 0x28], edi
xor edx, edx
mov dword [esp + 0x12c], esi
xor eax, eax
mov dword [esp + 0x230], edx
mov dword [esp + 0x18], eax
xor ecx, ecx
mov word [ebx + 2], cx
mov ecx, dword [ebx - 4]
cmp ecx, 0xffffffff
je 0x514928
jae 0x51495f
movzx eax, word [ebx]
mov ebp, eax
mov dword [esp + 0x14], ebp
test eax, 0x710
je 0x51491d
mov ebp, dword [esp + 0x10]
cmp ecx, ebp
cmova ebp, ecx
mov dword [esp + 0x10], ebp
test eax, 0x300
je 0x5148a1
xor eax, eax
test edi, edi
je 0x51488b
nop dword [eax + eax]
cmp dword [esp + eax*4 + 0x2c], ecx
je 0x51488b
inc eax
cmp eax, edi
jb 0x514880
cmp eax, edi
jne 0x5148a1
cmp edi, 0x40
jae 0x5148a1
mov dword [esp + eax*4 + 0x2c], ecx
mov edi, dword [esp + 0x28]
inc edi
mov dword [esp + 0x28], edi
mov eax, dword [esp + 0x14]
test al, 0x10
je 0x5148e1
xor eax, eax
test esi, esi
je 0x5148be
nop
cmp dword [esp + eax*4 + 0x130], ecx
je 0x5148be
inc eax
cmp eax, esi
jb 0x5148b0
cmp eax, esi
jne 0x5148dd
cmp esi, 0x40
jae 0x5148dd
mov dword [esp + eax*4 + 0x130], ecx
mov esi, dword [esp + 0x12c]
inc esi
mov dword [esp + 0x12c], esi
mov eax, dword [esp + 0x14]
test eax, 0x600
je 0x51491d
xor eax, eax
test edx, edx
je 0x5148fe
nop
cmp dword [esp + eax*4 + 0x234], ecx
je 0x5148fe
inc eax
cmp eax, edx
jb 0x5148f0
cmp eax, edx
jne 0x51491d
cmp edx, 0x40
jae 0x51491d
mov dword [esp + eax*4 + 0x234], ecx
mov edx, dword [esp + 0x230]
inc edx
mov dword [esp + 0x230], edx
mov ebp, dword [esp + 0x340]
mov eax, dword [esp + 0x18]
inc eax
add ebx, 8
mov dword [esp + 0x18], eax
cmp eax, ebp
jb 0x514835
test edi, edi
jne 0x514986
test esi, esi
jne 0x514986
test edx, edx
jne 0x514986
push dword [esp + 0x348]
push dword [esp + 0x348]
call fcn.00514c30
add esp, 8
jmp 0x5149e2
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 + 0x324]
xor ecx, esp
call fcn.0057029b
add esp, 0x328
ret
push dword [esp + 0x348]
lea eax, [esp + 0x1c]
push dword [esp + 0x348]
push eax
call fcn.00520850
add esp, 0xc
lea esi, [esp + 0x230]
lea ecx, [esp + 0x12c]
push eax
xor eax, eax
cmp dword [esp + 0x234], eax
cmove esi, eax
cmp dword [esp + 0x130], eax
push esi
cmove ecx, eax
xor edi, edi
cmp dword [esp + 0x30], edi
lea eax, [esp + 0x30]
push ecx
cmove eax, edi
push eax
mov eax, dword [esp + 0x20]
inc eax
push eax
call dword [sym.imp.WS2_32.dll_select]
mov esi, eax
test esi, esi
jg 0x514a04
cmp esi, 0xffffffff
jne 0x5149fd
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
xor ecx, ecx
cmp eax, 0x2714
cmove esi, ecx
mov eax, esi
jmp 0x51496d
mov esi, dword [esp + 0x20]
xor edi, edi
add esi, 6
mov ebx, 0x300
xor eax, eax
mov word [esi], ax
mov eax, dword [esi - 6]
cmp eax, 0xffffffff
je 0x514aaa
lea ecx, [esp + 0x28]
push ecx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x514a4f
movzx eax, word [esi - 2]
test eax, 0x100
je 0x514a45
mov ecx, 0x100
or word [esi], cx
test eax, 0x300
je 0x514a4f
or word [esi], bx
lea eax, [esp + 0x12c]
push eax
push dword [esi - 6]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x514a6d
test byte [esi - 2], 0x10
je 0x514a6d
or word [esi], 0x10
lea eax, [esp + 0x230]
push eax
push dword [esi - 6]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x514aa3
movzx eax, word [esi - 2]
test eax, 0x200
je 0x514a94
mov ecx, 0x200
or word [esi], cx
test eax, 0x400
je 0x514aa3
mov eax, 0x400
or word [esi], ax
cmp word [esi], 0
je 0x514aaa
inc edi
add esi, 8
sub ebp, 1
jne 0x514a12
mov eax, edi
jmp 0x51496d
test edx, edx
jl 0x514ad5
jg 0x514ac8
cmp ecx, 0xffffffff
jb 0x514ad5
mov ecx, 0xfffffffe
mov dword [esp + 0x18], 0
push ecx
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [esp + 0x328]
xor eax, eax
pop ebp
xor ecx, esp
call fcn.0057029b
add esp, 0x328
ret