Function at 0x5176f0
Capabilities:
Get socket status

Disassembly:
sub esp, 0x368
mov eax, dword [0x592830]
xor eax, esp
mov dword [esp + 0x364], eax
push ebx
mov ebx, dword [esp + 0x378]
push ebp
push esi
mov eax, ecx
xor esi, esi
push edi
mov dword [esp + 0x28], eax
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x24], 0
mov dword [esp + 0x14], ebx
test ebx, ebx
jl 0x517755
jg 0x517748
mov edi, dword [esp + 0x380]
cmp edi, 0x7fffffff
jb 0x51775c
xor ebx, ebx
mov edi, closesocket
mov dword [esp + 0x14], ebx
jmp 0x51775c
mov edi, dword [esp + 0x380]
mov ebp, dword [esp + 0x37c]
cmp eax, 0xffffffff
jne 0x517793
cmp ebp, eax
jne 0x517793
test edi, edi
je 0x51778c
jns 0x517785
push 0x2726
call dword [sym.imp.WS2_32.dll_WSASetLastError]
or eax, 0xffffffff
jmp 0x517a68
push edi
call dword [sym.imp.KERNEL32.dll_Sleep]
xor eax, eax
jmp 0x517a68
test ebx, ebx
jl 0x5177d1
jg 0x51779d
test edi, edi
je 0x5177d1
lea eax, [esp + 0x258]
push eax
mov esi, edi
call fcn.0051f970
mov ecx, dword [eax]
mov dword [esp + 0x20], ecx
mov ecx, dword [eax + 4]
mov dword [esp + 0x1c], ecx
mov ecx, dword [eax + 8]
mov eax, dword [eax + 0xc]
mov dword [esp + 0x268], eax
mov eax, dword [esp + 0x2c]
add esp, 4
mov dword [esp + 0x24], ecx
xor ecx, ecx
or edx, 0xffffffff
mov dword [esp + 0x268], ecx
mov dword [esp + 0x48], ecx
cmp eax, 0xffffffff
je 0x517810
mov ecx, 1
mov dword [esp + 0x4c], eax
mov dword [esp + 0x48], 1
mov dword [esp + 0x26c], eax
mov dword [esp + 0x268], ecx
mov edx, eax
jmp 0x517810
mov dword [esp + 0x150], 0
cmp ebp, 0xffffffff
je 0x51786b
xor eax, eax
mov dword [esp + 0x154], ebp
mov dword [esp + 0x150], 1
test ecx, ecx
je 0x51784e
jmp 0x517840
cmp dword [esp + eax*4 + 0x26c], ebp
je 0x51784e
inc eax
cmp eax, ecx
jb 0x517840
cmp eax, ecx
jne 0x517865
cmp ecx, 0x40
jae 0x517865
mov dword [esp + eax*4 + 0x26c], ebp
inc dword [esp + 0x268]
cmp ebp, edx
jbe 0x51786b
mov edx, ebp
test ebx, ebx
jg 0x517879
jl 0x517875
test edi, edi
jae 0x517879
xor ebp, ebp
jmp 0x51787d
lea ebp, [esp + 0x2c]
lea eax, [edx + 1]
mov dword [esp + 0x20], ebp
mov dword [esp + 0x34], eax
test ebx, ebx
jl 0x5178bd
jg 0x517892
test edi, edi
je 0x5178bd
mov eax, 0x10624dd3
imul esi
sar edx, 6
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
mov dword [esp + 0x2c], ecx
imul ecx, ecx, 0x3e8
mov eax, esi
sub eax, ecx
imul eax, eax, 0x3e8
mov dword [esp + 0x30], eax
jmp 0x5178cb
mov eax, edi
or eax, ebx
jne 0x5178cb
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
push ebp
lea eax, [esp + 0x26c]
push eax
mov eax, dword [esp + 0x158]
neg eax
sbb eax, eax
lea ecx, [esp + 0x158]
and eax, ecx
push eax
mov eax, dword [esp + 0x54]
neg eax
sbb eax, eax
lea ecx, [esp + 0x54]
and eax, ecx
push eax
push dword [esp + 0x44]
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
jne 0x5179f4
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x51792d
cmp dword [0x59fa7c], 0
jne 0x51777d
cmp eax, 0x2714
jne 0x51777d
test ebx, ebx
jl 0x5178bd
jg 0x51793b
test edi, edi
je 0x517888
lea eax, [esp + 0x38]
push eax
call fcn.0051f970
mov ecx, dword [eax]
mov ebp, dword [eax + 4]
mov edx, dword [eax + 8]
mov eax, dword [eax + 0xc]
add esp, 4
sub ecx, dword [esp + 0x1c]
mov dword [esp + 0x264], eax
sbb ebp, dword [esp + 0x18]
cmp ebp, 0x20c49b
jl 0x517984
jg 0x517974
cmp ecx, 0xa5e353f7
jb 0x517984
or ebx, 0xffffffff
mov dword [esp + 0x25c], getsockopt
jmp 0x5179db
cmp ebp, 0xffdf3b64
jg 0x5179a8
jl 0x517996
cmp ecx, 0x5a1cac09
ja 0x5179a8
mov ebx, 1
mov dword [esp + 0x25c], getsockopt
jmp 0x5179db
sub edx, dword [esp + 0x24]
mov eax, 0x10624dd3
imul edx
sar edx, 6
mov eax, edx
push 0
shr eax, 0x1f
push 0x3e8
add eax, edx
cdq
push ebp
push ecx
mov ebx, eax
mov esi, edx
call fcn.004f2c00
add ebx, eax
adc esi, edx
mov dword [esp + 0x25c], esi
mov esi, edi
sub esi, ebx
test esi, esi
jle 0x51778c
mov ebx, dword [esp + 0x14]
mov ebp, dword [esp + 0x20]
jmp 0x517888
test eax, eax
js 0x51777d
je 0x51778c
mov ebx, dword [esp + 0x28]
mov edi, dword [sym.imp.WS2_32.dll___WSAFDIsSet]
xor esi, esi
cmp ebx, 0xffffffff
je 0x517a36
lea eax, [esp + 0x48]
push eax
push ebx
call edi
test eax, eax
je 0x517a24
mov esi, 1
lea eax, [esp + 0x268]
push eax
push ebx
call edi
test eax, eax
je 0x517a36
or esi, 4
mov ebp, dword [esp + 0x37c]
cmp ebp, 0xffffffff
je 0x517a66
lea eax, [esp + 0x150]
push eax
push ebp
call edi
test eax, eax
je 0x517a54
or esi, 2
lea eax, [esp + 0x268]
push eax
push ebp
call edi
test eax, eax
je 0x517a66
or esi, 4
mov eax, esi
mov ecx, dword [esp + 0x374]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004ebb9e
add esp, 0x368
ret