Function at 0x502860
Capabilities:
Get socket status

Disassembly:
sub esp, 0x218
push edi
mov edi, ecx
mov eax, dword [edi + 4]
cmp eax, 2
mov dword [esp + 0x10], edi
je 0x5028ae
cmp eax, 3
je 0x5028ae
test eax, eax
jne 0x50288b
or eax, 0xffffffff
pop edi
add esp, 0x218
ret 8
mov edx, dword [esp + 0x224]
mov eax, dword [edi + 8]
push edx
mov edx, dword [esp + 0x224]
lea ecx, [edi + 8]
push edx
call dword [eax + 0x10]
pop edi
add esp, 0x218
ret 8
push ebx
push ebp
lea ebx, [edi + 0x28]
push ebx
call dword [0x5f62b8]
mov ecx, edi
call fcn.005017d0
mov ebp, dword [edi + 0x40]
test ebp, ebp
mov dword [esp + 0x10], 0
jne 0x5028e6
push ebx
call dword [0x5f62b4]
pop ebp
pop ebx
or eax, 0xffffffff
pop edi
add esp, 0x218
ret 8
push esi
lea eax, [ebp + 4]
push eax
call dword [0x5f61ec]
mov esi, dword [esp + 0x230]
test esi, esi
jne 0x502912
push ebx
call dword [0x5f62b4]
pop esi
pop ebp
pop ebx
xor eax, eax
pop edi
add esp, 0x218
ret 8
mov eax, dword [ebp + 0x64]
test eax, eax
mov dword [esp + 0x18], esi
jne 0x50292d
push 0
push 0
mov ecx, ebp
call fcn.005020c0
cmp eax, 1
jne 0x502970
mov eax, dword [ebp + 0x64]
cmp esi, eax
jbe 0x502938
mov dword [esp + 0x18], eax
mov ecx, dword [esp + 0x18]
mov esi, dword [ebp + 0x60]
mov edi, dword [esp + 0x22c]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebp + 0x64]
mov edx, dword [ebp + 0x60]
sub esi, eax
add edx, eax
test eax, eax
mov dword [ebp + 0x64], esi
mov dword [ebp + 0x60], edx
jne 0x502aa4
mov edi, dword [esp + 0x1c]
mov edx, dword [ebp + 0x6c]
test edx, edx
je 0x502992
mov eax, dword [ebp + 0x68]
mov ecx, dword [ebp + 0x58]
cmp eax, ecx
je 0x502992
push edx
push eax
push ecx
call fcn.005f06d0
mov ecx, dword [ebp + 0x58]
add esp, 0xc
mov dword [ebp + 0x68], ecx
mov ecx, dword [ebp + 0x6c]
mov eax, dword [ebp + 0x5c]
mov esi, dword [ebp + 0x58]
mov edx, dword [edi + 8]
sub eax, ecx
add esi, ecx
lea ecx, [edi + 8]
push eax
push esi
call dword [edx + 0x10]
test eax, eax
jge 0x502a6c
call dword [0x5f6254]
cmp eax, 0x2733
mov esi, dword [0x5f62b4]
jne 0x502a5a
push ebx
call esi
lea ecx, [edi + 8]
call fcn.004fee80
cmp eax, 0xffffffff
je 0x502a5a
push 0
push 0
mov dword [esp + 0x2c], eax
lea eax, [esp + 0x12c]
push eax
lea ecx, [esp + 0x2c]
push ecx
push 1
mov dword [esp + 0x138], 0
mov dword [esp + 0x34], 1
call fcn.005f5a70
cmp eax, 0xffffffff
jne 0x502a1e
call dword [0x5f6254]
mov byte [esp + 0x13], 0
jmp 0x502a23
mov byte [esp + 0x13], 1
push ebx
call dword [0x5f62b8]
cmp dword [edi + 4], 2
jne 0x502a48
push ebx
call esi
push 0x64
call dword [0x5f62b0]
push ebx
call dword [0x5f62b8]
cmp dword [edi + 4], 2
je 0x502a30
cmp dword [edi + 4], 3
jne 0x502a5a
mov al, byte [esp + 0x13]
test al, al
jne 0x502970
lea ecx, [edi + 8]
call fcn.004fee90
mov dword [esp + 0x14], 0xffffffff
jmp 0x502ab0
push eax
push esi
mov ecx, ebp
call fcn.005020c0
cmp eax, 2
je 0x502a86
mov esi, dword [esp + 0x230]
jmp 0x502912
mov ecx, ebp
call fcn.00502790
push ebx
call dword [0x5f62b4]
pop esi
pop ebp
pop ebx
or eax, 0xffffffff
pop edi
add esp, 0x218
ret 8
mov esi, dword [0x5f62b4]
jbe 0x502ab0
mov dword [esp + 0x14], eax
lea eax, [ebp + 4]
push eax
call dword [0x5f61e8]
test eax, eax
jne 0x502ace
mov ecx, ebp
call fcn.00501d10
push ebp
call fcn.005ddc00
add esp, 4
push ebx
call esi
mov eax, dword [esp + 0x14]
pop esi
pop ebp
pop ebx
pop edi
add esp, 0x218
ret 8