Function at 0x516f13
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x134
mov dword [ebp - 0x134], ecx
mov eax, dword [ebp + 0x18]
and byte [eax], 0
mov eax, dword [ebp + 0x14]
and byte [eax], 0
mov eax, dword [ebp + 0x1c]
and byte [eax], 0
cmp dword [ebp + 8], 0
je 0x516f47
cmp dword [ebp + 8], 0x32
jae 0x516f47
mov dword [ebp + 8], 0x32
cmp dword [ebp + 0xc], 0
jne 0x516f54
mov dword [ebp + 0xc], 0x1499700
mov eax, dword [ebp - 0x134]
cmp dword [eax + 0x4c], 0xffffffff
jne 0x516f7d
push str.Invalid_socket.
mov eax, dword [ebp + 0x20]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x20]
call dword [eax + 0x10]
mov eax, dword [ebp + 0x14]
mov byte [eax], 1
xor al, al
jmp 0x5171cc
and dword [ebp - 8], 0
mov byte [ebp - 1], 1
cmp dword [ebp + 0xc], 0
je 0x516f97
mov eax, dword [ebp - 8]
cmp eax, dword [ebp + 0xc]
jae 0x5171a1
mov eax, dword [ebp + 8]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jne 0x516fa9
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x18], eax
cmp dword [ebp + 0xc], 0
je 0x516fd4
mov eax, dword [ebp + 0xc]
cmp eax, dword [ebp - 8]
jbe 0x516fd4
mov eax, dword [ebp + 0xc]
sub eax, dword [ebp - 8]
mov dword [ebp - 0x18], eax
cmp dword [ebp + 8], 0
je 0x516fd4
mov eax, dword [ebp - 0x18]
cmp eax, dword [ebp + 8]
jbe 0x516fd4
mov eax, dword [ebp + 8]
mov dword [ebp - 0x18], eax
movzx eax, byte [ebp - 1]
test eax, eax
je 0x516ff1
mov eax, dword [ebp - 0x18]
shr eax, 1
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0x32
jae 0x516ff1
mov dword [ebp - 0x18], 0x32
mov eax, dword [ebp - 0x18]
xor edx, edx
mov ecx, 0x3e8
div ecx
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
imul eax, eax, 0x3e8
mov ecx, dword [ebp - 0x18]
sub ecx, eax
mov dword [ebp - 0x10], ecx
mov eax, dword [ebp - 0x10]
imul eax, eax, 0x3e8
mov dword [ebp - 0x124], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x12c], eax
mov eax, dword [ebp - 0x124]
mov dword [ebp - 0x128], eax
and dword [ebp - 0x120], 0
and dword [ebp - 0x130], 0
jmp 0x517052
mov eax, dword [ebp - 0x130]
inc eax
mov dword [ebp - 0x130], eax
mov eax, dword [ebp - 0x130]
cmp eax, dword [ebp - 0x120]
jae 0x51707c
mov eax, dword [ebp - 0x130]
mov ecx, dword [ebp - 0x134]
mov eax, dword [ebp + eax*4 - 0x11c]
cmp eax, dword [ecx + 0x4c]
jne 0x51707a
jmp 0x51707c
jmp 0x517045
mov eax, dword [ebp - 0x130]
cmp eax, dword [ebp - 0x120]
jne 0x5170b6
cmp dword [ebp - 0x120], 0x40
jae 0x5170b6
mov eax, dword [ebp - 0x130]
mov ecx, dword [ebp - 0x134]
mov ecx, dword [ecx + 0x4c]
mov dword [ebp + eax*4 - 0x11c], ecx
mov eax, dword [ebp - 0x120]
inc eax
mov dword [ebp - 0x120], eax
xor eax, eax
test eax, eax
jne 0x51703c
lea eax, [ebp - 0x12c]
push eax
push 0
push 0
lea eax, [ebp - 0x120]
push eax
push 0
call dword [sym.imp.WS2_32.dll_select]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0xffffffff
jne 0x517130
mov eax, dword [ebp + 0x14]
mov byte [eax], 1
push str.Error_waiting_for_socket_to_become_ready_for_reading.
mov eax, dword [ebp + 0x20]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x20]
call dword [eax + 0x10]
push 2
mov eax, dword [ebp - 0x134]
push dword [eax + 0x4c]
call dword [sym.imp.WS2_32.dll_shutdown]
mov eax, dword [ebp - 0x134]
push dword [eax + 0x4c]
call dword [sym.imp.WS2_32.dll_closesocket]
mov eax, dword [ebp - 0x134]
or dword [eax + 0x4c], 0xffffffff
mov eax, dword [ebp - 0x134]
and byte [eax + 0x48], 0
xor al, al
jmp 0x5171cc
cmp dword [ebp - 0xc], 0
je 0x51713d
mov al, 1
jmp 0x5171cc
mov eax, dword [ebp - 8]
add eax, dword [ebp - 0x18]
mov dword [ebp - 8], eax
cmp dword [ebp + 0xc], 0
je 0x517156
mov eax, dword [ebp - 8]
cmp eax, dword [ebp + 0xc]
jb 0x517156
jmp 0x5171a1
cmp dword [ebp + 0x10], 0
je 0x517198
cmp dword [ebp + 8], 0
je 0x517198
push 0x73
push dword [ebp + 8]
mov ecx, dword [ebp + 0x10]
call fcn.004f20f4
mov ecx, dword [ebp + 0x10]
call fcn.004f1f9a
movzx eax, al
test eax, eax
je 0x517198
mov eax, dword [ebp + 0x18]
mov byte [eax], 1
push str.socket_operation_aborted_by_application_callback
mov eax, dword [ebp + 0x20]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x20]
call dword [eax + 0x10]
xor al, al
jmp 0x5171cc
and byte [ebp - 1], 0
jmp 0x516f85
push str.Timeout_waiting_to_read_socket_or_accept_connection
mov eax, dword [ebp + 0x20]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x20]
call dword [eax + 0x10]
push dword [ebp + 0xc]
push str.timeoutMs
mov eax, dword [ebp + 0x20]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x20]
call dword [eax + 0x2c]
mov eax, dword [ebp + 0x1c]
mov byte [eax], 1
xor al, al
leave
ret 0x1c