Function at 0x487690
Capabilities:
Get socket status

Disassembly:
sub esp, 0x328
mov eax, dword [esp + 0x32c]
xor edx, edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], edx
push ebp
mov ebp, dword [esp + 0x338]
push edi
mov edi, dword [esp + 0x338]
cmp eax, 0xffffffff
jne 0x487706
cmp edi, 0xffffffff
jne 0x487706
cmp ebp, edi
jne 0x487706
mov eax, dword [esp + 0x340]
test eax, eax
je 0x4876fb
jns 0x4876f4
push 0x2726
call dword [sym.imp.WSOCK32.DLL_WSASetLastError]
or eax, edi
pop edi
pop ebp
add esp, 0x328
ret
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
pop edi
xor eax, eax
pop ebp
add esp, 0x328
ret
push ebx
mov ebx, dword [esp + 0x344]
test ebx, ebx
jle 0x48772c
mov dword [esp + 0x10], ebx
call fcn.00487ad0
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x338]
mov dword [esp + 0x14], edx
mov edx, ebx
push esi
xor ecx, ecx
mov dword [esp + 0x10], 0xffffffff
xor esi, esi
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x130], esi
cmp eax, 0xffffffff
je 0x48776a
mov esi, 1
mov dword [esp + 0x134], eax
mov ecx, esi
mov dword [esp + 0x130], esi
mov dword [esp + 0x30], eax
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x10], eax
cmp edi, 0xffffffff
je 0x4877d3
xor eax, eax
test esi, esi
je 0x487783
cmp dword [esp + eax*4 + 0x134], edi
je 0x487783
inc eax
cmp eax, esi
jb 0x487775
cmp eax, esi
jne 0x4877a2
cmp esi, 0x40
jae 0x4877a2
mov dword [esp + eax*4 + 0x134], edi
mov esi, dword [esp + 0x130]
inc esi
mov dword [esp + 0x130], esi
xor eax, eax
test ecx, ecx
je 0x4877b3
cmp dword [esp + eax*4 + 0x30], edi
je 0x4877b3
inc eax
cmp eax, ecx
jb 0x4877a8
cmp eax, ecx
jne 0x4877c9
cmp ecx, 0x40
jae 0x4877c9
mov dword [esp + eax*4 + 0x30], edi
mov ecx, dword [esp + 0x2c]
inc ecx
mov dword [esp + 0x2c], ecx
cmp edi, dword [esp + 0x10]
jbe 0x4877d3
mov dword [esp + 0x10], edi
mov dword [esp + 0x234], 0
cmp ebp, 0xffffffff
je 0x487828
xor eax, eax
mov dword [esp + 0x238], ebp
mov dword [esp + 0x234], 1
test ecx, ecx
je 0x48780b
jmp 0x487800
cmp dword [esp + eax*4 + 0x30], ebp
je 0x48780b
inc eax
cmp eax, ecx
jb 0x487800
cmp eax, ecx
jne 0x48781c
cmp ecx, 0x40
jae 0x48781c
mov dword [esp + eax*4 + 0x30], ebp
inc dword [esp + 0x2c]
mov eax, dword [esp + 0x10]
cmp ebp, eax
jbe 0x48782c
mov eax, ebp
jmp 0x48782c
mov eax, dword [esp + 0x10]
xor ecx, ecx
lea edi, [esp + 0x20]
test ebx, ebx
sets cl
dec ecx
and ecx, edi
mov edi, dword [esp + 0x340]
inc eax
mov dword [esp + 0x10], ecx
mov dword [esp + 0x28], eax
lea ebx, [ebx]
test ebx, ebx
jle 0x487885
mov ecx, dword [esp + 0x14]
mov eax, 0x10624dd3
imul edx
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [esp + 0x20], eax
imul eax, eax, 0x3e8
sub ecx, eax
imul eax, ecx, 0x3e8
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x24], eax
jmp 0x487897
jne 0x487897
mov dword [esp + 0x20], 0
mov dword [esp + 0x24], 0
push ecx
lea eax, [esp + 0x30]
push eax
mov eax, dword [esp + 0x23c]
lea ecx, [esp + 0x23c]
neg eax
sbb eax, eax
and eax, ecx
neg esi
push eax
sbb esi, esi
lea eax, [esp + 0x13c]
and esi, eax
push esi
push dword [esp + 0x38]
call dword [sym.imp.WSOCK32.DLL_select]
cmp eax, 0xffffffff
jne 0x487934
call dword [sym.imp.WSOCK32.DLL_WSAGetLastError]
test eax, eax
je 0x4878e9
cmp dword [0x502f80], 0
jne 0x487938
cmp eax, 0x2714
jne 0x487938
test ebx, ebx
jg 0x487901
mov esi, dword [esp + 0x130]
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
jmp 0x487850
push dword [esp + 0x18]
push dword [esp + 0x20]
call fcn.00487ad0
push edx
push eax
call fcn.00487a40
mov edx, ebx
add esp, 0x10
sub edx, eax
mov dword [esp + 0x14], edx
test edx, edx
jle 0x487948
mov esi, dword [esp + 0x130]
mov ecx, dword [esp + 0x10]
jmp 0x487850
test eax, eax
jns 0x487946
pop esi
pop ebx
pop edi
or eax, 0xffffffff
pop ebp
add esp, 0x328
ret
jne 0x487955
pop esi
pop ebx
pop edi
xor eax, eax
pop ebp
add esp, 0x328
ret
mov ebx, dword [esp + 0x33c]
xor esi, esi
cmp ebx, 0xffffffff
je 0x48798c
lea eax, [esp + 0x130]
push eax
push ebx
call sub.WSOCK32.DLL___WSAFDIsSet
test eax, eax
je 0x48797a
mov esi, 1
lea eax, [esp + 0x2c]
push eax
push ebx
call sub.WSOCK32.DLL___WSAFDIsSet
test eax, eax
je 0x48798c
or esi, 4
cmp edi, 0xffffffff
je 0x4879b8
lea eax, [esp + 0x130]
push eax
push edi
call sub.WSOCK32.DLL___WSAFDIsSet
test eax, eax
je 0x4879a6
or esi, 8
lea eax, [esp + 0x2c]
push eax
push edi
call sub.WSOCK32.DLL___WSAFDIsSet
test eax, eax
je 0x4879b8
or esi, 4
cmp ebp, 0xffffffff
je 0x4879e4
lea eax, [esp + 0x234]
push eax
push ebp
call sub.WSOCK32.DLL___WSAFDIsSet
test eax, eax
je 0x4879d2
or esi, 2
lea eax, [esp + 0x2c]
push eax
push ebp
call sub.WSOCK32.DLL___WSAFDIsSet
test eax, eax
je 0x4879e4
or esi, 4
mov eax, esi
pop esi
pop ebx
pop edi
pop ebp
add esp, 0x328
ret