Function at 0x481680
Capabilities:
Check for time delay via gettickcount
Connect socket
Set socket configuration

Disassembly:
push 0xffffffffffffffff
push 0x4f8160
mov eax, dword fs:[0]
push eax
sub esp, 0x68
mov eax, dword [0x5e4ce0]
xor eax, esp
mov dword [esp + 0x64], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x5e4ce0]
xor eax, esp
push eax
lea eax, [esp + 0x7c]
mov dword fs:[0], eax
mov eax, dword [esp + 0xa0]
mov ebp, dword [esp + 0x8c]
mov edi, dword [esp + 0x9c]
mov esi, ecx
mov ecx, dword [esp + 0xa4]
mov dword [esp + 0x28], ecx
xor ebx, ebx
lea ecx, [esi + 0x74]
mov dword [esp + 0x20], eax
mov dword [esi + 0x90], ebx
call fcn.00451240
cmp dword [esp + 0x28], ebx
je 0x481b8c
cmp dword [esp + 0x94], ebx
je 0x481b8c
cmp ebp, ebx
mov edx, dword [esp + 0x20]
mov byte [edx], bl
jne 0x481728
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
xor al, al
jmp 0x481ba2
push ebp
lea ecx, [esp + 0x34]
call fcn.00451b50
lea ecx, [esp + 0x30]
mov dword [esp + 0x84], ebx
call fcn.00451070
lea ecx, [esp + 0x30]
call fcn.004c49f0
test eax, eax
jne 0x481782
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
lea ecx, [esp + 0x30]
mov dword [esp + 0x84], 0xffffffff
call fcn.00451e70
xor al, al
jmp 0x481ba2
push str.localhost
lea ecx, [esp + 0x34]
call fcn.00452eb0
test al, al
je 0x4817ba
push str.127.0.0.1
lea ecx, [esi + 0x74]
call fcn.00452a60
push str.127.0.0.1
lea ecx, [esp + 0x34]
call fcn.00452a60
lea ecx, [esp + 0x30]
call fcn.004c06c0
mov ebp, eax
cmp byte [0x5ddcf4], bl
je 0x4817cb
push edi
call fcn.0047f6c0
add esp, 4
xor eax, eax
mov dword [esp + 0x68], eax
mov dword [esp + 0x6c], eax
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], eax
mov eax, dword [esp + 0x90]
push eax
mov word [esp + 0x6c], 2
call dword [sym.imp.WS2_32.dll_htons]
push ebp
mov word [esp + 0x6e], ax
call dword [sym.imp.WS2_32.dll_inet_addr]
lea ecx, [esp + 0x4c]
mov dword [esp + 0x6c], eax
call fcn.00451c20
cmp dword [esp + 0x6c], 0xffffffff
mov ecx, dword [esi + 0x6c]
mov byte [esp + 0x84], 1
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x1c], ecx
jne 0x48198e
mov byte [esp + 0x16], bl
mov byte [esp + 0x15], bl
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esp + 0x24], eax
lea edx, [esp + 0x15]
push edx
lea eax, [esp + 0x1a]
push eax
mov eax, dword [esp + 0x30]
lea ecx, [esp + 0x34]
push ecx
mov ecx, dword [esp + 0xa0]
lea edx, [esp + 0x58]
push edx
mov edx, dword [esi + 0x6c]
push eax
mov eax, dword [esi + 0x50]
push edi
push ecx
push edx
push ebx
push eax
push ebp
call fcn.0047fe90
add esp, 0x2c
lea ecx, [esp + 0x4c]
push ecx
lea ecx, [esi + 0x74]
mov byte [esp + 0x1b], al
call fcn.00452b00
cmp byte [esp + 0x17], bl
je 0x48191e
lea ecx, [esp + 0x4c]
call fcn.004c49f0
test eax, eax
je 0x48191e
mov eax, dword [esp + 0x2c]
cmp eax, ebx
je 0x4818ff
mov ebp, dword [esp + 0x1c]
cmp ebp, ebx
mov dword [esp + 0x6c], eax
je 0x48199b
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [esp + 0x24]
cmp eax, ecx
jbe 0x48199b
sub eax, ecx
cmp eax, ebp
jb 0x4818f8
mov dword [esi + 0x90], 3
push str.Application_timeout_after_DNS
mov edx, dword [edi]
mov eax, dword [edx + 0x10]
mov ecx, edi
call eax
lea ecx, [esp + 0x4c]
mov byte [esp + 0x84], bl
call fcn.00451e70
jmp 0x481767
sub ebp, eax
jmp 0x48199b
lea ecx, [esp + 0x4c]
mov dword [esi + 0x90], 2
mov byte [esp + 0x84], bl
call fcn.00451e70
jmp 0x481767
mov ecx, dword [esp + 0x20]
mov byte [ecx], 1
mov edx, dword [edi]
mov eax, dword [edx + 0x10]
push str.Cannot_get_host_by_name.
mov ecx, edi
call eax
mov edx, dword [edi]
mov eax, dword [edx + 0x28]
push ebp
push str.hostname
mov ecx, edi
call eax
cmp byte [esp + 0x16], bl
je 0x481967
lea ecx, [esp + 0x4c]
mov dword [esi + 0x90], 4
mov byte [esp + 0x84], bl
call fcn.00451e70
jmp 0x481767
xor ecx, ecx
cmp byte [esp + 0x15], bl
mov byte [esp + 0x84], bl
setne cl
add ecx, 2
mov dword [esi + 0x90], ecx
lea ecx, [esp + 0x4c]
call fcn.00451e70
jmp 0x481767
push ebp
lea ecx, [esi + 0x74]
call fcn.00452a60
mov ebp, dword [esp + 0x1c]
push edi
mov ecx, esi
call fcn.00481170
cmp al, bl
je 0x481b78
mov eax, dword [esi + 0x4c]
cmp eax, 0xffffffff
je 0x481b78
cmp ebp, ebx
mov dword [esp + 0x18], 1
je 0x4819d4
lea edx, [esp + 0x18]
push edx
push 0x8004667e
push eax
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov ecx, dword [esi + 0x4c]
push 0x10
lea eax, [esp + 0x6c]
push eax
push ecx
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, ebx
mov dword [esp + 0x1c], eax
je 0x481af6
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
mov dword [esp + 0x24], eax
je 0x481a15
mov edx, dword [edi]
push eax
mov eax, dword [edx + 0x2c]
push str.sockError
mov ecx, edi
call eax
mov eax, dword [esp + 0x24]
cmp ebp, ebx
je 0x481b12
cmp eax, 0x2733
jne 0x481af6
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x98]
lea ecx, [esp + 0x15]
push ecx
mov ecx, dword [esp + 0x98]
push edx
push edi
push ebp
push eax
push ecx
mov ecx, esi
mov byte [esp + 0x2d], bl
call fcn.00480470
test al, al
je 0x481aa2
mov eax, dword [esi + 0x4c]
lea edx, [esp + 0x18]
push edx
push 0x8004667e
push eax
mov dword [esp + 0x24], ebx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
lea ecx, [esi + 0x54]
mov byte [esi + 0x48], 1
call fcn.004b21e0
lea ecx, [esp + 0x4c]
mov byte [esp + 0x84], bl
call fcn.00451e70
lea ecx, [esp + 0x30]
mov dword [esp + 0x84], 0xffffffff
call fcn.00451e70
mov al, 1
jmp 0x481ba2
cmp byte [esp + 0x15], bl
je 0x481adf
mov edx, dword [esi + 0x4c]
lea ecx, [esp + 0x18]
push ecx
push 0x8004667e
push edx
mov dword [esp + 0x24], ebx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
lea ecx, [esp + 0x4c]
mov dword [esi + 0x90], 4
mov byte [esp + 0x84], bl
call fcn.00451e70
jmp 0x481767
push edi
push 0x2733
mov ecx, esi
mov dword [esi + 0x90], 6
call fcn.0047f990
cmp ebp, ebx
je 0x481b12
mov ecx, dword [esi + 0x4c]
lea eax, [esp + 0x18]
push eax
push 0x8004667e
push ecx
mov dword [esp + 0x24], ebx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
cmp dword [esp + 0x1c], ebx
jne 0x481b5c
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
lea ecx, [esp + 0x4c]
mov byte [esp + 0x84], bl
call fcn.00451e70
lea ecx, [esp + 0x30]
mov dword [esp + 0x84], 0xffffffff
call fcn.00451e70
mov al, 1
jmp 0x481ba2
cmp dword [esi + 0x90], ebx
jne 0x481b6e
mov dword [esi + 0x90], 7
push str.Connect_function_failed
jmp 0x4818da
mov dword [esi + 0x90], 5
push str.Cannot_connect__invalid_socket.
jmp 0x4818da
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x90]
push ecx
push edi
push edx
push ebp
mov ecx, esi
call fcn.004812b0
mov ecx, dword [esp + 0x7c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x64]
xor ecx, esp
call fcn.004d99c4
add esp, 0x74
ret 0x1c