Function at 0x407130
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x384
push ebx
push esi
push edi
mov dword [ebp - 0x324], 0
mov dword [ebp - 0x320], 0
mov dword [ebp - 0x328], 1
mov dword [ebp - 0x330], 0
cmp dword [ebp + 8], 0
je 0x4071ad
mov dword [ebp - 0x32c], 0
jmp 0x407185
mov eax, dword [ebp - 0x32c]
add eax, 1
mov dword [ebp - 0x32c], eax
mov ecx, dword [ebp - 0x32c]
cmp ecx, dword [ebp + 0xc]
jae 0x4071ad
mov edx, dword [ebp - 0x32c]
mov eax, dword [ebp + 8]
cmp dword [eax + edx*8], 0xffffffff
je 0x4071ab
mov dword [ebp - 0x328], 0
jmp 0x4071ad
jmp 0x407176
cmp dword [ebp - 0x328], 0
je 0x4071d3
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.00406aa0
add esp, 4
mov dword [ebp - 0x338], eax
mov eax, dword [ebp - 0x338]
jmp 0x40776c
cmp dword [ebp + 0x10], 0
jle 0x4071f3
mov edx, dword [ebp + 0x10]
mov dword [ebp - 0x330], edx
call fcn.00419aa0
mov dword [ebp - 0x324], eax
mov dword [ebp - 0x320], edx
mov dword [ebp - 0x110], 0
mov dword [ebp - 0x214], 0
mov dword [ebp - 0x318], 0
mov dword [ebp - 0x31c], 0xffffffff
mov dword [ebp - 0x32c], 0
jmp 0x407236
mov eax, dword [ebp - 0x32c]
add eax, 1
mov dword [ebp - 0x32c], eax
mov ecx, dword [ebp - 0x32c]
cmp ecx, dword [ebp + 0xc]
jae 0x4074ae
mov edx, dword [ebp - 0x32c]
mov eax, dword [ebp + 8]
mov word [eax + edx*8 + 6], 0
mov ecx, dword [ebp - 0x32c]
mov edx, dword [ebp + 8]
cmp dword [edx + ecx*8], 0xffffffff
jne 0x407266
jmp 0x407227
xor eax, eax
test eax, eax
jne 0x407266
mov ecx, dword [ebp - 0x32c]
mov edx, dword [ebp + 8]
movsx eax, word [edx + ecx*8 + 4]
and eax, 7
test eax, eax
je 0x4074a9
mov ecx, dword [ebp - 0x32c]
mov edx, dword [ebp + 8]
mov eax, dword [edx + ecx*8]
cmp eax, dword [ebp - 0x31c]
jbe 0x4072ab
mov ecx, dword [ebp - 0x32c]
mov edx, dword [ebp + 8]
mov eax, dword [edx + ecx*8]
mov dword [ebp - 0x31c], eax
mov ecx, dword [ebp - 0x32c]
mov edx, dword [ebp + 8]
movsx eax, word [edx + ecx*8 + 4]
and eax, 1
test eax, eax
je 0x407355
mov dword [ebp - 0x33c], 0
jmp 0x4072df
mov ecx, dword [ebp - 0x33c]
add ecx, 1
mov dword [ebp - 0x33c], ecx
mov edx, dword [ebp - 0x33c]
cmp edx, dword [ebp - 0x110]
jae 0x40730c
mov eax, dword [ebp - 0x33c]
mov ecx, dword [ebp - 0x32c]
mov edx, dword [ebp + 8]
mov eax, dword [ebp + eax*4 - 0x10c]
cmp eax, dword [edx + ecx*8]
jne 0x40730a
jmp 0x40730c
jmp 0x4072d0
mov ecx, dword [ebp - 0x33c]
cmp ecx, dword [ebp - 0x110]
jne 0x40734b
cmp dword [ebp - 0x110], 0x40
jae 0x40734b
mov edx, dword [ebp - 0x33c]
mov eax, dword [ebp - 0x32c]
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + eax*8]
mov dword [ebp + edx*4 - 0x10c], eax
mov ecx, dword [ebp - 0x110]
add ecx, 1
mov dword [ebp - 0x110], ecx
xor edx, edx
test edx, edx
jne 0x4072c4
mov eax, dword [ebp - 0x32c]
mov ecx, dword [ebp + 8]
movsx edx, word [ecx + eax*8 + 4]
and edx, 4
test edx, edx
je 0x4073ff
mov dword [ebp - 0x340], 0
jmp 0x407389
mov eax, dword [ebp - 0x340]
add eax, 1
mov dword [ebp - 0x340], eax
mov ecx, dword [ebp - 0x340]
cmp ecx, dword [ebp - 0x214]
jae 0x4073b6
mov edx, dword [ebp - 0x340]
mov eax, dword [ebp - 0x32c]
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + edx*4 - 0x210]
cmp edx, dword [ecx + eax*8]
jne 0x4073b4
jmp 0x4073b6
jmp 0x40737a
mov eax, dword [ebp - 0x340]
cmp eax, dword [ebp - 0x214]
jne 0x4073f5
cmp dword [ebp - 0x214], 0x40
jae 0x4073f5
mov ecx, dword [ebp - 0x340]
mov edx, dword [ebp - 0x32c]
mov eax, dword [ebp + 8]
mov edx, dword [eax + edx*8]
mov dword [ebp + ecx*4 - 0x210], edx
mov eax, dword [ebp - 0x214]
add eax, 1
mov dword [ebp - 0x214], eax
xor ecx, ecx
test ecx, ecx
jne 0x40736e
mov edx, dword [ebp - 0x32c]
mov eax, dword [ebp + 8]
movsx ecx, word [eax + edx*8 + 4]
and ecx, 2
test ecx, ecx
je 0x4074a9
mov dword [ebp - 0x344], 0
jmp 0x407433
mov edx, dword [ebp - 0x344]
add edx, 1
mov dword [ebp - 0x344], edx
mov eax, dword [ebp - 0x344]
cmp eax, dword [ebp - 0x318]
jae 0x407460
mov ecx, dword [ebp - 0x344]
mov edx, dword [ebp - 0x32c]
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + ecx*4 - 0x314]
cmp ecx, dword [eax + edx*8]
jne 0x40745e
jmp 0x407460
jmp 0x407424
mov edx, dword [ebp - 0x344]
cmp edx, dword [ebp - 0x318]
jne 0x40749f
cmp dword [ebp - 0x318], 0x40
jae 0x40749f
mov eax, dword [ebp - 0x344]
mov ecx, dword [ebp - 0x32c]
mov edx, dword [ebp + 8]
mov ecx, dword [edx + ecx*8]
mov dword [ebp + eax*4 - 0x314], ecx
mov edx, dword [ebp - 0x318]
add edx, 1
mov dword [ebp - 0x318], edx
xor eax, eax
test eax, eax
jne 0x407418
jmp 0x407227
cmp dword [ebp - 0x110], 0
jne 0x4074e6
cmp dword [ebp - 0x214], 0
jne 0x4074e6
cmp dword [ebp - 0x318], 0
jne 0x4074e6
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.00406aa0
add esp, 4
mov dword [ebp - 0x338], eax
mov eax, dword [ebp - 0x338]
jmp 0x40776c
xor edx, edx
cmp dword [ebp + 0x10], 0
setl dl
dec edx
lea eax, [ebp - 8]
and edx, eax
mov dword [ebp - 0xc], edx
cmp dword [ebp + 0x10], 0
jle 0x407528
mov eax, dword [ebp - 0x330]
cdq
mov ecx, 0x3e8
idiv ecx
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0x330]
cdq
mov ecx, 0x3e8
idiv ecx
imul edx, edx, 0x3e8
mov dword [ebp - 4], edx
jmp 0x40753c
cmp dword [ebp + 0x10], 0
jne 0x40753c
mov dword [ebp - 8], 0
mov dword [ebp - 4], 0
mov edx, dword [ebp - 0xc]
push edx
mov eax, dword [ebp - 0x318]
neg eax
sbb eax, eax
lea ecx, [ebp - 0x318]
and eax, ecx
push eax
mov edx, dword [ebp - 0x214]
neg edx
sbb edx, edx
lea eax, [ebp - 0x214]
and edx, eax
push edx
mov ecx, dword [ebp - 0x110]
neg ecx
sbb ecx, ecx
lea edx, [ebp - 0x110]
and ecx, edx
push ecx
mov eax, dword [ebp - 0x31c]
add eax, 1
push eax
call dword [sym.imp.WS2_32.dll_select]
mov dword [ebp - 0x338], eax
cmp dword [ebp - 0x338], 0xffffffff
je 0x40759a
jmp 0x407616
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0x334], eax
cmp dword [ebp - 0x334], 0
je 0x4075c6
cmp dword [0x46c77c], 0
jne 0x4075c4
cmp dword [ebp - 0x334], 0x2714
je 0x4075c6
jmp 0x407616
cmp dword [ebp + 0x10], 0
jle 0x407609
mov ecx, dword [ebp - 0x320]
push ecx
mov edx, dword [ebp - 0x324]
push edx
call fcn.00419aa0
push edx
push eax
call fcn.00419af0
add esp, 0x10
mov ecx, dword [ebp + 0x10]
sub ecx, eax
mov dword [ebp - 0x330], ecx
cmp dword [ebp - 0x330], 0
jg 0x407609
mov dword [ebp - 0x338], 0
jmp 0x407616
cmp dword [ebp - 0x338], 0xffffffff
je 0x4074f8
cmp dword [ebp - 0x338], 0
jge 0x407627
or eax, 0xffffffff
jmp 0x40776c
cmp dword [ebp - 0x338], 0
jne 0x407637
xor eax, eax
jmp 0x40776c
mov dword [ebp - 0x338], 0
mov dword [ebp - 0x32c], 0
jmp 0x40765c
mov edx, dword [ebp - 0x32c]
add edx, 1
mov dword [ebp - 0x32c], edx
mov eax, dword [ebp - 0x32c]
cmp eax, dword [ebp + 0xc]
jae 0x407766
mov ecx, dword [ebp - 0x32c]
mov edx, dword [ebp + 8]
mov word [edx + ecx*8 + 6], 0
mov eax, dword [ebp - 0x32c]
mov ecx, dword [ebp + 8]
cmp dword [ecx + eax*8], 0xffffffff
jne 0x40768c
jmp 0x40764d
lea edx, [ebp - 0x110]
push edx
mov eax, dword [ebp - 0x32c]
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + eax*8]
push edx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x4076c8
mov eax, dword [ebp - 0x32c]
mov ecx, dword [ebp + 8]
mov dx, word [ecx + eax*8 + 6]
or dl, 1
mov eax, dword [ebp - 0x32c]
mov ecx, dword [ebp + 8]
mov word [ecx + eax*8 + 6], dx
lea edx, [ebp - 0x214]
push edx
mov eax, dword [ebp - 0x32c]
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + eax*8]
push edx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x407704
mov eax, dword [ebp - 0x32c]
mov ecx, dword [ebp + 8]
mov dx, word [ecx + eax*8 + 6]
or dl, 4
mov eax, dword [ebp - 0x32c]
mov ecx, dword [ebp + 8]
mov word [ecx + eax*8 + 6], dx
lea edx, [ebp - 0x318]
push edx
mov eax, dword [ebp - 0x32c]
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + eax*8]
push edx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x407740
mov eax, dword [ebp - 0x32c]
mov ecx, dword [ebp + 8]
mov dx, word [ecx + eax*8 + 6]
or dl, 2
mov eax, dword [ebp - 0x32c]
mov ecx, dword [ebp + 8]
mov word [ecx + eax*8 + 6], dx
mov edx, dword [ebp - 0x32c]
mov eax, dword [ebp + 8]
movsx ecx, word [eax + edx*8 + 6]
test ecx, ecx
je 0x407761
mov edx, dword [ebp - 0x338]
add edx, 1
mov dword [ebp - 0x338], edx
jmp 0x40764d
mov eax, dword [ebp - 0x338]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret