Function at 0x476980
Capabilities:
Connect socket

Disassembly:
sub esp, 0x120
mov eax, dword [0x55909c]
xor eax, esp
mov dword [esp + 0x11c], eax
mov eax, dword [esp + 0x124]
push ebx
push ebp
push esi
push edi
mov edi, ecx
mov ecx, dword [eax + 4]
mov ebx, dword [edi]
mov dword [esp + 0x1c], ecx
mov ecx, dword [eax + 0xc]
mov esi, edx
mov edx, dword [edi + 0x80]
mov dword [esp + 0x24], ecx
mov ecx, dword [eax + 0x10]
cmp ecx, 0x80
mov dword [esp + 0x18], esi
mov dword [esp + 0x20], edx
mov dword [esp + 0x28], ecx
jbe 0x4769d9
mov ecx, 0x80
mov dword [esp + 0x28], ecx
mov edx, dword [eax + 0x18]
push ecx
push edx
lea eax, [esp + 0x34]
push eax
call fcn.004f24c0
mov byte [esi], 0
mov eax, dword [ebx + 0x150]
add esp, 0xc
test eax, eax
je 0x476a0d
mov edx, dword [ebx + 0x154]
lea ecx, [esp + 0x1c]
push ecx
push 0
push edx
call eax
add esp, 0xc
jmp 0x476a22
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x1c]
push eax
push ecx
push edx
call dword [sym.imp.WS2_32.dll_socket]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x476bff
mov edx, dword [esp + 0x1c]
push 0x80
lea eax, [esp + 0xb0]
push eax
lea ecx, [esp + 0x38]
push ecx
push edx
call fcn.00478280
add esp, 0x10
test eax, eax
je 0x476a94
lea eax, [esp + 0xac]
push eax
push str.__Trying__s...
push ebx
call fcn.00476110
lea ecx, [esp + 0xb8]
push ecx
push 0x53d8c8
lea esi, [ebx + 0x8590]
push 0x2e
push esi
call fcn.004775f0
lea edx, [edi + 0x3c]
add esp, 0x1c
mov eax, esi
sub edx, esi
mov cl, byte [eax]
mov byte [edx + eax], cl
add eax, 1
test cl, cl
jne 0x476a88
cmp byte [ebx + 0x286], 0
je 0x476aa4
mov edx, ebp
call fcn.004768f0
push ebp
call fcn.00476950
mov eax, dword [ebx + 0x148]
add esp, 4
test eax, eax
je 0x476ad2
mov edx, dword [ebx + 0x14c]
push 0
push ebp
push edx
call eax
add esp, 0xc
test eax, eax
mov dword [esp + 0x14], eax
jne 0x476bf8
mov ecx, dword [esp + 0x1c]
push ebp
push edi
call fcn.00476570
add esp, 8
test eax, eax
jne 0x476bf8
push 1
push ebp
call fcn.00480af0
add esp, 8
cmp dword [edi + 0x80], 1
jne 0x476b5d
mov eax, dword [esp + 0x28]
push eax
lea ecx, [esp + 0x30]
push ecx
push ebp
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
mov dword [esp + 0x10], eax
jne 0x476b79
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
cmp esi, 0xb
mov dword [esp + 0x14], esi
je 0x476b67
cmp esi, 0x2732
jle 0x476b37
cmp esi, 0x2734
jle 0x476b67
push esi
push edi
call fcn.00480890
push eax
lea edx, [esp + 0xb8]
push edx
push str.Failed_to_connect_to__s:__s
push ebx
call fcn.004761a0
add esp, 0x18
mov dword [ebx + 0x8494], esi
jmp 0x476b87
mov dword [esp + 0x10], 0
jmp 0x476b87
mov eax, dword [esp + 0x138]
mov ecx, ebp
call fcn.00476540
mov dword [esp + 0x10], eax
cmp eax, 1
jne 0x476b87
cmp dword [ebx + 0x448], 2
je 0x476bb5
push ebp
lea esi, [esp + 0x18]
call fcn.00476880
mov ecx, dword [esp + 0x14]
add esp, 4
test ecx, ecx
jne 0x476bb9
test al, al
je 0x476bd8
mov eax, dword [esp + 0x18]
push str.connected_n
push ebx
mov byte [eax], 1
call fcn.00476110
add esp, 8
mov eax, ebp
jmp 0x476c02
cmp ecx, 1
jne 0x476bd8
mov ecx, dword [esp + 0x14]
push str.Timeout_n
push ebx
mov dword [ebx + 0x8494], ecx
call fcn.00476110
add esp, 8
jmp 0x476bf8
mov eax, dword [esp + 0x14]
push eax
push edi
mov dword [ebx + 0x8494], eax
call fcn.00480890
push eax
push 0x515d10
push ebx
call fcn.00476110
add esp, 0x14
push ebp
call dword [sym.imp.WS2_32.dll_closesocket]
or eax, 0xffffffff
mov ecx, dword [esp + 0x12c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004f62a5
add esp, 0x120
ret