Function at 0x58f620
Capabilities:
Connect socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x200
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov byte [ebp - 1], 0
mov edi, dword [esi]
mov dword [eax], 0xffffffff
mov eax, dword [ecx + 4]
mov ebx, dword [esi]
mov dword [ebp - 0xb4], eax
mov eax, dword [esi + 0x90]
cmp eax, 2
mov dword [ebp - 0xb0], eax
mov eax, 0x11
mov dword [ebp - 0xc], edi
mov dword [ebp - 8], ebx
je 0x58f66b
mov eax, dword [ecx + 0xc]
mov dword [ebp - 0xac], eax
mov eax, dword [ecx + 0x10]
mov dword [ebp - 0xa8], eax
cmp eax, 0x80
jbe 0x58f690
mov dword [ebp - 0xa8], 0x80
mov eax, 0x80
push eax
push dword [ecx + 0x18]
lea eax, [ebp - 0xa4]
push eax
call fcn.006c1de0
add esp, 0xc
cmp dword [ebx + 0x618], 0
je 0x58f70c
mov eax, dword [ebx + 0x88]
test eax, eax
jne 0x58f6c0
mov eax, dword [ebx + 0x84]
test eax, eax
je 0x58f6c7
mov byte [eax + 0x108], 1
lea eax, [ebp - 0xb4]
push eax
mov eax, dword [ebx + 0x618]
push 0
push dword [ebx + 0x61c]
call eax
mov ebx, eax
add esp, 0xc
mov eax, dword [ebp - 8]
mov ecx, dword [eax + 0x88]
test ecx, ecx
je 0x58f6f9
mov byte [ecx + 0x108], 0
jmp 0x58f726
mov eax, dword [eax + 0x84]
test eax, eax
je 0x58f726
mov byte [eax + 0x108], 0
jmp 0x58f726
push dword [ebp - 0xac]
push dword [ebp - 0xb0]
push dword [ebp - 0xb4]
call dword [sym.imp.WS2_32.dll_socket]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x58fca1
mov ecx, dword [esi + 0x8c]
test ecx, ecx
je 0x58f74f
mov eax, dword [ebp - 0x8c]
cmp dword [ebp - 0xb4], 0x17
cmove eax, ecx
mov dword [ebp - 0x8c], eax
xor eax, eax
mov dword [ebp - 0x10], eax
lea eax, [ebp + 0xc]
push eax
lea eax, [ebp - 0xe4]
push eax
lea eax, [ebp - 0xa4]
push eax
call fcn.00584ad0
add esp, 0xc
test al, al
jne 0x58f7b7
call fcn.006cc762
mov esi, dword [eax]
call fcn.006cc762
mov edi, eax
lea eax, [ebp - 0x200]
push 0x80
push eax
push esi
call fcn.0057ae20
push eax
push dword [edi]
push str.sa_addr_inet_ntop___failed_with_errno__d:__s
push dword [ebp - 0xc]
call fcn.0056f390
push ebx
push dword [ebp + 8]
call fcn.0056be70
add esp, 0x24
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0xe4]
push eax
push str.__Trying__s..._n
push edi
call fcn.005738f0
mov eax, dword [ebp - 0xb4]
add esp, 0xc
cmp eax, 2
je 0x58f7dc
cmp eax, 0x17
jne 0x58f849
cmp dword [ebp - 0xb0], 1
jne 0x58f849
test byte [edi + 0xa90], 8
mov byte [ebp + 0xf], 1
je 0x58f84d
mov esi, dword [esi]
lea eax, [ebp - 8]
push 4
push eax
push 1
push 6
push ebx
mov dword [ebp - 8], 1
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x58f839
push 0x80
lea eax, [ebp - 0x164]
push eax
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.0057ae20
push eax
push str.Could_not_set_TCP_NODELAY:__s_n
push esi
call fcn.005738f0
add esp, 0x18
jmp 0x58f84d
push str.TCP_NODELAY_set_n
push esi
call fcn.005738f0
add esp, 8
jmp 0x58f84d
mov byte [ebp + 0xf], 0
mov eax, dword [0x9f834c]
mov dword [ebp - 8], 0x4020
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x14], 4
test eax, eax
jne 0x58f954
push 0x9c
push eax
lea eax, [ebp - 0x180]
push eax
call fcn.006c2360
mov esi, dword [sym.imp.KERNEL32.dll_VerSetConditionMask]
add esp, 0xc
mov dword [ebp - 0x180], 0x9c
mov dword [ebp - 0x17c], 6
mov dword [ebp - 0x178], 0
push 3
push 2
push 0
push 0
mov dword [ebp - 0x170], 2
call esi
push 3
push 1
push edx
push eax
call esi
push 3
push 0x20
push edx
push eax
call esi
push 3
push 0x10
push edx
push eax
call esi
push 1
push 8
push edx
push eax
call esi
push edx
push eax
push 0x33
lea eax, [ebp - 0x180]
push eax
call dword [sym.imp.KERNEL32.dll_VerifyVersionInfoA]
test eax, eax
je 0x58f948
mov dword [0x9f834c], 2
mov esi, dword [sym.imp.WS2_32.dll_setsockopt]
cmp byte [ebp + 0xf], 0
je 0x58fa03
mov eax, dword [edi + 0xa90]
shr eax, 0xc
and eax, 1
je 0x58fa03
push 4
mov dword [ebp + 0xc], eax
lea eax, [ebp + 0xc]
push eax
push 8
push 0xffff
push ebx
call esi
test eax, eax
jns 0x58f9a0
push ebx
push str.Failed_to_set_SO_KEEPALIVE_on_fd__d_n
push edi
call fcn.005738f0
add esp, 0xc
jmp 0x58fa03
mov dword [0x9f834c], 1
jmp 0x58f959
cmp eax, 2
je 0x58f8fb
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0xc]
push eax
push 0x1001
push 0xffff
push ebx
call dword [sym.imp.WS2_32.dll_getsockopt]
test eax, eax
jne 0x58f982
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 8]
jg 0x58f8fb
mov esi, dword [sym.imp.WS2_32.dll_setsockopt]
lea eax, [ebp - 8]
push 4
push eax
push 0x1001
push 0xffff
push ebx
call esi
jmp 0x58f901
mov eax, dword [edi + 0xa50]
and eax, 0x7fffffff
mov dword [ebp - 0x20], 1
imul eax, eax, 0x3e8
push 0
push 0
mov dword [ebp - 0x1c], eax
imul eax, dword [edi + 0xa54], 0x3e8
mov dword [ebp + 0xc], eax
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x14]
push eax
push 0
push 0
push 0xc
lea eax, [ebp - 0x20]
push eax
push 0x98000004
push ebx
call dword [sym.imp.WS2_32.dll_WSAIoctl]
test eax, eax
je 0x58fa03
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push ebx
push str.Failed_to_set_SIO_KEEPALIVE_VALS_on_fd__d:__d_n
push edi
call fcn.005738f0
add esp, 0x10
cmp dword [edi + 0x610], 0
je 0x58fa61
mov eax, dword [edi + 0x88]
test eax, eax
jne 0x58fa20
mov eax, dword [edi + 0x84]
test eax, eax
je 0x58fa27
mov byte [eax + 0x108], 1
mov eax, dword [edi + 0x610]
push 0
push ebx
push dword [edi + 0x614]
call eax
mov ecx, eax
add esp, 0xc
mov eax, dword [edi + 0x88]
test eax, eax
jne 0x58fa51
mov eax, dword [edi + 0x84]
test eax, eax
je 0x58fa58
mov byte [eax + 0x108], 0
cmp ecx, 2
jne 0x58fa9b
mov byte [ebp - 1], 1
mov eax, dword [ebp - 0xb4]
cmp eax, 2
je 0x58fa75
cmp eax, 0x17
jne 0x58fb8a
cmp word [ebp - 0xa4], 0x17
jne 0x58fb4e
mov cl, byte [ebp - 0x9c]
mov al, cl
and al, 0xfe
cmp al, 0xfc
jne 0x58fab7
mov eax, 3
jmp 0x58fb50
test ecx, ecx
je 0x58fa61
push ebx
push dword [ebp + 8]
call fcn.0056be70
add esp, 8
mov eax, 0x2a
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 0x9b]
movzx ecx, cl
shl ecx, 8
movzx eax, dl
or ecx, eax
and ecx, 0xffc0
sub ecx, 0
je 0x58faec
sub ecx, 0xfe80
je 0x58fae5
sub ecx, 0x40
jne 0x58fb4e
lea eax, [ecx + 2]
jmp 0x58fb50
mov eax, 1
jmp 0x58fb50
mov al, byte [ebp - 0x9a]
or al, byte [ebp - 0x99]
or al, byte [ebp - 0x98]
or al, byte [ebp - 0x97]
or al, byte [ebp - 0x96]
or al, byte [ebp - 0x95]
or al, byte [ebp - 0x94]
or al, byte [ebp - 0x93]
or al, byte [ebp - 0x92]
or al, byte [ebp - 0x91]
or al, byte [ebp - 0x90]
or al, byte [ebp - 0x8f]
or al, byte [ebp - 0x8e]
or al, dl
jne 0x58fb4e
cmp byte [ebp - 0x8d], 1
jne 0x58fb4e
mov eax, 4
jmp 0x58fb50
xor eax, eax
mov esi, dword [ebp + 8]
push eax
push dword [ebp - 0xb4]
push ebx
push esi
call fcn.0057c270
add esp, 0x10
mov dword [ebp - 0x10], eax
test eax, eax
je 0x58fb8d
push ebx
push esi
call fcn.0056be70
mov eax, dword [ebp - 0x10]
add esp, 8
cmp eax, 1
mov ecx, 7
cmove eax, ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp + 8]
lea eax, [ebp + 8]
mov dword [ebp + 8], 1
push eax
push 0x8004667e
push ebx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
lea eax, [ebp - 0x24]
push eax
call fcn.00575cf0
add esp, 4
cmp dword [esi + 0x298], 1
movups xmm0, xmmword [eax]
movups xmmword [esi + 0x288], xmm0
jle 0x58fbda
push 3
push dword [esi + 0x2a4]
push dword [esi + 0x2a0]
push edi
call fcn.0056f010
add esp, 0x10
cmp byte [ebp - 1], 0
jne 0x58fc9c
cmp dword [esi + 0x90], 1
jne 0x58fc9c
test dword [esi + 0x284], 0x8000000
jne 0x58fc2d
push dword [ebp - 0xa8]
lea eax, [ebp - 0xa4]
push eax
push ebx
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x58fc2d
mov eax, dword [ebp - 0x10]
test eax, eax
jne 0x58fca3
mov ecx, dword [ebp + 0x10]
pop edi
pop esi
mov dword [ecx], ebx
pop ebx
mov esp, ebp
pop ebp
ret
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, eax
mov dword [ebp + 8], eax
sub ecx, 0xb
je 0x58fc8e
sub ecx, 0x2728
je 0x58fc8e
sub ecx, 1
je 0x58fc8e
push 0x80
lea ecx, [ebp - 0x200]
push ecx
push eax
call fcn.0057ae20
push eax
lea eax, [ebp - 0xe4]
push eax
push str.Immediate_connect_fail_for__s:__s_n
push edi
call fcn.005738f0
mov eax, dword [ebp + 8]
push ebx
push esi
mov dword [edi + 0xcac], eax
call fcn.0056be70
add esp, 0x24
mov eax, 7
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 0x10]
xor eax, eax
pop edi
pop esi
mov dword [ecx], ebx
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0x10]
mov dword [eax], ebx
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret