Function at 0x4812b0
Capabilities:
Connect socket
Set socket configuration

Disassembly:
push 0xffffffffffffffff
push 0x4f811b
mov eax, dword fs:[0]
push eax
sub esp, 0x104
mov eax, dword [0x5e4ce0]
xor eax, esp
mov dword [esp + 0x100], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x5e4ce0]
xor eax, esp
push eax
lea eax, [esp + 0x118]
mov dword fs:[0], eax
mov eax, dword [esp + 0x134]
mov ebp, dword [esp + 0x128]
mov edi, dword [esp + 0x130]
mov esi, ecx
lea ebx, [esi + 0x74]
mov dword [esi + 0x90], 0
mov ecx, ebx
mov dword [esp + 0x18], eax
mov byte [eax], 0
call fcn.00451240
test ebp, ebp
jne 0x48133e
mov dword [esi + 0x90], 1
mov eax, dword [edi]
mov edx, dword [eax + 0x10]
push str.Cannot_connect__hostname_is_NULL
mov ecx, edi
call edx
jmp 0x481647
push ebp
lea ecx, [esp + 0x24]
call fcn.00451b50
lea ecx, [esp + 0x20]
mov dword [esp + 0x120], 0
call fcn.00451070
lea ecx, [esp + 0x20]
call fcn.004c49f0
test eax, eax
jne 0x481386
mov dword [esi + 0x90], 1
mov eax, dword [edi]
mov edx, dword [eax + 0x10]
push str.Cannot_connect__hostname_is_zero_length
mov ecx, edi
call edx
jmp 0x481633
push str.localhost
lea ecx, [esp + 0x24]
call fcn.00452eb0
test al, al
je 0x4813bd
push str.127.0.0.1
mov ecx, ebx
call fcn.00452a60
push str.127.0.0.1
lea ecx, [esp + 0x24]
call fcn.00452a60
lea ecx, [esp + 0x20]
call fcn.004c06c0
mov ebp, eax
cmp byte [0x5ddcf4], 0
je 0x4813cf
push edi
call fcn.0047f6c0
add esp, 4
xor eax, eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x12c]
push eax
mov word [esp + 0x40], 2
call dword [sym.imp.WS2_32.dll_htons]
push ebp
mov word [esp + 0x42], ax
call dword [sym.imp.WS2_32.dll_inet_addr]
cmp eax, 0xffffffff
mov dword [esp + 0x40], eax
push ebp
jne 0x481461
call fcn.0047fc80
add esp, 4
test eax, eax
je 0x481536
mov ecx, dword [eax + 0xc]
cmp dword [ecx], 0
je 0x48155a
mov edx, ecx
mov ecx, dword [edx]
mov edx, dword [ecx]
mov dword [esp + 0x40], edx
mov eax, dword [eax + 0xc]
mov eax, dword [eax]
movzx ecx, byte [eax + 3]
movzx edx, byte [eax + 2]
push ecx
movzx ecx, byte [eax + 1]
push edx
movzx edx, byte [eax]
push ecx
push edx
lea eax, [esp + 0x5c]
push str._d._d._d._d
push eax
call fcn.004daca4
add esp, 0x18
lea ecx, [esp + 0x4c]
push ecx
mov ecx, ebx
call fcn.00452a60
push edi
mov ecx, esi
call fcn.00481170
test al, al
je 0x48161b
mov eax, dword [esi + 0x4c]
cmp eax, 0xffffffff
je 0x48161b
xor ebp, ebp
cmp dword [esi + 0x6c], ebp
mov dword [esp + 0x14], 1
je 0x4814a4
lea ecx, [esp + 0x14]
push ecx
push 0x8004667e
push eax
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov dword [esp + 0x18], ebp
xor bl, bl
lea ebx, [ebx]
mov eax, dword [esi + 0x4c]
push 0x10
lea edx, [esp + 0x40]
push edx
push eax
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
mov dword [esp + 0x1c], eax
je 0x4815ae
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebp, eax
cmp ebp, 0x2733
je 0x4814ec
mov edx, dword [edi]
mov eax, dword [edx + 0x2c]
push ebp
push str.sockError
mov ecx, edi
call eax
mov eax, dword [esi + 0x6c]
test eax, eax
je 0x4815ae
cmp ebp, 0x2733
jne 0x4815ae
push edi
push eax
mov ecx, esi
call fcn.004803b0
test al, al
jne 0x481569
cmp dword [esp + 0x18], 0
jne 0x4815ac
mov edx, dword [edi]
mov eax, dword [edx + 0x10]
push str.Connection_attempt_timed_out__trying_again.
mov ecx, edi
call eax
mov dword [esp + 0x18], 1
jmp 0x4814b0
mov edx, dword [esp + 0x18]
mov byte [edx], 1
mov eax, dword [edi]
mov edx, dword [eax + 0x10]
push str.Cannot_get_host_by_name.
mov ecx, edi
call edx
mov eax, dword [edi]
mov edx, dword [eax + 0x28]
push ebp
push str.hostname
mov ecx, edi
call edx
mov dword [esi + 0x90], 2
jmp 0x481633
mov edx, dword [esi + 0x4c]
lea ecx, [esp + 0x14]
push ecx
push 0x8004667e
push edx
mov dword [esp + 0x20], 0
call dword [sym.imp.WS2_32.dll_ioctlsocket]
lea ecx, [esi + 0x54]
mov byte [esi + 0x48], 1
call fcn.004b21e0
lea ecx, [esp + 0x20]
mov dword [esp + 0x120], 0xffffffff
call fcn.00451e70
mov al, 1
jmp 0x481649
mov bl, 1
cmp dword [esi + 0x6c], 0
je 0x4815d0
mov ecx, dword [esi + 0x4c]
lea eax, [esp + 0x14]
push eax
push 0x8004667e
push ecx
mov dword [esp + 0x20], 0
call dword [sym.imp.WS2_32.dll_ioctlsocket]
cmp dword [esp + 0x1c], 0
jne 0x4815f5
lea ecx, [esi + 0x54]
mov byte [esi + 0x48], 1
call fcn.004b21e0
lea ecx, [esi + 8]
call fcn.004b2240
lea ecx, [esi + 0x28]
call fcn.004b2240
jmp 0x481591
neg bl
push str.Connect_function_failed.
mov ecx, edi
sbb ebx, ebx
add ebx, 7
mov dword [esi + 0x90], ebx
mov edx, dword [edi]
mov eax, dword [edx + 0x10]
call eax
push edi
push ebp
mov ecx, esi
call fcn.0047f990
jmp 0x481633
mov dword [esi + 0x90], 5
mov edx, dword [edi]
mov eax, dword [edx + 0x10]
push str.Cannot_connect__invalid_socket.
mov ecx, edi
call eax
lea ecx, [esp + 0x20]
mov dword [esp + 0x120], 0xffffffff
call fcn.00451e70
xor al, al
mov ecx, dword [esp + 0x118]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x100]
xor ecx, esp
call fcn.004d99c4
add esp, 0x110
ret 0x10