Function at 0x5135a0
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x748234
mov eax, dword fs:[0]
push eax
sub esp, 0x880
mov eax, dword [0x899944]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, dword [ebp + 0x14]
mov esi, dword [ebp + 0x18]
mov dword [ebp - 0x86c], ecx
mov ecx, ebx
mov dword [ebp - 0x874], ebx
call fcn.004a71c0
cmp byte [ebp + 0xc], 0
je 0x5135f7
mov edi, 1
mov dword [ebp + 8], edi
jmp 0x513607
cmp dword [ebp + 8], 0
jne 0x513604
mov dword [ebp + 8], 0x1499700
mov edi, dword [ebp + 8]
mov eax, dword [ebx + 4]
test eax, eax
je 0x51362f
cmp dword [eax + 0x88], 0
jne 0x51362f
mov ecx, ebx
call fcn.004a71e0
test al, al
je 0x51362f
mov eax, dword [ebx + 4]
mov dword [eax + 0x88], 0x42
mov ecx, dword [ebp - 0x86c]
cmp dword [ecx + 0xb4], 0xffffffff
jne 0x513655
mov edx, dword [esi]
mov eax, dword [edx + 0x14]
push str.invalid_socket__not_ready_for_writing.
mov ecx, esi
call eax
mov byte [ebx + 0x12], 1
jmp 0x513c6e
mov eax, dword [ebx + 4]
mov ecx, 0x32
mov dword [ebp - 0x870], ecx
test eax, eax
je 0x513681
mov eax, dword [eax + 0x88]
mov dword [ebp - 0x870], eax
cmp eax, ecx
jae 0x51367f
mov dword [ebp - 0x870], ecx
jmp 0x513681
mov ecx, eax
mov dword [ebp - 0x880], 0
test edi, edi
je 0x513b29
xor eax, eax
xor edx, edx
mov dword [ebp - 0x868], eax
cmp byte [ebp + 0xc], al
jne 0x51370a
mov eax, edi
sub eax, dword [ebp - 0x880]
mov dword [ebp - 0x868], ecx
cmp edi, eax
jbe 0x5136ba
mov dword [ebp - 0x868], eax
test ecx, ecx
je 0x5136cc
cmp dword [ebp - 0x868], ecx
jbe 0x5136cc
mov dword [ebp - 0x868], ecx
cmp dword [ebp - 0x868], edi
jbe 0x5136e8
mov dword [ebp - 0x868], edi
test edi, edi
jne 0x5136e8
mov dword [ebp - 0x868], 1
mov ecx, dword [ebp - 0x868]
mov eax, 0x10624dd3
mul ecx
shr edx, 6
mov edi, edx
imul edi, edi, 0x3e8
mov eax, ecx
sub eax, edi
imul eax, eax, 0x3e8
lea ecx, [ebp - 0x864]
mov dword [ebp - 0x888], edx
mov dword [ebp - 0x884], eax
call fcn.0046e410
mov edi, 0x3004bc8d
mov dword [ebp - method.ckFdSet.virtual_0], vtable.ckFdSet.0
mov dword [ebp - 0x85c], edi
mov dword [ebp - 0x14], edi
xor ebx, ebx
push 0x40
lea ecx, [ebp - 0x54]
push ebx
push ecx
mov dword [ebp - 4], ebx
mov dword [ebp - 0x858], ebx
call fcn.0070dc20
add esp, 0xc
cmp dword [ebp - 0x85c], edi
je 0x513764
push ebx
call fcn.0040a460
add esp, 4
cmp dword [ebp - 0x14], edi
je 0x513772
push ebx
call fcn.0040a460
add esp, 4
mov edx, dword [ebp - 0x86c]
mov edx, dword [edx + 0xb4]
cmp edx, ebx
jl 0x513ad7
mov ecx, dword [ebp - 0x858]
xor eax, eax
cmp ecx, ebx
jbe 0x5137a0
cmp dword [ebp + eax*4 - 0x854], edx
je 0x5137a0
inc eax
cmp eax, ecx
jb 0x513792
cmp eax, ecx
jne 0x5137b9
cmp ecx, 0x200
jae 0x5137b9
mov dword [ebp + eax*4 - 0x854], edx
inc dword [ebp - 0x858]
lea ecx, [ebp - 0x87c]
call fcn.0046e460
cmp byte [ebp + 0x10], 0
mov byte [ebp - 4], 1
je 0x5138a6
push 0x854
call fcn.005c46fb
mov edi, eax
add esp, 4
mov dword [ebp - 0x88c], edi
mov byte [ebp - 4], 2
test edi, edi
je 0x51380e
mov ecx, edi
call fcn.0046e410
mov eax, 0x3004bc8d
mov dword [edi], vtable.ckFdSet.0
mov dword [edi + 8], eax
mov dword [edi + 0x850], eax
mov ebx, edi
jmp 0x513810
xor ebx, ebx
push 0x40
lea eax, [ebx + 0x810]
push 0
push eax
mov byte [ebp - 4], 1
mov dword [ebx + 0xc], 0
call fcn.0070dc20
add esp, 0xc
cmp dword [ebx + 8], 0x3004bc8d
je 0x513841
push 0
call fcn.0040a460
add esp, 4
cmp dword [ebx + 0x850], 0x3004bc8d
je 0x513857
push 0
call fcn.0040a460
add esp, 4
mov ecx, dword [ebp - 0x86c]
mov edx, dword [ecx + 0xb4]
mov dword [ebp - 0x878], ebx
test edx, edx
js 0x513ac8
xor eax, eax
cmp dword [ebx + 0xc], eax
jbe 0x51388d
lea ecx, [ebx + 0x10]
jmp 0x513880
cmp dword [ecx], edx
je 0x51388d
inc eax
add ecx, 4
cmp eax, dword [ebx + 0xc]
jb 0x513880
mov ecx, dword [ebx + 0xc]
cmp eax, ecx
jne 0x5138a3
cmp ecx, 0x200
jae 0x5138a3
mov dword [ebx + eax*4 + 0x10], edx
inc dword [ebx + 0xc]
add ebx, 0xc
lea edx, [ebp - 0x888]
push edx
push ebx
lea eax, [ebp - 0x858]
push eax
push 0
push 0
call dword [sym.imp.WS2_32.dll_select]
mov edi, eax
cmp edi, 0xffffffff
je 0x513b70
test edi, edi
js 0x513b70
jg 0x513962
cmp byte [ebp + 0xc], 0
jne 0x513af0
mov edi, dword [ebp - 0x880]
add edi, dword [ebp - 0x868]
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x880], edi
test ebx, ebx
je 0x513903
cmp edi, ebx
jae 0x513aff
mov ecx, dword [ebp - 0x874]
push esi
call fcn.004a71f0
test al, al
jne 0x513b53
lea ecx, [ebp - 0x87c]
mov byte [ebp - 4], al
call fcn.0046e470
xor eax, eax
lea ecx, [ebp - 0x864]
mov dword [ebp - 4], 0xffffffff
mov dword [ebp - method.ckFdSet.virtual_0], vtable.ckFdSet.0
mov dword [ebp - 0x85c], eax
mov dword [ebp - 0x14], eax
call fcn.0046e300
cmp edi, ebx
mov edi, dword [ebp + 8]
jae 0x513b23
mov ecx, dword [ebp - 0x870]
jmp 0x513693
mov edx, dword [ebp - 0x86c]
mov eax, dword [edx + 0xb4]
lea ecx, [ebp - 0x858]
push ecx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x513ac8
test ebx, ebx
je 0x513a54
mov ecx, dword [ebp - 0x86c]
mov edx, dword [ecx + 0xb4]
push ebx
push edx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x513a54
mov eax, dword [esi]
mov edx, dword [eax + 0x18]
push str.Connection_attempt_failed.
mov ecx, esi
call edx
mov edi, dword [ebp + 8]
push edi
push str.maxWaitTimeMs
mov ecx, esi
call fcn.00474a80
mov ebx, dword [ebp - 0x880]
cmp edi, ebx
jbe 0x513a21
lea eax, [ebx - 0x4e20]
cmp eax, 0x7d0
ja 0x513a21
mov edx, dword [esi]
mov eax, dword [edx + 0x18]
push str.The_Windows_TCP_IP_stack_has_a_system_wide_retry_delay_and_retry_count_for_the_initial_connection.
mov ecx, esi
call eax
mov edx, dword [esi]
mov eax, dword [edx + 0x18]
push str.The_default_settings_result_in_an_overall_21_second_timeout.
mov ecx, esi
call eax
mov edx, dword [esi]
mov eax, dword [edx + 0x18]
push str.If_you_see_this_error_message_21_seconds_after_the_connection_attempt_is_initiated__it_usually_means_one_of_two_things:
mov ecx, esi
call eax
mov edx, dword [esi]
mov eax, dword [edx + 0x18]
push str._1__The_server_is_not_there__not_listening_for_connection_attempts_on_the_specified_IP_address_and_port_.
mov ecx, esi
call eax
mov edx, dword [esi]
mov eax, dword [edx + 0x18]
push str._2__A_firewall_is_blocking_your_connection_attempt_from_reaching_the_server.
mov ecx, esi
call eax
push ebx
push str.totalMsWaitedSoFar
mov ecx, esi
call fcn.00474a80
lea ecx, [ebp - 0x87c]
mov byte [ebp - 4], 0
call fcn.0046e470
lea ecx, [ebp - 0x864]
mov dword [ebp - 4], 0xffffffff
call fcn.00512180
jmp 0x513c6e
push 0
push str.nfds
mov ecx, esi
call fcn.00474a80
push edi
push str.nStatus
mov ecx, esi
call fcn.00474a80
mov ecx, dword [ebp - 0x86c]
mov edx, dword [ecx + 0xb4]
push edx
push str.socketNum
mov ecx, esi
call fcn.00474a80
mov eax, dword [ebp + 8]
push eax
push str.timeoutMs
mov ecx, esi
call fcn.00474a80
movzx ecx, byte [ebp + 0xc]
push ecx
push str.bPoll
mov ecx, esi
call fcn.00474a80
movzx edx, byte [ebp + 0x10]
push edx
push str.bForConnect
mov ecx, esi
call fcn.00474a80
mov eax, dword [esi]
mov edx, dword [eax + 0x18]
push str.Socket_select_for_writeability_returned_unexpected_result_
mov ecx, esi
call edx
lea ecx, [ebp - 0x87c]
mov byte [ebp - 4], 0
call fcn.0046e470
lea ecx, [ebp - 0x864]
mov dword [ebp - 4], 0xffffffff
call fcn.00512180
mov al, 1
jmp 0x513c70
mov eax, dword [ebp - 0x874]
mov byte [eax + 0x10], 1
jmp 0x513a2e
lea ecx, [ebp - 0x87c]
mov byte [ebp - 4], 0
call fcn.0046e470
lea ecx, [ebp - 0x864]
mov dword [ebp - 4], 0xffffffff
call fcn.00512180
mov edi, dword [ebp + 8]
mov ebx, dword [ebp - 0x874]
cmp byte [ebp + 0x10], 0
je 0x513c17
mov eax, dword [esi]
mov edx, dword [eax + 0x14]
push str.timeout_waiting_for_connect_to_complete_
mov ecx, esi
call edx
push edi
push str.timeoutMs
mov ecx, esi
call fcn.00474a80
jmp 0x513c6a
mov ecx, dword [ebp - 0x874]
mov byte [ecx + 0x11], 1
mov edx, dword [esi]
mov eax, dword [edx + 0x14]
push str.socket_write_aborted_by_application..
mov ecx, esi
call eax
jmp 0x513a2e
mov ecx, esi
call fcn.00474d10
xor edi, edi
push edi
push str.nfds
mov ecx, esi
call fcn.00474a80
mov ecx, dword [ebp - 0x86c]
mov edx, dword [ecx + 0xb4]
push edx
push str.socketNum
mov ecx, esi
call fcn.00474a80
mov eax, dword [ebp + 8]
push eax
push str.timeoutMs
mov ecx, esi
call fcn.00474a80
movzx ecx, byte [ebp + 0xc]
push ecx
push str.bPoll
mov ecx, esi
call fcn.00474a80
movzx edx, byte [ebp + 0x10]
push edx
push str.bForConnect
mov ecx, esi
call fcn.00474a80
mov eax, dword [esi]
mov edx, dword [eax + 0x14]
push str.Socket_select_for_writeable_returned_an_error_
mov ecx, esi
call edx
lea ecx, [ebp - 0x87c]
mov byte [ebp - 4], 0
call fcn.0046e470
lea ecx, [ebp - 0x864]
mov dword [ebp - 4], 0xffffffff
mov dword [ebp - method.ckFdSet.virtual_0], vtable.ckFdSet.0
mov dword [ebp - 0x85c], edi
mov dword [ebp - 0x14], edi
call fcn.0046e300
mov al, 1
jmp 0x513c70
mov eax, dword [ebp - 0x86c]
mov ecx, dword [eax + 0xb4]
push ecx
push str.socketNum
mov ecx, esi
call fcn.00474a80
push edi
push str.timeoutMs
mov ecx, esi
call fcn.00474a80
movzx edx, byte [ebp + 0xc]
push edx
push str.bPoll
mov ecx, esi
call fcn.00474a80
push 0
push str.bForConnect
mov ecx, esi
call fcn.00474a80
mov eax, dword [esi]
mov edx, dword [eax + 0x14]
push str.socket_is_not_ready_for_writing_
mov ecx, esi
call edx
mov byte [ebx + 0x10], 1
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0070bb4c
mov esp, ebp
pop ebp
ret 0x14