Function at 0x4d9ffb
Capabilities:
Get socket status

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x314
mov ecx, dword [esp + 0x328]
test ecx, ecx
je 0x4da028
mov ebp, dword [esp + 0x32c]
test ebp, ebp
je 0x4da028
xor eax, eax
cmp dword [ecx + eax*8], 0xffffffff
jne 0x4da046
inc eax
cmp ebp, eax
jne 0x4da01d
push dword [esp + 0x334]
push dword [esp + 0x334]
call fcn.004d9ec4
add esp, 0x31c
jmp 0x4da2d6
xor ebx, ebx
mov dword [esp + 0x210], ebx
mov dword [esp + 0x10c], ebx
mov dword [esp + 8], ebx
xor edi, edi
xor esi, esi
xor edx, edx
mov word [ecx + edx*8 + 6], 0
mov eax, dword [ecx + edx*8]
cmp eax, 0xffffffff
je 0x4da15c
movzx ecx, word [ecx + edx*8 + 4]
test ecx, 0x710
je 0x4da155
test ecx, 0x300
je 0x4da0d1
xor ebp, ebp
test esi, esi
je 0x4da0a2
cmp dword [esp + ebp*4 + 0x214], eax
je 0x4da0a2
inc ebp
cmp esi, ebp
jne 0x4da092
mov ebp, esi
cmp ebp, esi
jne 0x4da0ca
cmp esi, 0x3f
mov ebp, dword [esp + 0x32c]
ja 0x4da0d1
mov dword [esp + esi*4 + 0x214], eax
mov esi, dword [esp + 0x210]
inc esi
mov dword [esp + 0x210], esi
jmp 0x4da0d1
mov ebp, dword [esp + 0x32c]
test cl, 0x10
je 0x4da11b
xor ebp, ebp
test edi, edi
je 0x4da0ec
cmp dword [esp + ebp*4 + 0x110], eax
je 0x4da0ec
inc ebp
cmp edi, ebp
jne 0x4da0dc
mov ebp, edi
cmp ebp, edi
jne 0x4da114
cmp edi, 0x3f
mov ebp, dword [esp + 0x32c]
ja 0x4da11b
mov dword [esp + edi*4 + 0x110], eax
mov edi, dword [esp + 0x10c]
inc edi
mov dword [esp + 0x10c], edi
jmp 0x4da11b
mov ebp, dword [esp + 0x32c]
test ecx, 0x600
je 0x4da155
xor ecx, ecx
test ebx, ebx
je 0x4da136
cmp dword [esp + ecx*4 + 0xc], eax
je 0x4da136
inc ecx
cmp ebx, ecx
jne 0x4da129
mov ecx, ebx
cmp ecx, ebx
jne 0x4da155
cmp ebx, 0x3f
mov ecx, dword [esp + 0x328]
ja 0x4da15c
mov dword [esp + ebx*4 + 0xc], eax
mov ebx, dword [esp + 8]
inc ebx
mov dword [esp + 8], ebx
jmp 0x4da15c
mov ecx, dword [esp + 0x328]
inc edx
cmp edx, ebp
jne 0x4da060
test esi, esi
jne 0x4da18c
test edi, edi
jne 0x4da18c
test ebx, ebx
jne 0x4da18c
push dword [esp + 0x334]
push dword [esp + 0x334]
call fcn.004d9ec4
add esp, 8
jmp 0x4da2b5
mov eax, esp
push dword [esp + 0x334]
push dword [esp + 0x334]
push eax
call fcn.004e58c8
add esp, 0xc
test ebx, ebx
lea ecx, [esp + 8]
cmovne ebx, ecx
test edi, edi
lea ecx, [esp + 0x10c]
cmovne edi, ecx
test esi, esi
lea ecx, [esp + 0x210]
cmovne esi, ecx
push eax
push ebx
push edi
push esi
push 0
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jle 0x4da2b5
xor ebx, ebx
xor ebp, ebp
mov edi, dword [esp + 0x328]
mov word [edi + ebp*8 + 6], 0
mov eax, dword [edi + ebp*8]
cmp eax, 0xffffffff
je 0x4da2a5
lea ecx, [esp + 0x210]
push ecx
push eax
call sub.WS2_32.dll___WSAFDIsSet
mov ecx, dword [esp + 0x328]
test eax, eax
je 0x4da22c
mov eax, dword [ecx + ebp*8 + 4]
bt eax, 8
jae 0x4da220
or byte [ecx + ebp*8 + 7], 1
test eax, 0x300
je 0x4da22c
or byte [ecx + ebp*8 + 7], 3
lea eax, [esp + 0x10c]
push eax
push dword [ecx + ebp*8]
call sub.WS2_32.dll___WSAFDIsSet
mov edi, dword [esp + 0x328]
test eax, eax
je 0x4da253
test byte [edi + ebp*8 + 4], 0x10
je 0x4da253
or byte [edi + ebp*8 + 6], 0x10
lea eax, [esp + 8]
push eax
push dword [edi + ebp*8]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x4da299
movzx esi, word [edi + ebp*8 + 4]
mov ecx, esi
and ecx, 0x200
or cx, word [edi + ebp*8 + 6]
mov edx, esi
and dx, 0x400
mov eax, 1
cmove eax, ecx
test esi, 0x600
je 0x4da29e
movzx edx, dx
or edx, ecx
mov word [edi + ebp*8 + 6], dx
jmp 0x4da29e
movzx eax, word [edi + ebp*8 + 6]
cmp ax, 1
sbb ebx, 0xffffffff
inc ebp
cmp dword [esp + 0x32c], ebp
jne 0x4da1e5
jmp 0x4da2ce
mov ebx, eax
cmp eax, 0xffffffff
jne 0x4da2ce
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
xor ebx, ebx
cmp eax, 0x2714
setne bl
neg ebx
mov eax, ebx
add esp, 0x314
pop esi
pop edi
pop ebx
pop ebp
ret