Function at 0x500ea0
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x320
mov ebx, dword [ebp + 0x10]
mov edx, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
mov eax, dword [0x7a9040]
xor eax, ebp
mov dword [ebp - 0x10], eax
test esi, esi
sete al
test edx, edx
sete cl
or cl, al
jne 0x500ee6
lea eax, [ebp - 0x110]
lea edi, [ebp - 0x214]
xor ecx, ecx
cmp dword [esi + ecx*8], 0xffffffff
jne 0x500f37
inc ecx
cmp edx, ecx
jne 0x500edb
mov eax, ebx
mov ecx, dword [ebp + 0x14]
or eax, ecx
je 0x500f23
test ecx, ecx
js 0x500f27
xor esi, esi
mov eax, 0xfffffffe
cmp ebx, 0xfffffffe
cmovae ebx, eax
test ecx, ecx
cmovne ebx, eax
push ebx
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00650d60
mov eax, esi
add esp, 0x320
pop esi
pop edi
pop ebx
pop ebp
ret
xor esi, esi
jmp 0x500f0c
push 0x2726
call dword [sym.imp.WS2_32.dll_WSASetLastError]
xor esi, esi
dec esi
jmp 0x500f0c
mov ebx, 0x100
mov esi, 0xff
push ebx
push esi
push eax
call fcn.006547d0
add esp, 0xc
push ebx
push esi
push edi
call fcn.006547d0
add esp, 0xc
push ebx
mov ebx, dword [ebp + 0xc]
push esi
lea eax, [ebp - 0x318]
push eax
call fcn.006547d0
add esp, 0xc
xor esi, esi
mov dword [ebp - 0x114], esi
mov dword [ebp - 0x218], esi
mov dword [ebp - 0x31c], esi
mov dword [ebp - 0x32c], 0
mov dword [ebp - 0x328], 0
xor eax, eax
jmp 0x501011
mov edi, ebx
cmp edi, ebx
mov edi, ebx
setne bl
cmp edi, 0x40
setae bh
or bh, bl
jne 0x500fc4
mov dword [ebp + edi*4 - 0x214], ecx
mov edi, dword [ebp - 0x218]
inc edi
mov dword [ebp - 0x32c], edi
mov dword [ebp - 0x218], edi
mov ebx, dword [ebp + 0xc]
test edx, 0x600
je 0x501008
xor edx, edx
test esi, esi
je 0x500fe5
cmp dword [ebp + edx*4 - 0x318], ecx
je 0x500fe5
inc edx
cmp esi, edx
jne 0x500fd5
mov edx, esi
cmp edx, esi
setne dl
cmp esi, 0x40
setae dh
or dh, dl
jne 0x501008
mov dword [ebp + esi*4 - 0x318], ecx
mov esi, dword [ebp - 0x31c]
inc esi
mov dword [ebp - 0x31c], esi
inc eax
cmp eax, ebx
je 0x5010b2
mov edx, dword [ebp + 8]
mov word [edx + eax*8 + 6], 0
mov ecx, dword [edx + eax*8]
cmp ecx, 0xffffffff
je 0x501008
movzx edx, word [edx + eax*8 + 4]
test edx, 0x710
je 0x501008
test edx, 0x300
je 0x501082
mov ebx, dword [ebp - 0x328]
xor edi, edi
test ebx, ebx
je 0x501054
cmp dword [ebp + edi*4 - 0x110], ecx
je 0x501054
inc edi
cmp ebx, edi
jne 0x501044
mov edi, ebx
cmp edi, ebx
mov edi, ebx
setne bl
cmp edi, 0x40
setae bh
or bh, bl
jne 0x50107f
mov dword [ebp + edi*4 - 0x110], ecx
mov edi, dword [ebp - 0x114]
inc edi
mov dword [ebp - 0x328], edi
mov dword [ebp - 0x114], edi
mov ebx, dword [ebp + 0xc]
test dl, 0x10
je 0x500fc7
mov ebx, dword [ebp - 0x32c]
xor edi, edi
test ebx, ebx
je 0x500f99
cmp dword [ebp + edi*4 - 0x214], ecx
je 0x500f99
inc edi
cmp ebx, edi
jne 0x50109b
jmp 0x500f97
xor eax, eax
dec eax
mov dword [ebp - 0x324], eax
mov dword [ebp - 0x320], eax
mov ecx, dword [ebp - 0x328]
mov eax, ecx
mov edi, dword [ebp - 0x32c]
or eax, edi
or eax, esi
mov edx, dword [ebp + 0x14]
jne 0x501132
mov ecx, dword [ebp + 0x10]
mov eax, ecx
or eax, edx
je 0x5010fc
test edx, edx
js 0x501122
mov eax, 0xfffffffe
cmp ecx, 0xfffffffe
cmovae ecx, eax
test edx, edx
cmovne ecx, eax
push ecx
call dword [sym.imp.KERNEL32.dll_Sleep]
xor eax, eax
mov esi, eax
cmp eax, 0xffffffff
jne 0x500f0c
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
xor ecx, ecx
cmp eax, 0x2714
setne cl
neg ecx
mov esi, ecx
jmp 0x500f0c
push 0x2726
call dword [sym.imp.WS2_32.dll_WSASetLastError]
xor eax, eax
dec eax
jmp 0x5010fe
lea eax, [ebp - 0x324]
push edx
push dword [ebp + 0x10]
push eax
mov dword [ebp - 0x328], ecx
call fcn.0050a0d0
add esp, 0xc
test esi, esi
lea ecx, [ebp - 0x31c]
cmovne esi, ecx
test edi, edi
lea ecx, [ebp - 0x218]
cmovne edi, ecx
mov edx, dword [ebp - 0x328]
test edx, edx
lea ecx, [ebp - 0x114]
cmovne edx, ecx
push eax
push esi
push edi
push edx
push 0
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jle 0x5010fe
xor esi, esi
xor edi, edi
jmp 0x5011a4
movzx eax, word [ebx + edi*8 + 6]
cmp ax, 1
sbb esi, 0xffffffff
mov ebx, dword [ebp + 0xc]
inc edi
cmp ebx, edi
je 0x500f0c
mov eax, dword [ebp + 8]
mov word [eax + edi*8 + 6], 0
mov eax, dword [eax + edi*8]
cmp eax, 0xffffffff
je 0x50119b
lea ecx, [ebp - 0x114]
push ecx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
mov ebx, dword [ebp + 8]
je 0x5011e5
mov eax, dword [ebx + edi*8 + 4]
bt eax, 8
jae 0x5011d9
or byte [ebx + edi*8 + 7], 1
test eax, 0x300
je 0x5011e5
or byte [ebx + edi*8 + 7], 3
lea eax, [ebp - 0x218]
push eax
push dword [ebx + edi*8]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x501204
test byte [ebx + edi*8 + 4], 0x10
je 0x501204
or byte [ebx + edi*8 + 6], 0x10
lea eax, [ebp - 0x31c]
push eax
push dword [ebx + edi*8]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x50118c
movzx edx, word [ebx + edi*8 + 4]
mov ecx, edx
and ecx, 0x200
or cx, word [ebx + edi*8 + 6]
mov ebx, edx
and bx, 0x400
mov eax, 1
cmove eax, ecx
test edx, 0x600
je 0x501191
movzx edx, bx
or edx, ecx
mov ecx, dword [ebp + 8]
mov word [ecx + edi*8 + 6], dx
jmp 0x501191