Function at 0x506520
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x32c
mov eax, dword [0x587084]
xor eax, ebp
mov dword [ebp - 4], eax
xor eax, eax
mov dword [ebp - 0x320], 0
push ebx
mov ebx, dword [ebp + 0xc]
mov dword [ebp - 0x314], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x31c], 0
push edi
mov edi, dword [ebp + 0x14]
cmp eax, 0xffffffff
jne 0x506582
cmp ebx, 0xffffffff
jne 0x506582
cmp dword [ebp + 0x10], ebx
jne 0x506582
push edi
call fcn.00506890
add esp, 4
pop edi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00497fef
mov esp, ebp
pop ebp
ret
test edi, edi
jle 0x5065a0
mov dword [ebp - 0x314], edi
call fcn.004feb90
mov dword [ebp - 0x320], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x31c], edx
push esi
xor ecx, ecx
xor esi, esi
or edx, 0xffffffff
mov dword [ebp - 0x108], ecx
mov dword [ebp - 0x20c], esi
cmp eax, 0xffffffff
je 0x5065da
mov esi, 1
mov dword [ebp - 0x208], eax
mov ecx, esi
mov dword [ebp - 0x20c], esi
mov dword [ebp - 0x104], eax
mov edx, eax
mov dword [ebp - 0x108], ecx
cmp ebx, 0xffffffff
je 0x506646
xor eax, eax
test esi, esi
je 0x5065f3
cmp dword [ebp + eax*4 - 0x208], ebx
je 0x5065f3
inc eax
cmp eax, esi
jb 0x5065e5
cmp eax, esi
jne 0x506610
cmp esi, 0x40
jae 0x506610
mov dword [ebp + eax*4 - 0x208], ebx
mov esi, dword [ebp - 0x20c]
inc esi
mov dword [ebp - 0x20c], esi
xor eax, eax
test ecx, ecx
je 0x506624
cmp dword [ebp + eax*4 - 0x104], ebx
je 0x506624
inc eax
cmp eax, ecx
jb 0x506616
cmp eax, ecx
jne 0x506641
cmp ecx, 0x40
jae 0x506641
mov dword [ebp + eax*4 - 0x104], ebx
mov ecx, dword [ebp - 0x108]
inc ecx
mov dword [ebp - 0x108], ecx
cmp ebx, edx
cmova edx, ebx
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x310], 0
cmp eax, 0xffffffff
je 0x5066a2
mov dword [ebp - 0x30c], eax
xor eax, eax
mov dword [ebp - 0x310], 1
test ecx, ecx
je 0x506682
mov ebx, dword [ebp + 0x10]
cmp dword [ebp + eax*4 - 0x104], ebx
je 0x50667f
inc eax
cmp eax, ecx
jb 0x506671
mov ebx, dword [ebp + 0xc]
cmp eax, ecx
jne 0x50669b
cmp ecx, 0x40
jae 0x50669b
mov ecx, dword [ebp + 0x10]
mov dword [ebp + eax*4 - 0x104], ecx
inc dword [ebp - 0x108]
cmp dword [ebp + 0x10], edx
cmova edx, dword [ebp + 0x10]
xor ecx, ecx
lea eax, [ebp - 0x328]
test edi, edi
cmovs eax, ecx
lea ecx, [edx + 1]
mov dword [ebp - 0x318], eax
mov dword [ebp - 0x32c], ecx
mov ecx, dword [ebp - 0x314]
test edi, edi
jle 0x5066fb
mov eax, 0x10624dd3
imul ecx
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [ebp - 0x328], eax
imul eax, eax, 0x3e8
sub ecx, eax
imul eax, ecx, 0x3e8
mov dword [ebp - 0x324], eax
mov eax, dword [ebp - 0x318]
jmp 0x506711
jne 0x506711
mov dword [ebp - 0x328], 0
mov dword [ebp - 0x324], 0
push eax
xor ecx, ecx
lea eax, [ebp - 0x108]
cmp dword [ebp - 0x310], ecx
push eax
lea eax, [ebp - 0x310]
cmove eax, ecx
test esi, esi
push eax
lea eax, [ebp - 0x20c]
cmove eax, ecx
push eax
push dword [ebp - 0x32c]
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
jne 0x5067b1
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x506762
cmp dword [0x59e368], 0
jne 0x5067b5
cmp eax, 0x2714
jne 0x5067b5
test edi, edi
jg 0x506777
mov esi, dword [ebp - 0x20c]
mov eax, dword [ebp - 0x318]
jmp 0x5066be
push dword [ebp - 0x31c]
push dword [ebp - 0x320]
call fcn.004feb90
push edx
push eax
call fcn.004feb00
mov ecx, edi
add esp, 0x10
sub ecx, eax
mov dword [ebp - 0x314], ecx
test ecx, ecx
jle 0x5067cb
mov esi, dword [ebp - 0x20c]
mov eax, dword [ebp - 0x318]
jmp 0x5066c4
test eax, eax
jns 0x5067c9
pop esi
pop edi
or eax, 0xffffffff
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00497fef
mov esp, ebp
pop ebp
ret
jne 0x5067de
pop esi
pop edi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00497fef
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp + 8]
xor esi, esi
cmp edi, 0xffffffff
je 0x506813
lea eax, [ebp - 0x20c]
push eax
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
mov ecx, 1
lea eax, [ebp - 0x108]
push eax
push edi
cmovne esi, ecx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x506813
or esi, 4
cmp ebx, 0xffffffff
je 0x506840
lea eax, [ebp - 0x20c]
push eax
push ebx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x50682c
or esi, 8
lea eax, [ebp - 0x108]
push eax
push ebx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x506840
or esi, 4
mov ebx, dword [ebp + 0x10]
cmp ebx, 0xffffffff
je 0x506870
lea eax, [ebp - 0x310]
push eax
push ebx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x50685c
or esi, 2
lea eax, [ebp - 0x108]
push eax
push ebx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x506870
or esi, 4
mov ecx, dword [ebp - 4]
mov eax, esi
pop esi
pop edi
xor ecx, ebp
pop ebx
call fcn.00497fef
mov esp, ebp
pop ebp
ret