Function at 0x416fa0
Capabilities:
Get socket status

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x314
mov ebp, dword [esp + 0x334]
mov edi, dword [esp + 0x330]
mov edx, dword [esp + 0x32c]
mov esi, dword [esp + 0x328]
test esi, esi
sete al
test edx, edx
sete cl
or cl, al
jne 0x416feb
xor eax, eax
nop word cs:[eax + eax]
cmp dword [esi + eax*8], 0xffffffff
jne 0x41701b
inc eax
cmp edx, eax
jne 0x416fe0
xor ebx, ebx
mov eax, edi
or eax, ebp
je 0x417324
test ebp, ebp
js 0x417186
cmp edi, 0xfffffffe
mov eax, 0xfffffffe
cmovae edi, eax
test ebp, ebp
cmovne edi, eax
push edi
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x417324
mov dword [esp + 0x210], 0
mov dword [esp + 0x10c], 0
mov dword [esp + 8], 0
xor esi, esi
xor ebp, ebp
xor edi, edi
xor ecx, ecx
jmp 0x417060
mov edx, dword [esp + 0x32c]
inc ecx
cmp ecx, edx
je 0x417172
mov ebx, dword [esp + 0x328]
mov word [ebx + ecx*8 + 6], 0
mov eax, dword [ebx + ecx*8]
cmp eax, 0xffffffff
je 0x417057
movzx ebx, word [ebx + ecx*8 + 4]
test ebx, 0x710
je 0x417057
test ebx, 0x300
je 0x4170dc
xor edx, edx
test edi, edi
je 0x4170b0
nop word cs:[eax + eax]
cmp dword [esp + edx*4 + 0x214], eax
je 0x4170b0
inc edx
cmp edi, edx
jne 0x4170a0
mov edx, edi
cmp edx, edi
setne dl
cmp edi, 0x40
setae dh
or dh, dl
jne 0x4170d5
mov dword [esp + edi*4 + 0x214], eax
mov edi, dword [esp + 0x210]
inc edi
mov dword [esp + 0x210], edi
mov edx, dword [esp + 0x32c]
test bl, 0x10
je 0x41712c
xor edx, edx
test ebp, ebp
je 0x417100
nop word [eax + eax]
cmp dword [esp + edx*4 + 0x110], eax
je 0x417100
inc edx
cmp ebp, edx
jne 0x4170f0
mov edx, ebp
cmp edx, ebp
setne dl
cmp ebp, 0x40
setae dh
or dh, dl
jne 0x417125
mov dword [esp + ebp*4 + 0x110], eax
mov ebp, dword [esp + 0x10c]
inc ebp
mov dword [esp + 0x10c], ebp
mov edx, dword [esp + 0x32c]
test ebx, 0x600
je 0x417057
xor edx, edx
test esi, esi
je 0x41714d
nop
cmp dword [esp + edx*4 + 0xc], eax
je 0x41714d
inc edx
cmp esi, edx
jne 0x417140
mov edx, esi
cmp edx, esi
setne dl
cmp esi, 0x40
setae dh
or dh, dl
jne 0x417050
mov dword [esp + esi*4 + 0xc], eax
mov esi, dword [esp + 8]
inc esi
mov dword [esp + 8], esi
jmp 0x417050
test edi, edi
je 0x41719b
lea ebx, [esp + 0x210]
mov edi, dword [esp + 0x328]
jmp 0x4171f1
push 0x2726
call dword [sym.imp.WS2_32.dll_WSASetLastError]
mov ebx, 0xffffffff
jmp 0x417324
xor ebx, ebx
mov eax, ebp
or eax, esi
mov edi, dword [esp + 0x328]
jne 0x4171f1
xor ebx, ebx
mov ecx, dword [esp + 0x330]
mov eax, ecx
mov edx, dword [esp + 0x334]
or eax, edx
je 0x41730d
test edx, edx
js 0x417331
cmp ecx, 0xfffffffe
mov eax, 0xfffffffe
cmovae ecx, eax
test edx, edx
cmovne ecx, eax
push ecx
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp ebx, 0xffffffff
jne 0x417324
jmp 0x417312
mov eax, esp
push dword [esp + 0x334]
push dword [esp + 0x334]
push eax
call fcn.0041d7f0
add esp, 0xc
test ebp, ebp
lea ecx, [esp + 0x10c]
cmovne ebp, ecx
test esi, esi
lea ecx, [esp + 8]
cmovne esi, ecx
push eax
push esi
push ebp
push ebx
push 0
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jle 0x41730b
xor ebx, ebx
xor ebp, ebp
mov ecx, dword [esp + 0x32c]
jmp 0x41725c
movzx eax, word [edi + ebp*8 + 6]
cmp ax, 1
sbb ebx, 0xffffffff
mov ecx, dword [esp + 0x32c]
inc ebp
cmp ecx, ebp
je 0x417324
mov word [edi + ebp*8 + 6], 0
mov eax, dword [edi + ebp*8]
cmp eax, 0xffffffff
je 0x417253
lea ecx, [esp + 0x210]
push ecx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x41729a
movzx eax, word [edi + ebp*8 + 4]
test eax, 0x100
je 0x41728e
or byte [edi + ebp*8 + 7], 1
test eax, 0x300
je 0x41729a
or byte [edi + ebp*8 + 7], 3
lea eax, [esp + 0x10c]
push eax
push dword [edi + ebp*8]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x4172ba
test byte [edi + ebp*8 + 4], 0x10
je 0x4172ba
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 0x417240
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 0x417245
movzx edx, dx
or edx, ecx
mov word [edi + ebp*8 + 6], dx
jmp 0x417245
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x417324
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
push 0x2726
call dword [sym.imp.WS2_32.dll_WSASetLastError]
mov ebx, 0xffffffff
cmp ebx, 0xffffffff
jne 0x417324
jmp 0x417312