Function at 0x58ea10
Capabilities:
Get socket status

Disassembly:
push 0xffffffffffffffff
push 0x651824
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x874
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x8a0]
mov ebp, ecx
mov ecx, edi
mov dword [esp + 0x14], ebp
call fcn.00514cb0
mov al, byte [esp + 0x898]
test al, al
je 0x58ea55
mov ebx, 1
jmp 0x58ea65
mov ebx, dword [esp + 0x894]
test ebx, ebx
jne 0x58ea65
mov ebx, 0x1499700
mov eax, dword [edi + 4]
xor esi, esi
cmp eax, esi
je 0x58ea8e
cmp dword [eax + 0x88], esi
jne 0x58ea8e
mov ecx, edi
call fcn.00514ce0
test al, al
je 0x58ea8e
mov eax, dword [edi + 4]
mov dword [eax + 0x88], 0x42
mov ecx, dword [ebp + 0x294]
cmp ecx, 0xffffffff
jne 0x58eab3
mov ecx, dword [esp + 0x8a4]
push str.invalid_socket__not_ready_for_writing.
mov edx, dword [ecx]
call dword [edx + 0x14]
mov byte [edi + 0x16], 1
jmp 0x58efdd
mov eax, dword [edi + 4]
mov edx, 0x32
cmp eax, esi
mov dword [esp + 0x24], edx
je 0x58ead5
mov eax, dword [eax + 0x88]
cmp eax, edx
mov dword [esp + 0x24], eax
jae 0x58ead5
mov dword [esp + 0x24], edx
push ecx
call fcn.004f04f0
add esp, 4
test al, al
je 0x58eb2e
mov eax, dword [edi + 4]
mov edx, dword [esp + 0x8a4]
lea ecx, [esp + 0x10]
push eax
mov eax, dword [esp + 0x8a0]
push ecx
mov ecx, dword [esp + 0x2c]
push edx
mov edx, dword [ebp + 0x294]
push eax
push esi
push ebx
push ecx
push edx
mov dword [esp + 0x30], esi
call fcn.005df580
add esp, 0x20
test al, al
je 0x58efdd
cmp dword [esp + 0x10], esi
jle 0x58efdd
mov al, 1
jmp 0x58efdf
mov dword [esp + 0x20], esi
cmp ebx, esi
mov esi, dword [esp + 0x8a4]
jbe 0x58ed07
mov cl, byte [esp + 0x898]
xor edx, edx
xor eax, eax
xor edi, edi
test cl, cl
jne 0x58eba7
mov ebp, dword [esp + 0x20]
mov ecx, dword [esp + 0x24]
mov eax, ebx
mov edi, ecx
sub eax, ebp
cmp ebx, eax
jbe 0x58eb66
mov edi, eax
test ecx, ecx
je 0x58eb70
cmp edi, ecx
jbe 0x58eb70
mov edi, ecx
cmp edi, ebx
jbe 0x58eb7f
test ebx, ebx
mov edi, ebx
jne 0x58eb7f
mov edi, 1
mov eax, 0x10624dd3
mul edi
shr edx, 6
lea eax, [edx + edx*4]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
shl eax, 3
mov ecx, eax
mov eax, edi
sub eax, ecx
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
shl eax, 3
lea ecx, [esp + 0x30]
mov dword [esp + 0x28], edx
mov dword [esp + 0x2c], eax
call fcn.0058b450
xor ebp, ebp
lea ecx, [esp + 0x30]
mov dword [esp + 0x88c], ebp
call fcn.0058b4b0
mov edx, dword [esp + 0x14]
push esi
lea ecx, [esp + 0x34]
mov eax, dword [edx + 0x294]
push eax
call fcn.0058b500
test al, al
je 0x58eea0
lea ecx, [esp + 0x18]
call fcn.004f5bf0
mov al, byte [esp + 0x89c]
mov byte [esp + 0x88c], 1
test al, al
mov dword [esp + 0x10], ebp
je 0x58ec62
push 0x854
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
mov dword [esp + 0x10], eax
cmp eax, ebp
mov byte [esp + 0x88c], 2
je 0x58ec2d
mov ecx, eax
call fcn.0058b450
mov ebp, eax
mov ecx, ebp
mov byte [esp + 0x88c], 1
call fcn.0058b4b0
mov ecx, dword [esp + 0x14]
push esi
mov dword [esp + 0x20], ebp
mov edx, dword [ecx + 0x294]
mov ecx, ebp
push edx
call fcn.0058b500
test al, al
je 0x58ee8f
add ebp, 0xc
mov dword [esp + 0x10], ebp
mov ecx, dword [esp + 0x10]
lea eax, [esp + 0x28]
push eax
lea edx, [esp + 0x40]
push ecx
push edx
push 0
push 0
call dword [sym.imp.WS2_32.dll_select]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x58ef0a
test ebp, ebp
jl 0x58ef0a
jg 0x58ed34
mov al, byte [esp + 0x898]
test al, al
jne 0x58eebb
mov ebp, dword [esp + 0x20]
add ebp, edi
test ebx, ebx
mov dword [esp + 0x20], ebp
je 0x58ecb9
cmp ebp, ebx
jae 0x58eecb
mov edi, dword [esp + 0x8a0]
push esi
mov ecx, edi
call fcn.00514cf0
test al, al
jne 0x58eef5
lea ecx, [esp + 0x18]
mov byte [esp + 0x88c], al
call fcn.004f5c20
lea ecx, [esp + 0x30]
mov dword [esp + 0x88c], 0xffffffff
call fcn.0058b490
cmp ebp, ebx
jb 0x58eb41
mov edi, dword [esp + 0x8a0]
mov ebp, dword [esp + 0x14]
mov al, byte [esp + 0x89c]
test al, al
je 0x58ef86
mov eax, dword [esi]
push str.timeout_waiting_for_connect_to_complete_
mov ecx, esi
call dword [eax + 0x14]
push ebx
push str.timeoutMs
mov ecx, esi
call fcn.004effe0
jmp 0x58efd9
mov edi, dword [esp + 0x14]
lea eax, [esp + 0x3c]
push eax
mov ecx, dword [edi + 0x294]
push ecx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x58ee8f
mov eax, dword [esp + 0x10]
test eax, eax
je 0x58ee16
mov edx, dword [edi + 0x294]
push eax
push edx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x58ee16
mov eax, dword [esi]
push str.Connection_attempt_failed.
mov ecx, esi
call dword [eax + 0x18]
push ebx
push str.maxWaitTimeMs
mov ecx, esi
call fcn.004effe0
mov edi, dword [esp + 0x20]
cmp ebx, edi
jbe 0x58eddf
cmp edi, 0x4e20
jb 0x58eddf
cmp edi, 0x55f0
ja 0x58eddf
mov edx, dword [esi]
push str.The_Windows_TCP_IP_stack_has_a_system_wide_retry_delay_and_retry_count_for_the_initial_connection.
mov ecx, esi
call dword [edx + 0x18]
mov eax, dword [esi]
push str.The_default_settings_result_in_an_overall_21_second_timeout.
mov ecx, esi
call dword [eax + 0x18]
mov edx, dword [esi]
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 dword [edx + 0x18]
mov eax, dword [esi]
push str._1__The_server_is_not_there__not_listening_for_connection_attempts_on_the_specified_IP_address_and_port_.
mov ecx, esi
call dword [eax + 0x18]
mov edx, dword [esi]
push str._2__A_firewall_is_blocking_your_connection_attempt_from_reaching_the_server.
mov ecx, esi
call dword [edx + 0x18]
push edi
push str.totalMsWaitedSoFar
mov ecx, esi
call fcn.004effe0
lea ecx, [esp + 0x18]
mov byte [esp + 0x88c], 0
call fcn.004f5c20
lea ecx, [esp + 0x30]
mov dword [esp + 0x88c], 0xffffffff
call fcn.0058b490
jmp 0x58efdd
push 0
push str.nfds
mov ecx, esi
call fcn.004effe0
push ebp
push str.nStatus
mov ecx, esi
call fcn.004effe0
mov eax, dword [edi + 0x294]
mov ecx, esi
push eax
push str.socketNum
call fcn.004effe0
push ebx
push str.timeoutMs
mov ecx, esi
call fcn.004effe0
mov eax, dword [esp + 0x898]
mov ecx, esi
and eax, 0xff
push eax
push str.bPoll
call fcn.004effe0
mov eax, dword [esp + 0x89c]
mov ecx, esi
and eax, 0xff
push eax
push str.bForConnect
call fcn.004effe0
mov edx, dword [esi]
push str.Socket_select_for_writeability_returned_unexpected_result_
mov ecx, esi
call dword [edx + 0x18]
lea ecx, [esp + 0x18]
mov byte [esp + 0x88c], 0
call fcn.004f5c20
lea ecx, [esp + 0x30]
mov dword [esp + 0x88c], 0xffffffff
call fcn.0058b490
mov al, 1
jmp 0x58efdf
mov eax, dword [esp + 0x8a0]
mov byte [eax + 0x14], 1
jmp 0x58edec
lea ecx, [esp + 0x18]
mov byte [esp + 0x88c], 0
call fcn.004f5c20
lea ecx, [esp + 0x30]
mov dword [esp + 0x88c], 0xffffffff
call fcn.0058b490
jmp 0x58ecfc
mov byte [edi + 0x15], 1
mov edx, dword [esi]
push str.socket_write_aborted_by_application..
mov ecx, esi
call dword [edx + 0x14]
jmp 0x58edec
mov ecx, esi
call fcn.004f01e0
push 0
push str.nfds
mov ecx, esi
call fcn.004effe0
mov eax, dword [esp + 0x14]
mov ecx, dword [eax + 0x294]
push ecx
push str.socketNum
mov ecx, esi
call fcn.004effe0
push ebx
push str.timeoutMs
mov ecx, esi
call fcn.004effe0
mov eax, dword [esp + 0x898]
mov ecx, esi
and eax, 0xff
push eax
push str.bPoll
call fcn.004effe0
mov eax, dword [esp + 0x89c]
mov ecx, esi
and eax, 0xff
push eax
push str.bForConnect
call fcn.004effe0
mov edx, dword [esi]
push str.Socket_select_for_writeable_returned_an_error_
mov ecx, esi
call dword [edx + 0x14]
jmp 0x58ee8f
mov ecx, dword [ebp + 0x294]
push ecx
push str.socketNum
mov ecx, esi
call fcn.004effe0
push ebx
push str.timeoutMs
mov ecx, esi
call fcn.004effe0
mov eax, dword [esp + 0x898]
mov ecx, esi
and eax, 0xff
push eax
push str.bPoll
call fcn.004effe0
push 0
push str.bForConnect
mov ecx, esi
call fcn.004effe0
mov edx, dword [esi]
push str.socket_is_not_ready_for_writing_
mov ecx, esi
call dword [edx + 0x14]
mov byte [edi + 0x14], 1
xor al, al
mov ecx, dword [esp + 0x884]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x880
ret 0x14