Function at 0x402c0a
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc14
cmp dword [ebp + 0xc], 2
jne 0x402c39
mov eax, dword [ebp + 8]
push eax
call fcn.00402724
add esp, 4
mov ecx, dword [ebp + 8]
cmp dword [ecx + 0x58], 0
je 0x402c39
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x58]
jmp 0x402efe
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x94]
and ecx, 1
test ecx, ecx
je 0x402c54
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x58]
jmp 0x402efe
lea eax, [ebp - 0x808]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x534]
push edx
call fcn.00409247
add esp, 8
test eax, eax
jge 0x402c7d
mov eax, dword [ebp + 8]
push eax
call fcn.00405f6d
add esp, 4
cmp dword [ebp - 0x808], 0
jne 0x402da1
mov ecx, dword [ebp + 8]
cmp dword [ecx + 0x58], 0
jne 0x402da1
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0xc]
add eax, 1
mov ecx, dword [ebp + 8]
mov dword [ecx + 0xc], eax
mov edx, dword [ebp + 8]
cmp dword [edx + 0xc], 0x100
jl 0x402da1
mov eax, dword [ebp + 8]
mov dword [eax + 0xc], 0
mov dword [ebp - 0xc14], 0
cmp dword [ebp - 0xc14], 0x100
jae 0x402d0f
lea ecx, [ebp - 0xc14]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx + 8]
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x402d0f
mov ecx, dword [ebp - 0xc14]
mov edx, dword [ebp + 8]
mov eax, dword [edx + 8]
mov dword [ebp + ecx*4 - 0xc10], eax
mov ecx, dword [ebp - 0xc14]
add ecx, 1
mov dword [ebp - 0xc14], ecx
xor edx, edx
test edx, edx
jne 0x402cca
push 0x493cc8
push 0
push 0
lea eax, [ebp - 0xc14]
push eax
push 0
call sub.WS2_32.dll_select
mov dword [ebp - 0x808], eax
cmp dword [ebp - 0x808], 0
je 0x402da1
cmp dword [ebp - 0x808], 0
jle 0x402d82
lea ecx, [ebp - 0x808]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x534]
push eax
call fcn.00409247
add esp, 8
test eax, eax
jge 0x402d6d
mov ecx, dword [ebp + 8]
push ecx
call fcn.00405f6d
add esp, 4
cmp dword [ebp - 0x808], 0
jne 0x402d80
mov dword [ebp - 0x808], 0x20
jmp 0x402da1
cmp dword [ebp - 0x808], 0
jge 0x402da1
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 4
je 0x402da1
mov edx, dword [ebp + 8]
push edx
call fcn.00405f6d
add esp, 4
mov eax, dword [ebp - 0x808]
mov dword [ebp - 0x80c], eax
cmp dword [ebp - 0x80c], 0
jne 0x402dc1
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x58]
jmp 0x402efe
lea edx, [ebp - 0x800]
mov dword [ebp - 0x810], edx
cmp dword [ebp - 0x80c], 0x20
jge 0x402de2
mov dword [ebp - 0x80c], 0x20
jmp 0x402df8
cmp dword [ebp - 0x80c], 0x800
jle 0x402df8
mov dword [ebp - 0x80c], 0x800
mov eax, dword [ebp - 0x80c]
cdq
and edx, 0x1f
add eax, edx
sar eax, 5
shl eax, 5
mov dword [ebp - 0x80c], eax
mov eax, dword [ebp + 8]
mov dword [eax + 0xc], 0
mov ecx, dword [ebp - 0x80c]
push ecx
mov edx, dword [ebp - 0x810]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.00403161
add esp, 0xc
lea ecx, [ebp - 0x800]
mov dword [ebp - 0x804], ecx
cmp dword [ebp - 0x80c], 0
jle 0x402ef8
mov edx, dword [ebp - 0x804]
xor eax, eax
mov al, byte [edx]
cmp eax, 1
jne 0x402e9f
mov ecx, dword [ebp - 0x80c]
mov dword [ebp - 0x808], ecx
push 1
lea edx, [ebp - 0x808]
push edx
mov eax, dword [ebp - 0x804]
push eax
mov ecx, dword [ebp - 0x804]
push ecx
mov edx, dword [ebp + 8]
push edx
call fcn.004041f4
add esp, 0x14
mov dword [ebp - 0x804], eax
mov eax, dword [ebp - 0x808]
mov dword [ebp - 0x80c], eax
jmp 0x402ef3
mov ecx, dword [ebp - 0x804]
xor edx, edx
mov dl, byte [ecx]
test edx, edx
jne 0x402ec2
mov eax, dword [ebp - 0x804]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.00405e69
add esp, 8
jmp 0x402ed5
mov edx, dword [ebp - 0x804]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.004049a9
add esp, 8
mov ecx, dword [ebp - 0x804]
add ecx, 0x20
mov dword [ebp - 0x804], ecx
mov edx, dword [ebp - 0x80c]
sub edx, 0x20
mov dword [ebp - 0x80c], edx
jmp 0x402e40
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x58]
mov esp, ebp
pop ebp
ret