Function at 0x51b840
Capabilities:
Connect socket

Disassembly:
sub esp, 0xac
mov eax, dword [0x704dd8]
xor eax, esp
mov dword [esp + 0xa8], eax
mov eax, dword [esp + 0xb8]
push ebx
push ebp
mov ebp, dword [esp + 0xb8]
push esi
mov esi, dword [ebp]
mov dword [esp + 0x1c], eax
mov dword [eax], 0xffffffff
mov eax, dword [ecx + 4]
xor ebx, ebx
mov dword [esp + 0x24], eax
mov eax, dword [ebp + 0x74]
cmp eax, 2
push edi
mov edi, edx
mov dword [esp + 0x24], edi
mov dword [esp + 0x18], ebx
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x10], esi
mov dword [esp + 0x2c], eax
jne 0x51b8a4
mov dword [esp + 0x30], 0x11
jmp 0x51b8ab
mov edx, dword [ecx + 0xc]
mov dword [esp + 0x30], edx
mov eax, dword [ecx + 0x10]
cmp eax, 0x80
mov dword [esp + 0x34], eax
jbe 0x51b8c2
mov eax, 0x80
mov dword [esp + 0x34], eax
push eax
mov eax, dword [ecx + 0x18]
push eax
lea ecx, [esp + 0x40]
push ecx
call fcn.004e9c70
mov dword [edi], ebx
mov eax, dword [esi + 0x174]
add esp, 0xc
cmp eax, ebx
je 0x51b8f4
mov ecx, dword [esi + 0x178]
lea edx, [esp + 0x28]
push edx
push ebx
push ecx
call eax
add esp, 0xc
jmp 0x51b909
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x28]
push edx
push eax
push ecx
call dword [sym.imp.WS2_32.dll_socket]
cmp eax, 0xffffffff
mov dword [esp + 0x14], eax
je 0x51bbad
lea edi, [ebp + 0x9e]
lea ebx, [ebp + 0xcc]
lea esi, [esp + 0x38]
call fcn.0051b540
test eax, eax
jne 0x51b962
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push esi
push ebp
call fcn.0051ec40
mov edx, dword [esp + 0x18]
push eax
push esi
push str.sa_addr_inet_ntop___failed_with_errno__d:__s
push edx
call fcn.0051abc0
mov eax, dword [esp + 0x2c]
push eax
push ebp
call fcn.0051b810
add esp, 0x20
jmp 0x51bbad
mov ebx, dword [esp + 0x10]
lea eax, [ebp + 0x40]
mov esi, edi
mov edi, eax
mov ecx, 0xb
rep movsd dword es:[edi], dword [esi]
push eax
push str.__Trying__s...
push ebx
movsw word es:[edi], word [esi]
call fcn.0051ab30
push ebp
call fcn.0051b4e0
mov esi, dword [esp + 0x24]
add esp, 0x10
cmp dword [ebx + 0x314], 0
je 0x51b9a1
mov edx, esi
mov edi, ebp
call fcn.0051b6e0
push esi
call fcn.0051b740
mov eax, dword [ebx + 0x16c]
add esp, 4
test eax, eax
je 0x51b9f0
mov ecx, dword [ebx + 0x170]
push 0
push esi
push ecx
call eax
mov edi, eax
add esp, 0xc
cmp edi, 2
mov dword [esp + 0x18], edi
jne 0x51b9d8
mov dword [esp + 0x1c], 1
jmp 0x51b9f4
test edi, edi
je 0x51b9f4
push esi
push ebp
call fcn.0051b810
add esp, 8
mov eax, 0x2a
jmp 0x51bbaf
mov edi, dword [esp + 0x18]
mov edx, dword [esp + 0x28]
push edx
push esi
mov ebx, ebp
call fcn.0051b130
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x51ba1b
push esi
push ebp
call fcn.0051b810
add esp, 8
mov eax, ebx
jmp 0x51bbaf
push 1
push esi
call fcn.005340c0
mov eax, dword [esp + 0x24]
add esp, 8
test eax, eax
jne 0x51bada
cmp dword [ebp + 0x74], 1
jne 0x51bada
mov eax, dword [esp + 0x34]
push eax
lea ecx, [esp + 0x3c]
push ecx
push esi
call dword [sym.imp.WS2_32.dll_connect]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x51ba60
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
mov dword [esp + 0x18], eax
mov edi, eax
call fcn.0051f910
cmp dword [ebp + 0x208], 1
mov dword [ebp + 0x200], eax
mov dword [ebp + 0x204], edx
jle 0x51ba8e
mov edx, dword [ebp + 0x20c]
mov eax, dword [esp + 0x10]
push edx
push eax
call fcn.0051f130
add esp, 8
cmp ebx, 0xffffffff
jne 0x51bb48
cmp edi, 0xb
je 0x51bb2b
cmp edi, 0x2732
jle 0x51bab0
cmp edi, 0x2734
jle 0x51bb2b
push edi
push ebp
call fcn.0051ec40
mov ecx, dword [esp + 0x18]
push eax
lea eax, [ebp + 0x40]
push eax
push str.Failed_to_connect_to__s:__s
push ecx
call fcn.0051abc0
mov edx, dword [esp + 0x28]
add esp, 0x18
mov dword [edx + 0x856c], edi
jmp 0x51bae0
xor ebx, ebx
test eax, eax
jne 0x51bafd
push esi
lea esi, [esp + 0x1c]
call fcn.0051b470
add esp, 4
test ebx, ebx
jne 0x51bb62
test eax, eax
je 0x51bb7b
mov esi, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x24]
push str.connected_n
push eax
mov dword [edx], 1
call fcn.0051ab30
push esi
push ebp
call fcn.0051b580
mov ecx, dword [esp + 0x30]
add esp, 0x10
mov dword [ecx], esi
jmp 0x51bbad
mov eax, dword [esp + 0xc4]
push ebp
mov edi, esi
call fcn.0051b0c0
mov ebx, eax
add esp, 4
cmp ebx, 3
je 0x51b9dc
cmp ebx, 1
jne 0x51bae0
mov eax, dword [esp + 0x10]
cmp dword [eax + 0x520], 2
jne 0x51bae0
mov ecx, dword [esp + 0x20]
mov dword [ecx], esi
jmp 0x51bbad
cmp ebx, 1
jne 0x51bb7b
mov edx, dword [esp + 0x10]
push str.Timeout_n
push edx
call fcn.0051ab30
add esp, 8
jmp 0x51bb9f
mov eax, dword [esp + 0x18]
mov esi, dword [esp + 0x10]
push eax
push ebp
mov dword [esi + 0x856c], eax
call fcn.0051ec40
push eax
push 0x61e7c4
push esi
call fcn.0051ab30
add esp, 0x14
mov eax, dword [esp + 0x14]
push eax
push ebp
call fcn.0051b810
add esp, 8
xor eax, eax
mov ecx, dword [esp + 0xb8]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004e8c89
add esp, 0xac
ret