Function at 0x51f840
Capabilities:
Connect socket

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x6267c6
mov eax, dword fs:[0]
push eax
sub esp, 0x124
mov eax, dword [0x70bddc]
xor eax, ebp
mov dword [ebp - 0x88], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x130], ecx
mov eax, dword [ebp - 0x130]
mov dword [eax + 0x138], 0
mov ecx, dword [ebp + 0x18]
mov byte [ecx], 0
mov ecx, dword [ebp - 0x130]
add ecx, 0x110
call fcn.00476a50
cmp dword [ebp + 8], 0
jne 0x51f8ca
mov edx, dword [ebp - 0x130]
mov dword [edx + 0x138], 1
push 0x68ac3c
mov eax, dword [ebp + 0x10]
mov edx, dword [eax]
mov ecx, dword [ebp + 0x10]
mov eax, dword [edx + 0x14]
call eax
xor al, al
jmp 0x5201ec
mov ecx, dword [ebp + 8]
push ecx
lea ecx, [ebp - 0x74]
call fcn.00478600
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x74]
call fcn.00476420
lea ecx, [ebp - 0x74]
call fcn.004760b0
test eax, eax
jne 0x51f934
mov edx, dword [ebp - 0x130]
mov dword [edx + 0x138], 1
push 0x68ac60
mov eax, dword [ebp + 0x10]
mov edx, dword [eax]
mov ecx, dword [ebp + 0x10]
mov eax, dword [edx + 0x14]
call eax
mov byte [ebp - 0x121], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x74]
call fcn.00478f30
mov al, byte [ebp - 0x121]
jmp 0x5201ec
push 0x68ac88
lea ecx, [ebp - 0x74]
call fcn.0047c0c0
movzx ecx, al
test ecx, ecx
je 0x51f976
push 0x68ac94
mov ecx, dword [ebp - 0x130]
add ecx, 0x110
call fcn.0047b6a0
push 0x68aca0
lea ecx, [ebp - 0x74]
call fcn.0047b6a0
lea ecx, [ebp - 0x74]
call fcn.00510ae0
mov dword [ebp + 8], eax
movzx edx, byte [0x703afc]
test edx, edx
je 0x51f98d
mov eax, dword [ebp + 0x10]
push eax
call fcn.0051dbd0
add esp, 4
push 0x10
push 0
lea ecx, [ebp - 0x98]
push ecx
call fcn.005e0880
add esp, 0xc
mov edx, 2
mov word [ebp - 0x98], dx
movzx eax, word [ebp + 0xc]
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x96], ax
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [ebp - 0x94], eax
lea ecx, [ebp - 0x3c]
call fcn.00478b60
mov byte [ebp - 4], 1
mov dword [ebp - 0x44], 0
cmp dword [ebp - 0x94], 0xffffffff
jne 0x51fc58
mov edx, dword [ebp - 0x130]
mov eax, dword [edx + 0x104]
mov dword [ebp - 0xa8], eax
mov byte [ebp - 0xa2], 0
mov byte [ebp - 0xad], 0
mov dword [ebp - 0xac], 0xc8
call fcn.0048f7c0
mov dword [ebp - 0xa0], eax
lea ecx, [ebp - 0xad]
push ecx
lea edx, [ebp - 0xa2]
push edx
lea eax, [ebp - 0x44]
push eax
lea ecx, [ebp - 0x3c]
push ecx
mov edx, dword [ebp + 0x14]
push edx
mov eax, dword [ebp + 0x10]
push eax
mov ecx, dword [ebp - 0xac]
push ecx
mov edx, dword [ebp - 0x130]
mov eax, dword [edx + 0x104]
push eax
push 0
mov ecx, dword [ebp - 0x130]
mov edx, dword [ecx + 0xac]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.0051f060
add esp, 0x2c
mov byte [ebp - 0xa1], al
mov ecx, dword [ebp - 0xa0]
push ecx
push str.GetHostByNameHB_ipv4
mov ecx, dword [ebp + 0x10]
call fcn.00490570
lea edx, [ebp - 0x3c]
push edx
mov ecx, dword [ebp - 0x130]
add ecx, 0x110
call fcn.0047b770
movzx eax, byte [ebp - 0xa1]
test eax, eax
je 0x51fb09
lea ecx, [ebp - 0x3c]
call fcn.004760b0
test eax, eax
je 0x51fb09
cmp dword [ebp - 0x44], 0
je 0x51fac7
mov ecx, dword [ebp - 0x44]
mov dword [ebp - 0x94], ecx
jmp 0x51fb04
mov edx, dword [ebp - 0x130]
mov dword [edx + 0x138], 2
mov byte [ebp - 0x122], 0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x3c]
call fcn.00478f30
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x74]
call fcn.00478f30
mov al, byte [ebp - 0x122]
jmp 0x5201ec
jmp 0x51fba9
mov eax, dword [ebp + 0x18]
mov byte [eax], 1
push str.Cannot_get_host_by_name..
mov ecx, dword [ebp + 0x10]
mov edx, dword [ecx]
mov ecx, dword [ebp + 0x10]
mov eax, dword [edx + 0x14]
call eax
mov ecx, dword [ebp + 8]
push ecx
push 0x68ace0
mov ecx, dword [ebp + 0x10]
call fcn.004906e0
movzx edx, byte [ebp - 0xa2]
test edx, edx
je 0x51fb4f
mov eax, dword [ebp - 0x130]
mov dword [eax + 0x138], 4
jmp 0x51fb7c
movzx ecx, byte [ebp - 0xad]
test ecx, ecx
je 0x51fb6c
mov edx, dword [ebp - 0x130]
mov dword [edx + 0x138], 3
jmp 0x51fb7c
mov eax, dword [ebp - 0x130]
mov dword [eax + 0x138], 2
mov byte [ebp - 0x123], 0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x3c]
call fcn.00478f30
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x74]
call fcn.00478f30
mov al, byte [ebp - 0x123]
jmp 0x5201ec
cmp dword [ebp - 0xa8], 0
je 0x51fc56
call fcn.0048f7c0
mov dword [ebp - 0xb4], eax
mov ecx, dword [ebp - 0xb4]
cmp ecx, dword [ebp - 0xa0]
jbe 0x51fc56
mov edx, dword [ebp - 0xb4]
sub edx, dword [ebp - 0xa0]
mov dword [ebp - 0xb8], edx
mov eax, dword [ebp - 0xb8]
cmp eax, dword [ebp - 0xa8]
jb 0x51fc44
mov ecx, dword [ebp - 0x130]
mov dword [ecx + 0x138], 3
push 0x68acec
mov edx, dword [ebp + 0x10]
mov eax, dword [edx]
mov ecx, dword [ebp + 0x10]
mov edx, dword [eax + 0x14]
call edx
mov byte [ebp - 0x124], 0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x3c]
call fcn.00478f30
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x74]
call fcn.00478f30
mov al, byte [ebp - 0x124]
jmp 0x5201ec
mov eax, dword [ebp - 0xa8]
sub eax, dword [ebp - 0xb8]
mov dword [ebp - 0xa8], eax
jmp 0x51fc6d
mov ecx, dword [ebp + 8]
push ecx
mov ecx, dword [ebp - 0x130]
add ecx, 0x110
call fcn.0047b6a0
push 1
mov edx, dword [ebp + 0x10]
push edx
mov ecx, dword [ebp - 0x130]
call fcn.0051d920
mov byte [ebp - 0x75], al
movzx eax, byte [ebp - 0x75]
test eax, eax
je 0x51fc98
mov ecx, dword [ebp - 0x130]
cmp dword [ecx + 0xa4], 0xffffffff
jne 0x51fce7
mov edx, dword [ebp - 0x130]
mov dword [edx + 0x138], 5
push str.Cannot_connect__invalid_socket__1_
mov eax, dword [ebp + 0x10]
mov edx, dword [eax]
mov ecx, dword [ebp + 0x10]
mov eax, dword [edx + 0x14]
call eax
mov byte [ebp - 0x125], 0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x3c]
call fcn.00478f30
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x74]
call fcn.00478f30
mov al, byte [ebp - 0x125]
jmp 0x5201ec
mov ecx, dword [ebp - 0x130]
cmp dword [ecx + 0x104], 0
je 0x51fd01
mov ecx, dword [ebp - 0x130]
call fcn.0051d810
mov edx, dword [ebp - 0x130]
mov eax, dword [edx + 0x104]
mov dword [ebp - 0x7c], eax
mov dword [ebp - 0x40], 0
mov byte [ebp - 0xd], 0
mov dword [ebp - 0x80], 0x64
call fcn.0048f7c0
mov dword [ebp - 0x9c], eax
mov ecx, dword [ebp - 0x130]
cmp dword [ecx + 0xa4], 0xffffffff
jne 0x51fd8b
mov edx, dword [ebp - 0x130]
mov dword [edx + 0x138], 5
push str.Cannot_connect__invalid_socket__111_
mov eax, dword [ebp + 0x10]
mov edx, dword [eax]
mov ecx, dword [ebp + 0x10]
mov eax, dword [edx + 0x14]
call eax
mov byte [ebp - 0x126], 0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x3c]
call fcn.00478f30
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x74]
call fcn.00478f30
mov al, byte [ebp - 0x126]
jmp 0x5201ec
cmp dword [ebp - 0x40], 0
je 0x51fdc0
mov ecx, dword [ebp - 0x7c]
cmp ecx, dword [ebp - 0x80]
jb 0x51fdb5
mov edx, dword [ebp - 0x7c]
sub edx, dword [ebp - 0x80]
mov dword [ebp - 0x7c], edx
cmp dword [ebp - 0x7c], 0x64
jae 0x51fdb3
mov byte [ebp - 0xd], 1
mov dword [ebp - 0x7c], 0x64
jmp 0x51fdc0
mov byte [ebp - 0xd], 1
mov dword [ebp - 0x7c], 0x64
mov dword [ebp - 0x48], 0
mov byte [ebp - 0x81], 0
push 0x10
lea eax, [ebp - 0x98]
push eax
mov ecx, dword [ebp - 0x130]
mov edx, dword [ecx + 0xa4]
push edx
call dword [sym.imp.WS2_32.dll_connect]
mov dword [ebp - 0x4c], eax
cmp dword [ebp - 0x4c], 0
je 0x51fe7f
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0x48], eax
cmp dword [ebp - 0x48], 0x2733
je 0x51fe7f
cmp dword [ebp - 0x48], 0x2726
jne 0x51fe6e
lea ecx, [ebp - 0x3c]
call fcn.00510ae0
push eax
push 0x68ad58
mov eax, dword [ebp + 0x10]
mov edx, dword [eax]
mov ecx, dword [ebp + 0x10]
mov eax, dword [edx + 0x2c]
call eax
mov ecx, dword [ebp - 0x44]
push ecx
push 0x68ad64
mov ecx, dword [ebp + 0x10]
call fcn.00490920
mov edx, dword [ebp + 8]
push edx
push 0x68ad6c
mov eax, dword [ebp + 0x10]
mov edx, dword [eax]
mov ecx, dword [ebp + 0x10]
mov eax, dword [edx + 0x2c]
call eax
mov ecx, dword [ebp - 0x130]
mov edx, dword [ecx + 0xa4]
push edx
push 0x68ad78
mov ecx, dword [ebp + 0x10]
call fcn.00490920
mov eax, dword [ebp - 0x48]
push eax
push 0x68ad88
mov ecx, dword [ebp + 0x10]
call fcn.00490880
cmp dword [ebp - 0x4c], 0
je 0x520040
cmp dword [ebp - 0x7c], 0
je 0x520040
cmp dword [ebp - 0x48], 0x2733
jne 0x520040
lea ecx, [ebp - 0xb9]
push ecx
lea edx, [ebp - 0xbc]
push edx
lea eax, [ebp - 0xba]
push eax
mov ecx, dword [ebp + 0x10]
push ecx
push 1
mov edx, dword [ebp - 0x7c]
push edx
mov ecx, dword [ebp - 0x130]
call fcn.00522d90
mov byte [ebp - 0xbb], al
movzx eax, byte [ebp - 0xbb]
test eax, eax
je 0x51ffa3
mov ecx, dword [ebp - 0x130]
call fcn.0051d850
mov ecx, dword [ebp - 0x130]
mov byte [ecx + 0xa0], 1
lea ecx, [ebp - 0xe4]
call fcn.00478b60
mov byte [ebp - 4], 2
mov edx, dword [ebp + 0x10]
push edx
lea eax, [ebp - 0xe8]
push eax
lea ecx, [ebp - 0xe4]
push ecx
mov ecx, dword [ebp - 0x130]
call fcn.0051eea0
lea ecx, [ebp - 0xe4]
call fcn.00510ae0
push eax
push str.myIP_1
mov edx, dword [ebp + 0x10]
mov eax, dword [edx]
mov ecx, dword [ebp + 0x10]
mov edx, dword [eax + 0x2c]
call edx
mov eax, dword [ebp - 0xe8]
push eax
push str.myPort_1
mov ecx, dword [ebp + 0x10]
call fcn.00490880
push str.connect_successful__1_
mov ecx, dword [ebp + 0x10]
mov edx, dword [ecx]
mov ecx, dword [ebp + 0x10]
mov eax, dword [edx + 0x18]
call eax
mov byte [ebp - 0x127], 1
mov byte [ebp - 4], 1
lea ecx, [ebp - 0xe4]
call fcn.00478f30
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x3c]
call fcn.00478f30
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x74]
call fcn.00478f30
mov al, byte [ebp - 0x127]
jmp 0x5201ec
movzx ecx, byte [ebp - 0xd]
test ecx, ecx
jne 0x520039
call fcn.0048f7c0
mov dword [ebp - 0xec], eax
mov dword [ebp - 0xf0], 0x64
mov edx, dword [ebp - 0xec]
cmp edx, dword [ebp - 0x9c]
jbe 0x51ffe4
mov eax, dword [ebp - 0xec]
sub eax, dword [ebp - 0x9c]
mov dword [ebp - 0xf0], eax
mov ecx, dword [ebp - 0x7c]
cmp ecx, dword [ebp - 0xf0]
jbe 0x520039
mov edx, dword [ebp - 0x7c]
sub edx, dword [ebp - 0xf0]
mov dword [ebp - 0x7c], edx
cmp dword [ebp - 0x7c], 0x3e8
jbe 0x52001a
mov dword [ebp - 0x80], 0x3e8
push 0x3e8
call fcn.0048f7b0
add esp, 4
jmp 0x52002b
mov dword [ebp - 0x80], 0x64
push 0x64
call fcn.0048f7b0
add esp, 4
mov eax, dword [ebp - 0x40]
add eax, 1
mov dword [ebp - 0x40], eax
jmp 0x51fd22
mov byte [ebp - 0xbc], 1
mov ecx, dword [ebp - 0x130]
cmp dword [ecx + 0x104], 0
je 0x52005a
mov ecx, dword [ebp - 0x130]
call fcn.0051d850
cmp dword [ebp - 0x4c], 0
jne 0x52013e
mov edx, dword [ebp - 0x130]
mov byte [edx + 0xa0], 1
mov ecx, dword [ebp - 0x130]
add ecx, 0x10
call fcn.00528d10
mov ecx, dword [ebp - 0x130]
add ecx, 0x58
call fcn.00528d10
lea ecx, [ebp - 0x11c]
call fcn.00478b60
mov byte [ebp - 4], 3
mov eax, dword [ebp + 0x10]
push eax
lea ecx, [ebp - 0x120]
push ecx
lea edx, [ebp - 0x11c]
push edx
mov ecx, dword [ebp - 0x130]
call fcn.0051eea0
lea ecx, [ebp - 0x11c]
call fcn.00510ae0
push eax
push str.myIP_2
mov eax, dword [ebp + 0x10]
mov edx, dword [eax]
mov ecx, dword [ebp + 0x10]
mov eax, dword [edx + 0x2c]
call eax
mov ecx, dword [ebp - 0x120]
push ecx
push str.myPort_2
mov ecx, dword [ebp + 0x10]
call fcn.00490880
push 0x68add4
mov edx, dword [ebp + 0x10]
mov eax, dword [edx]
mov ecx, dword [ebp + 0x10]
mov edx, dword [eax + 0x18]
call edx
mov byte [ebp - 0x128], 1
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x11c]
call fcn.00478f30
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x3c]
call fcn.00478f30
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x74]
call fcn.00478f30
mov al, byte [ebp - 0x128]
jmp 0x5201ec
movzx eax, byte [ebp - 0x81]
test eax, eax
je 0x520175
mov ecx, dword [ebp - 0x130]
mov edx, dword [ecx + 0x104]
push edx
push str.ConnectTimeoutMs_2
mov ecx, dword [ebp + 0x10]
call fcn.00490880
mov eax, dword [ebp - 0x130]
mov dword [eax + 0x138], 6
jmp 0x520185
mov ecx, dword [ebp - 0x130]
mov dword [ecx + 0x138], 7
push str.Connect_function_failed.
mov edx, dword [ebp + 0x10]
mov eax, dword [edx]
mov ecx, dword [ebp + 0x10]
mov edx, dword [eax + 0x14]
call edx
mov eax, dword [ebp + 0x10]
push eax
mov ecx, dword [ebp - 0x48]
push ecx
call fcn.0051e7a0
add esp, 8
mov byte [ebp - 0x129], 0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x3c]
call fcn.00478f30
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x74]
call fcn.00478f30
mov al, byte [ebp - 0x129]
jmp 0x5201ec
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x88]
xor ecx, ebp
call fcn.005dceb7
mov esp, ebp
pop ebp
ret 0x14