Function at 0x41d170
Capabilities:
Get socket status

Disassembly:
sub esp, 0x348
mov eax, dword [0x476018]
xor eax, esp
mov dword [esp + 0x344], eax
mov ecx, dword [esp + 0x354]
push ebx
mov ebx, dword [esp + 0x350]
push ebp
push esi
xor esi, esi
push edi
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x10], ecx
mov dword [esp + 0x20], esi
mov dword [esp + 0x24], esi
mov dword [esp + 0x28], esi
mov dword [esp + 0x14], esi
cmp ebx, esi
je 0x41d1cc
mov edx, dword [esp + 0x360]
xor eax, eax
cmp edx, esi
jbe 0x41d1cc
cmp dword [ebx + eax*8], 0xffffffff
jne 0x41d1f3
inc eax
cmp eax, edx
jb 0x41d1c1
cmp ecx, esi
je 0x41d1ec
jge 0x41d1e5
push 0x2726
call dword [sym.imp.WS2_32.dll_WSASetLastError]
or eax, 0xffffffff
jmp 0x41d4f9
push ecx
call dword [sym.imp.KERNEL32.dll_Sleep]
xor eax, eax
jmp 0x41d4f9
cmp ecx, esi
jle 0x41d223
lea eax, [esp + 0x38]
push eax
mov dword [esp + 0x18], ecx
call fcn.004301c0
mov ecx, dword [eax]
mov edx, dword [eax + 4]
mov dword [esp + 0x24], ecx
mov ecx, dword [eax + 8]
mov dword [esp + 0x28], edx
mov edx, dword [eax + 0xc]
add esp, 4
mov dword [esp + 0x28], ecx
mov dword [esp + 0x2c], edx
xor ecx, ecx
xor edi, edi
or eax, 0xffffffff
mov dword [esp + 0x48], ecx
mov dword [esp + 0x14c], esi
mov dword [esp + 0x250], edi
mov dword [esp + 0x18], eax
xor ebp, ebp
xor edx, edx
mov word [ebx + ebp*8 + 6], dx
mov edx, dword [ebx + ebp*8]
cmp edx, 0xffffffff
je 0x41d315
movzx ebx, word [ebx + ebp*8 + 4]
test bl, 7
je 0x41d30d
cmp edx, eax
jbe 0x41d26b
mov dword [esp + 0x18], edx
test bl, 1
je 0x41d297
xor eax, eax
test ecx, ecx
je 0x41d281
cmp dword [esp + eax*4 + 0x4c], edx
je 0x41d281
inc eax
cmp eax, ecx
jb 0x41d276
cmp eax, ecx
jne 0x41d297
cmp ecx, 0x40
jae 0x41d297
mov dword [esp + eax*4 + 0x4c], edx
mov ecx, dword [esp + 0x48]
inc ecx
mov dword [esp + 0x48], ecx
test bl, 4
je 0x41d2cf
xor eax, eax
test esi, esi
je 0x41d2b0
cmp dword [esp + eax*4 + 0x150], edx
je 0x41d2b0
inc eax
cmp eax, esi
jb 0x41d2a2
cmp eax, esi
jne 0x41d2cf
cmp esi, 0x40
jae 0x41d2cf
mov dword [esp + eax*4 + 0x150], edx
mov esi, dword [esp + 0x14c]
inc esi
mov dword [esp + 0x14c], esi
test bl, 2
je 0x41d30d
xor eax, eax
test edi, edi
je 0x41d2ee
lea ebx, [ebx]
cmp dword [esp + eax*4 + 0x254], edx
je 0x41d2ee
inc eax
cmp eax, edi
jb 0x41d2e0
cmp eax, edi
jne 0x41d30d
cmp edi, 0x40
jae 0x41d30d
mov dword [esp + eax*4 + 0x254], edx
mov edi, dword [esp + 0x250]
inc edi
mov dword [esp + 0x250], edi
mov ebx, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
inc ebp
cmp ebp, dword [esp + 0x360]
jb 0x41d242
test ecx, ecx
jne 0x41d34b
test esi, esi
jne 0x41d34b
test edi, edi
jne 0x41d34b
mov eax, dword [esp + 0x10]
test eax, eax
je 0x41d344
js 0x41d1d2
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
xor eax, eax
jmp 0x41d4f9
xor ebx, ebx
cmp dword [esp + 0x10], ebx
lea edx, [esp + 0x30]
setl bl
lea ebp, [eax + 1]
dec ebx
and ebx, edx
jmp 0x41d372
mov edi, dword [esp + 0x250]
mov esi, dword [esp + 0x14c]
mov ecx, dword [esp + 0x48]
mov eax, dword [esp + 0x10]
xor edx, edx
cmp eax, edx
jle 0x41d3a7
mov eax, 0x10624dd3
imul dword [esp + 0x14]
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
mov edx, dword [esp + 0x14]
mov dword [esp + 0x30], eax
imul eax, eax, 0x3e8
sub edx, eax
imul edx, edx, 0x3e8
jmp 0x41d3ad
jne 0x41d3b1
mov dword [esp + 0x30], edx
mov dword [esp + 0x34], edx
neg edi
sbb edi, edi
lea eax, [esp + 0x250]
and edi, eax
neg esi
sbb esi, esi
push ebx
lea edx, [esp + 0x150]
and esi, edx
neg ecx
push edi
sbb ecx, ecx
lea eax, [esp + 0x50]
push esi
and ecx, eax
push ecx
push ebp
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
jne 0x41d47a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x41d40b
cmp dword [0x47a798], 0
jne 0x41d1dd
cmp eax, 0x2714
jne 0x41d1dd
cmp dword [esp + 0x10], 0
jle 0x41d360
lea ecx, [esp + 0x38]
push ecx
call fcn.004301c0
mov edx, dword [esp + 0x24]
sub esp, 0xc
mov ecx, esp
mov dword [ecx], edx
mov edx, dword [esp + 0x34]
mov dword [ecx + 4], edx
mov edx, dword [esp + 0x38]
mov dword [ecx + 8], edx
mov edx, dword [esp + 0x3c]
mov dword [ecx + 0xc], edx
mov edx, dword [eax]
sub esp, 0x10
mov ecx, esp
mov dword [ecx], edx
mov edx, dword [eax + 4]
mov dword [ecx + 4], edx
mov edx, dword [eax + 8]
mov eax, dword [eax + 0xc]
mov dword [ecx + 8], edx
mov dword [ecx + 0xc], eax
call fcn.004302a0
mov ecx, dword [esp + 0x30]
sub ecx, eax
add esp, 0x20
mov dword [esp + 0x14], ecx
test ecx, ecx
jle 0x41d1ec
jmp 0x41d360
test eax, eax
js 0x41d1dd
je 0x41d1ec
mov esi, dword [esp + 0x1c]
mov edi, dword [esp + 0x360]
xor ebx, ebx
add esi, 6
mov eax, dword [esi - 6]
xor ecx, ecx
mov word [esi], cx
cmp eax, 0xffffffff
je 0x41d4f1
lea edx, [esp + 0x48]
push edx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x41d4b8
or word [esi], 1
mov ecx, dword [esi - 6]
lea eax, [esp + 0x14c]
push eax
push ecx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x41d4d1
or word [esi], 4
mov eax, dword [esi - 6]
lea edx, [esp + 0x250]
push edx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x41d4ea
or word [esi], 2
cmp word [esi], 0
je 0x41d4f1
inc ebx
add esi, 8
dec edi
jne 0x41d498
mov eax, ebx
mov ecx, dword [esp + 0x354]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004183ef
add esp, 0x348
ret