Function at 0x486160
Capabilities:
Get socket status

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x35c
cmp dword [esp + 0x374], 0x3f
ja 0x48643f
mov edi, dword [esp + 0x374]
mov dword [esp + 0x3c], 0
mov dword [esp + 0x140], 0
mov dword [esp + 0x244], 0
test edi, edi
mov dword [esp + 0x2c], 0
je 0x4863e9
mov ebx, dword [esp + 0x370]
xor edi, edi
xor esi, esi
xor ecx, ecx
mov dword [esp + 0x28], 0xffffffff
mov dword [esp + 0x24], 0
mov ebp, ebx
mov dword [esp + 0x2c], ebx
mov eax, dword [ebp]
test eax, eax
js 0x48629d
movsx ebx, word [ebp + 4]
test bl, 1
je 0x486210
test edi, edi
je 0x486426
xor edx, edx
cmp dword [esp + 0x40], eax
jne 0x4861fc
jmp 0x486210
cmp dword [esp + edx*4 + 0x40], eax
je 0x486210
add edx, 1
cmp edx, edi
jne 0x4861f6
cmp edi, 0x3f
jbe 0x486426
lea esi, [esi]
test bl, 2
je 0x486250
test esi, esi
je 0x486414
xor edx, edx
cmp dword [esp + 0x144], eax
jne 0x486239
jmp 0x486250
cmp eax, dword [esp + edx*4 + 0x144]
je 0x486250
add edx, 1
cmp edx, esi
jne 0x486230
cmp esi, 0x3f
jbe 0x486414
mov eax, dword [ebp]
lea esi, [esi]
and ebx, 4
je 0x486290
test ecx, ecx
je 0x486405
xor edx, edx
cmp dword [esp + 0x248], eax
jne 0x48627d
jmp 0x486290
cmp dword [esp + edx*4 + 0x248], eax
je 0x4863f8
add edx, 1
cmp edx, ecx
jne 0x486270
cmp ecx, 0x3f
jbe 0x486405
lea esi, [esi]
cmp eax, dword [esp + 0x28]
cmovle eax, dword [esp + 0x28]
mov dword [esp + 0x28], eax
add dword [esp + 0x24], 1
add ebp, 8
mov eax, dword [esp + 0x374]
cmp dword [esp + 0x24], eax
jne 0x4861d0
cmp dword [esp + 0x28], 0xffffffff
mov ebx, dword [esp + 0x2c]
mov dword [esp + 0x3c], edi
mov dword [esp + 0x140], esi
mov dword [esp + 0x244], ecx
mov dword [esp + 0x2c], 0
je 0x4863e9
mov esi, dword [esp + 0x378]
test esi, esi
js 0x486432
mov eax, dword [esp + 0x378]
mov edx, 0x10624dd3
imul edx
mov eax, dword [esp + 0x378]
sar edx, 6
sar eax, 0x1f
sub edx, eax
mov eax, dword [esp + 0x378]
mov dword [esp + 0x348], edx
imul edx, edx, 0x3e8
sub eax, edx
imul eax, eax, 0x3e8
mov dword [esp + 0x34c], eax
lea eax, [esp + 0x348]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x28]
lea esi, [esp + 0x244]
lea ebp, [esp + 0x140]
lea edi, [esp + 0x3c]
mov dword [esp + 0xc], esi
add eax, 1
mov dword [esp + 8], ebp
mov dword [esp + 4], edi
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_select]
sub esp, 0x14
mov dword [esp + 0x2c], eax
mov ecx, dword [esp + 0x2c]
test ecx, ecx
js 0x4863e9
xor eax, eax
mov dword [esp + 0x24], ebp
mov ebp, edi
mov edi, esi
mov esi, eax
mov word [ebx + 6], 0
mov dword [esp + 4], ebp
mov eax, dword [ebx]
mov dword [esp], eax
call sub.WS2_32.dll___WSAFDIsSet
sub esp, 8
test eax, eax
je 0x4863a2
or word [ebx + 6], 1
mov eax, dword [esp + 0x24]
mov dword [esp + 4], eax
mov eax, dword [ebx]
mov dword [esp], eax
call sub.WS2_32.dll___WSAFDIsSet
sub esp, 8
test eax, eax
je 0x4863c0
or word [ebx + 6], 2
mov dword [esp + 4], edi
mov eax, dword [ebx]
mov dword [esp], eax
call sub.WS2_32.dll___WSAFDIsSet
sub esp, 8
test eax, eax
je 0x4863da
or word [ebx + 6], 4
add esi, 1
add ebx, 8
cmp esi, dword [esp + 0x374]
jne 0x486382
mov eax, dword [esp + 0x2c]
add esp, 0x35c
pop ebx
pop esi
pop edi
pop ebp
ret
cmp ecx, edx
jne 0x486290
jmp 0x486284
mov dword [esp + ecx*4 + 0x248], eax
add ecx, 1
jmp 0x486290
mov eax, dword [ebp]
mov dword [esp + esi*4 + 0x144], eax
add esi, 1
jmp 0x486250
mov dword [esp + edi*4 + 0x40], eax
add edi, 1
jmp 0x486210
mov dword [esp + 0x10], 0
jmp 0x486339
call dword [sym.imp.msvcrt.dll__errno]
mov dword [esp + 0x2c], 0xffffffff
mov dword [eax], 0x16
jmp 0x4863e9