Function at 0x515380
Capabilities:
Connect socket

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5fbec0
mov eax, dword fs:[0]
push eax
sub esp, 0xc0
mov eax, dword [0x6dadfc]
xor eax, ebp
mov dword [ebp - 0x8c], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0xcc], ecx
mov eax, dword [ebp - 0xcc]
mov dword [eax + 0x138], 0
mov ecx, dword [ebp - 0xcc]
add ecx, 0x110
call fcn.0046aa60
cmp dword [ebp + 0x20], 0
je 0x5153e1
cmp dword [ebp + 0x10], 0
jne 0x515405
mov ecx, dword [ebp + 0x1c]
push ecx
mov edx, dword [ebp + 0x20]
push edx
mov eax, dword [ebp + 0x18]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp + 8]
push edx
mov ecx, dword [ebp - 0xcc]
call fcn.00513860
jmp 0x515c78
mov eax, dword [ebp + 0x1c]
mov byte [eax], 0
cmp dword [ebp + 8], 0
jne 0x51543a
mov ecx, dword [ebp - 0xcc]
mov dword [ecx + 0x138], 1
push 0x65f258
mov edx, dword [ebp + 0x18]
mov eax, dword [edx]
mov ecx, dword [ebp + 0x18]
mov edx, dword [eax + 0x14]
call edx
xor al, al
jmp 0x515c78
mov eax, dword [ebp + 8]
push eax
lea ecx, [ebp - 0x7c]
call fcn.0046c610
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x7c]
call fcn.0046a430
lea ecx, [ebp - 0x7c]
call fcn.00452080
test eax, eax
jne 0x5154a4
mov ecx, dword [ebp - 0xcc]
mov dword [ecx + 0x138], 1
push 0x65f27c
mov edx, dword [ebp + 0x18]
mov eax, dword [edx]
mov ecx, dword [ebp + 0x18]
mov edx, dword [eax + 0x14]
call edx
mov byte [ebp - 0xbd], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x7c]
call fcn.0046cf40
mov al, byte [ebp - 0xbd]
jmp 0x515c78
push 0x65f2a4
lea ecx, [ebp - 0x7c]
call fcn.004700d0
movzx eax, al
test eax, eax
je 0x5154e6
push 0x65f2b0
mov ecx, dword [ebp - 0xcc]
add ecx, 0x110
call fcn.0046f6b0
push 0x65f2bc
lea ecx, [ebp - 0x7c]
call fcn.0046f6b0
lea ecx, [ebp - 0x7c]
call fcn.004f8d40
mov dword [ebp + 8], eax
movzx ecx, byte [0x6d2afc]
test ecx, ecx
je 0x5154fd
mov edx, dword [ebp + 0x18]
push edx
call fcn.00511bf0
add esp, 4
push 0x10
push 0
lea eax, [ebp - 0x9c]
push eax
call fcn.005d50c0
add esp, 0xc
mov ecx, 2
mov word [ebp - 0x9c], cx
movzx edx, word [ebp + 0xc]
push edx
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x9a], ax
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [ebp - 0x98], eax
mov byte [ebp - 0x4d], 0
lea ecx, [ebp - 0x3c]
call fcn.0046cb70
mov byte [ebp - 4], 1
mov dword [ebp - 0x44], 0
mov ecx, dword [ebp - 0xcc]
mov edx, dword [ecx + 0x104]
mov dword [ebp - 0x84], edx
cmp dword [ebp - 0x98], 0xffffffff
jne 0x5157a5
mov byte [ebp - 0xa5], 0
mov byte [ebp - 0xa6], 0
call fcn.004837c0
mov dword [ebp - 0xa4], eax
lea eax, [ebp - 0xa6]
push eax
lea ecx, [ebp - 0xa5]
push ecx
lea edx, [ebp - 0x44]
push edx
lea eax, [ebp - 0x3c]
push eax
mov ecx, dword [ebp + 0x20]
push ecx
mov edx, dword [ebp + 0x18]
push edx
mov eax, dword [ebp + 0x10]
push eax
mov ecx, dword [ebp - 0xcc]
mov edx, dword [ecx + 0x104]
push edx
push 0
mov eax, dword [ebp - 0xcc]
mov ecx, dword [eax + 0xac]
push ecx
mov edx, dword [ebp + 8]
push edx
call fcn.00513080
add esp, 0x2c
mov byte [ebp - 0x4d], al
lea eax, [ebp - 0x3c]
push eax
mov ecx, dword [ebp - 0xcc]
add ecx, 0x110
call fcn.0046f780
movzx ecx, byte [ebp - 0x4d]
test ecx, ecx
je 0x515656
lea ecx, [ebp - 0x3c]
call fcn.00452080
test eax, eax
je 0x515656
cmp dword [ebp - 0x44], 0
je 0x515614
mov edx, dword [ebp - 0x44]
mov dword [ebp - 0x98], edx
jmp 0x515651
mov eax, dword [ebp - 0xcc]
mov dword [eax + 0x138], 2
mov byte [ebp - 0xbe], 0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x3c]
call fcn.0046cf40
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x7c]
call fcn.0046cf40
mov al, byte [ebp - 0xbe]
jmp 0x515c78
jmp 0x5156f6
mov ecx, dword [ebp + 0x1c]
mov byte [ecx], 1
push str.Cannot_get_host_by_name.
mov edx, dword [ebp + 0x18]
mov eax, dword [edx]
mov ecx, dword [ebp + 0x18]
mov edx, dword [eax + 0x14]
call edx
mov eax, dword [ebp + 8]
push eax
push 0x65f2e4
mov ecx, dword [ebp + 0x18]
call fcn.00484700
movzx ecx, byte [ebp - 0xa5]
test ecx, ecx
je 0x51569c
mov edx, dword [ebp - 0xcc]
mov dword [edx + 0x138], 4
jmp 0x5156c9
movzx eax, byte [ebp - 0xa6]
test eax, eax
je 0x5156b9
mov ecx, dword [ebp - 0xcc]
mov dword [ecx + 0x138], 3
jmp 0x5156c9
mov edx, dword [ebp - 0xcc]
mov dword [edx + 0x138], 2
mov byte [ebp - 0xbf], 0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x3c]
call fcn.0046cf40
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x7c]
call fcn.0046cf40
mov al, byte [ebp - 0xbf]
jmp 0x515c78
cmp dword [ebp - 0x84], 0
je 0x5157a3
call fcn.004837c0
mov dword [ebp - 0xac], eax
mov eax, dword [ebp - 0xac]
cmp eax, dword [ebp - 0xa4]
jbe 0x5157a3
mov ecx, dword [ebp - 0xac]
sub ecx, dword [ebp - 0xa4]
mov dword [ebp - 0xb0], ecx
mov edx, dword [ebp - 0xb0]
cmp edx, dword [ebp - 0x84]
jb 0x515791
mov eax, dword [ebp - 0xcc]
mov dword [eax + 0x138], 3
push str.Application_timeout_after_DNS
mov ecx, dword [ebp + 0x18]
mov edx, dword [ecx]
mov ecx, dword [ebp + 0x18]
mov eax, dword [edx + 0x14]
call eax
mov byte [ebp - 0xc0], 0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x3c]
call fcn.0046cf40
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x7c]
call fcn.0046cf40
mov al, byte [ebp - 0xc0]
jmp 0x515c78
mov ecx, dword [ebp - 0x84]
sub ecx, dword [ebp - 0xb0]
mov dword [ebp - 0x84], ecx
jmp 0x5157ba
mov edx, dword [ebp + 8]
push edx
mov ecx, dword [ebp - 0xcc]
add ecx, 0x110
call fcn.0046f6b0
push 1
mov eax, dword [ebp + 0x18]
push eax
mov ecx, dword [ebp - 0xcc]
call fcn.00511940
mov byte [ebp - 0x7d], al
movzx ecx, byte [ebp - 0x7d]
test ecx, ecx
je 0x5157e5
mov edx, dword [ebp - 0xcc]
cmp dword [edx + 0xa4], 0xffffffff
jne 0x515834
mov eax, dword [ebp - 0xcc]
mov dword [eax + 0x138], 5
push str.Cannot_connect__invalid_socket__3_
mov ecx, dword [ebp + 0x18]
mov edx, dword [ecx]
mov ecx, dword [ebp + 0x18]
mov eax, dword [edx + 0x14]
call eax
mov byte [ebp - 0xc1], 0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x3c]
call fcn.0046cf40
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x7c]
call fcn.0046cf40
mov al, byte [ebp - 0xc1]
jmp 0x515c78
cmp dword [ebp - 0x84], 0
je 0x515848
mov ecx, dword [ebp - 0xcc]
call fcn.00511830
mov dword [ebp - 0x48], 0
mov ecx, dword [ebp - 0xcc]
mov edx, dword [ecx + 0x104]
mov dword [ebp - 0x84], edx
mov dword [ebp - 0x40], 0
mov byte [ebp - 0xd], 0
mov dword [ebp - 0x88], 0x64
call fcn.004837c0
mov dword [ebp - 0xa0], eax
cmp dword [ebp - 0x40], 0
je 0x5158ce
mov eax, dword [ebp - 0x84]
cmp eax, dword [ebp - 0x88]
jb 0x5158c0
mov ecx, dword [ebp - 0x84]
sub ecx, dword [ebp - 0x88]
mov dword [ebp - 0x84], ecx
cmp dword [ebp - 0x84], 0x64
jae 0x5158be
mov byte [ebp - 0xd], 1
mov dword [ebp - 0x84], 0x64
jmp 0x5158ce
mov byte [ebp - 0xd], 1
mov dword [ebp - 0x84], 0x64
mov dword [ebp - 0x48], 0
push 0x10
lea edx, [ebp - 0x9c]
push edx
mov eax, dword [ebp - 0xcc]
mov ecx, dword [eax + 0xa4]
push ecx
call dword [sym.imp.WS2_32.dll_connect]
mov dword [ebp - 0x4c], eax
cmp dword [ebp - 0x4c], 0
je 0x515986
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0x48], eax
cmp dword [ebp - 0x48], 0x2733
je 0x515986
cmp dword [ebp - 0x48], 0x2726
jne 0x515975
lea ecx, [ebp - 0x3c]
call fcn.004f8d40
push eax
push str.IP_Address
mov edx, dword [ebp + 0x18]
mov eax, dword [edx]
mov ecx, dword [ebp + 0x18]
mov edx, dword [eax + 0x2c]
call edx
mov eax, dword [ebp - 0x44]
push eax
push 0x65f340
mov ecx, dword [ebp + 0x18]
call fcn.00484940
mov ecx, dword [ebp + 8]
push ecx
push str.Hostname
mov edx, dword [ebp + 0x18]
mov eax, dword [edx]
mov ecx, dword [ebp + 0x18]
mov edx, dword [eax + 0x2c]
call edx
mov eax, dword [ebp - 0xcc]
mov ecx, dword [eax + 0xa4]
push ecx
push 0x65f354
mov ecx, dword [ebp + 0x18]
call fcn.00484940
mov edx, dword [ebp - 0x48]
push edx
push 0x65f364
mov ecx, dword [ebp + 0x18]
call fcn.004848a0
cmp dword [ebp - 0x4c], 0
je 0x515b93
cmp dword [ebp - 0x84], 0
je 0x515b93
cmp dword [ebp - 0x48], 0x2733
jne 0x515b93
mov byte [ebp - 0xb3], 0
mov byte [ebp - 0xb4], 0
mov byte [ebp - 0xb1], 0
mov byte [ebp - 0xb2], 0
lea eax, [ebp - 0xb1]
push eax
lea ecx, [ebp - 0xb4]
push ecx
lea edx, [ebp - 0xb3]
push edx
lea eax, [ebp - 0xb2]
push eax
mov ecx, dword [ebp + 0x20]
push ecx
mov edx, dword [ebp + 0x18]
push edx
push 1
mov eax, dword [ebp - 0x84]
push eax
mov ecx, dword [ebp + 0x14]
push ecx
mov edx, dword [ebp + 0x10]
push edx
mov ecx, dword [ebp - 0xcc]
call fcn.005170e0
movzx eax, al
test eax, eax
je 0x515a57
mov ecx, dword [ebp - 0xcc]
call fcn.00511870
mov ecx, dword [ebp - 0xcc]
mov byte [ecx + 0xa0], 1
mov byte [ebp - 0xc2], 1
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x3c]
call fcn.0046cf40
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x7c]
call fcn.0046cf40
mov al, byte [ebp - 0xc2]
jmp 0x515c78
movzx edx, byte [ebp - 0xb3]
test edx, edx
je 0x515aaf
mov ecx, dword [ebp - 0xcc]
call fcn.00511870
mov eax, dword [ebp - 0xcc]
mov dword [eax + 0x138], 4
mov byte [ebp - 0xc3], 0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x3c]
call fcn.0046cf40
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x7c]
call fcn.0046cf40
mov al, byte [ebp - 0xc3]
jmp 0x515c78
movzx ecx, byte [ebp - 0xd]
test ecx, ecx
jne 0x515b59
call fcn.004837c0
mov dword [ebp - 0xb8], eax
mov dword [ebp - 0xbc], 0x64
mov edx, dword [ebp - 0xb8]
cmp edx, dword [ebp - 0xa0]
jbe 0x515af0
mov eax, dword [ebp - 0xb8]
sub eax, dword [ebp - 0xa0]
mov dword [ebp - 0xbc], eax
mov ecx, dword [ebp - 0x84]
cmp ecx, dword [ebp - 0xbc]
jbe 0x515b57
mov edx, dword [ebp - 0x84]
sub edx, dword [ebp - 0xbc]
mov dword [ebp - 0x84], edx
cmp dword [ebp - 0x84], 0x3e8
jbe 0x515b35
mov dword [ebp - 0x88], 0x3e8
push 0x3e8
call fcn.004837b0
add esp, 4
jmp 0x515b49
mov dword [ebp - 0x88], 0x64
push 0x64
call fcn.004837b0
add esp, 4
mov eax, dword [ebp - 0x40]
add eax, 1
mov dword [ebp - 0x40], eax
jmp 0x515876
jmp 0x515b93
mov ecx, dword [ebp - 0xcc]
mov dword [ecx + 0x138], 6
mov edx, dword [ebp - 0xcc]
mov eax, dword [edx + 0x104]
push eax
push str.ConnectTimeoutMs_4
mov ecx, dword [ebp + 0x18]
call fcn.004848a0
mov ecx, dword [ebp + 0x18]
push ecx
mov edx, dword [ebp - 0x48]
push edx
call fcn.005127c0
add esp, 8
cmp dword [ebp - 0x84], 0
je 0x515ba7
mov ecx, dword [ebp - 0xcc]
call fcn.00511870
cmp dword [ebp - 0x4c], 0
jne 0x515c02
mov eax, dword [ebp - 0xcc]
mov byte [eax + 0xa0], 1
mov ecx, dword [ebp - 0xcc]
add ecx, 0x10
call fcn.0051cd30
mov ecx, dword [ebp - 0xcc]
add ecx, 0x58
call fcn.0051cd30
mov byte [ebp - 0xc4], 1
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x3c]
call fcn.0046cf40
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x7c]
call fcn.0046cf40
mov al, byte [ebp - 0xc4]
jmp 0x515c78
mov ecx, dword [ebp - 0xcc]
cmp dword [ecx + 0x138], 0
jne 0x515c21
mov edx, dword [ebp - 0xcc]
mov dword [edx + 0x138], 7
push 0x65f384
mov eax, dword [ebp + 0x18]
mov edx, dword [eax]
mov ecx, dword [ebp + 0x18]
mov eax, dword [edx + 0x14]
call eax
mov byte [ebp - 0xc5], 0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x3c]
call fcn.0046cf40
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x7c]
call fcn.0046cf40
mov al, byte [ebp - 0xc5]
jmp 0x515c78
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x8c]
xor ecx, ebp
call fcn.005d17b7
mov esp, ebp
pop ebp
ret 0x1c