Function at 0x5a9f30
Capabilities:
Check for time delay via gettickcount
Connect socket

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x6407b3
mov eax, dword fs:[0]
push eax
sub esp, 0x8c
mov eax, dword [0x703eb0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0x1c]
mov ebx, dword [ebp + 8]
mov esi, dword [ebp + 0x18]
mov edi, ecx
mov ecx, dword [ebp + 0x20]
mov dword [ebp - 0x40], ecx
lea ecx, [edi + 0x128]
mov dword [ebp - 0x38], ebx
mov dword [ebp - 0x34], eax
mov dword [edi + 0x150], 0
call fcn.0053aff0
mov eax, dword [ebp - 0x40]
test eax, eax
je 0x5aa50a
cmp dword [ebp + 0x10], 0
je 0x5aa50a
mov edx, dword [ebp - 0x34]
mov byte [edx], 0
test ebx, ebx
jne 0x5a9fc8
mov dword [edi + 0x150], 1
mov eax, dword [esi]
mov edx, dword [eax + 0x10]
push str.Cannot_connect__hostname_is_NULL
mov ecx, esi
call edx
xor al, al
jmp 0x5aa51c
push ebx
lea ecx, [ebp - 0x70]
call fcn.0053b950
lea ecx, [ebp - 0x70]
mov dword [ebp - 4], 0
call fcn.0053ad90
lea ecx, [ebp - 0x70]
call fcn.0053acf0
test eax, eax
jne 0x5aa01a
mov dword [edi + 0x150], 1
mov eax, dword [esi]
mov edx, dword [eax + 0x10]
push str.Cannot_connect__hostname_is_zero_length
mov ecx, esi
call edx
lea ecx, [ebp - 0x70]
mov dword [ebp - 4], 0xffffffff
call fcn.0053bcf0
xor al, al
jmp 0x5aa51c
push str.localhost
lea ecx, [ebp - 0x70]
call fcn.0053d010
test al, al
je 0x5aa055
push str.127.0.0.1
lea ecx, [edi + 0x128]
call fcn.0053cb20
push str.127.0.0.1
lea ecx, [ebp - 0x70]
call fcn.0053cb20
lea ecx, [ebp - 0x70]
call fcn.00595640
mov dword [ebp - 0x38], eax
mov ebx, eax
cmp byte [0x711614], 0
je 0x5aa065
mov ecx, esi
call fcn.005a5100
mov ecx, dword [ebp + 0xc]
xor eax, eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], eax
mov eax, 2
push ecx
mov word [ebp - 0x20], ax
call dword [sym.imp.WS2_32.dll_htons]
push ebx
mov word [ebp - 0x1e], ax
call dword [sym.imp.WS2_32.dll_inet_addr]
lea ecx, [ebp - 0x98]
mov dword [ebp - 0x1c], eax
call fcn.0053ba20
cmp dword [ebp - 0x1c], 0xffffffff
mov edx, dword [edi + 0x11c]
mov byte [ebp - 4], 1
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x28], edx
jne 0x5aa216
mov byte [ebp - 0x21], 0
mov byte [ebp - 0x22], 0
call sub.KERNEL32.dll_GetTickCount
mov ecx, dword [edi + 0xac]
lea edx, [ebp - 0x22]
push edx
lea edx, [ebp - 0x21]
push edx
lea edx, [ebp - 0x3c]
push edx
lea edx, [ebp - 0x98]
push edx
mov edx, dword [ebp - 0x40]
push edx
mov edx, dword [ebp + 0x10]
push esi
push edx
mov dword [ebp - 0x2c], eax
mov eax, dword [edi + 0x11c]
push eax
push 0
push ecx
push ebx
call fcn.005a5940
mov byte [ebp - 0x23], al
add esp, 0x2c
lea eax, [ebp - 0x98]
push eax
lea ecx, [edi + 0x128]
call fcn.0053cbf0
cmp byte [ebp - 0x23], 0
je 0x5aa1ac
lea ecx, [ebp - 0x98]
call fcn.0053acf0
test eax, eax
je 0x5aa1ac
mov eax, dword [ebp - 0x3c]
test eax, eax
je 0x5aa18e
mov ebx, dword [ebp - 0x28]
mov dword [ebp - 0x1c], eax
test ebx, ebx
je 0x5aa225
call sub.KERNEL32.dll_GetTickCount
mov ecx, dword [ebp - 0x2c]
cmp eax, ecx
jbe 0x5aa225
sub eax, ecx
cmp eax, ebx
jb 0x5aa187
mov dword [edi + 0x150], 3
mov edx, dword [esi]
mov eax, dword [edx + 0x10]
push str.Application_timeout_after_DNS
mov ecx, esi
call eax
lea ecx, [ebp - 0x98]
mov byte [ebp - 4], 0
call fcn.0053bcf0
jmp 0x5aa004
sub ebx, eax
jmp 0x5aa225
lea ecx, [ebp - 0x98]
mov dword [edi + 0x150], 2
mov byte [ebp - 4], 0
call fcn.0053bcf0
jmp 0x5aa004
mov ecx, dword [ebp - 0x34]
mov byte [ecx], 1
mov edx, dword [esi]
mov eax, dword [edx + 0x10]
push str.Cannot_get_host_by_name.
mov ecx, esi
call eax
push ebx
push str.hostname
mov ecx, esi
call fcn.00561de0
cmp byte [ebp - 0x21], 0
je 0x5aa1f1
lea ecx, [ebp - 0x98]
mov dword [edi + 0x150], 4
mov byte [ebp - 4], 0
call fcn.0053bcf0
jmp 0x5aa004
xor ecx, ecx
cmp byte [ebp - 0x22], cl
mov byte [ebp - 4], 0
setne cl
add ecx, 2
mov dword [edi + 0x150], ecx
lea ecx, [ebp - 0x98]
call fcn.0053bcf0
jmp 0x5aa004
push ebx
lea ecx, [edi + 0x128]
call fcn.0053cb20
mov ebx, dword [ebp - 0x28]
push 1
push esi
mov ecx, edi
call fcn.005a8db0
test al, al
je 0x5aa4de
cmp dword [edi + 0xa4], 0xffffffff
je 0x5aa4de
test ebx, ebx
je 0x5aa24f
mov ecx, edi
call fcn.005a5360
mov ebx, dword [edi + 0x11c]
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x34], 0
mov byte [ebp - 0x21], 0
mov dword [ebp - 0x2c], 0x64
lea ebx, [ebx]
call sub.KERNEL32.dll_GetTickCount
cmp dword [ebp - 0x34], 0
mov dword [ebp - 0x48], eax
je 0x5aa29d
mov eax, dword [ebp - 0x2c]
cmp ebx, eax
jb 0x5aa28f
sub ebx, eax
mov dword [ebp - 0x28], ebx
cmp ebx, 0x64
jae 0x5aa29d
mov dword [ebp - 0x28], 0x64
mov ebx, dword [ebp - 0x28]
mov byte [ebp - 0x21], 1
mov eax, dword [edi + 0xa4]
push 0x10
lea edx, [ebp - 0x20]
push edx
push eax
call dword [sym.imp.WS2_32.dll_connect]
mov dword [ebp - 0x44], eax
test eax, eax
je 0x5aa48c
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0x2c], eax
cmp eax, 0x2733
je 0x5aa33d
cmp eax, 0x2726
jne 0x5aa32b
mov ebx, dword [esi]
lea ecx, [ebp - 0x98]
call fcn.00595640
mov edx, dword [ebx + 0x28]
push eax
push str.IP_Address
mov ecx, esi
call edx
mov ecx, dword [ebp - 0x3c]
mov eax, dword [esi]
mov edx, dword [eax + 0x34]
push ecx
push str.ipAddr
mov ecx, esi
call edx
mov ecx, dword [ebp - 0x38]
mov eax, dword [esi]
mov edx, dword [eax + 0x28]
push ecx
push str.Hostname
mov ecx, esi
call edx
mov ecx, dword [edi + 0xa4]
mov eax, dword [esi]
mov edx, dword [eax + 0x34]
push ecx
push str.SocketHandle
mov ecx, esi
call edx
mov ebx, dword [ebp - 0x28]
mov eax, dword [ebp - 0x2c]
mov edx, dword [esi]
push eax
mov eax, dword [edx + 0x2c]
push str.sockError
mov ecx, esi
call eax
mov eax, dword [ebp - 0x2c]
test ebx, ebx
je 0x5aa497
cmp eax, 0x2733
jne 0x5aa48c
lea ecx, [ebp - 0x23]
push ecx
lea edx, [ebp - 0x2e]
push edx
mov edx, dword [ebp - 0x40]
lea eax, [ebp - 0x22]
push eax
mov eax, dword [ebp + 0x14]
lea ecx, [ebp - 0x2d]
push ecx
mov ecx, dword [ebp + 0x10]
push edx
push esi
push 1
push ebx
push eax
push ecx
mov ecx, edi
mov byte [ebp - 0x22], 0
mov byte [ebp - 0x2e], 0
mov byte [ebp - 0x23], 0
mov byte [ebp - 0x2d], 0
call fcn.005a6080
test al, al
jne 0x5aa3fc
cmp byte [ebp - 0x22], al
jne 0x5aa43a
cmp byte [ebp - 0x21], al
jne 0x5aa45f
call sub.KERNEL32.dll_GetTickCount
mov edx, dword [ebp - 0x48]
mov ecx, 0x64
cmp eax, edx
jbe 0x5aa3b2
sub eax, edx
mov ecx, eax
cmp ebx, ecx
jbe 0x5aa48c
sub ebx, ecx
mov dword [ebp - 0x28], ebx
cmp ebx, 0x3e8
jbe 0x5aa3e3
push 0x3e8
mov dword [ebp - 0x2c], 0x3e8
call fcn.00550010
add esp, 4
inc dword [ebp - 0x34]
jmp 0x5aa270
push 0x64
mov dword [ebp - 0x2c], 0x64
call fcn.00550010
add esp, 4
inc dword [ebp - 0x34]
jmp 0x5aa270
mov ecx, edi
call fcn.005a5390
lea ecx, [edi + 0xb0]
mov byte [edi + 0xa0], 1
call fcn.005f4120
lea ecx, [ebp - 0x98]
mov byte [ebp - 4], 0
call fcn.0053bcf0
lea ecx, [ebp - 0x70]
mov dword [ebp - 4], 0xffffffff
call fcn.0053bcf0
mov al, 1
jmp 0x5aa51c
mov ecx, edi
call fcn.005a5390
lea ecx, [ebp - 0x98]
mov dword [edi + 0x150], 4
mov byte [ebp - 4], 0
call fcn.0053bcf0
jmp 0x5aa004
mov eax, dword [edi + 0x11c]
mov dword [edi + 0x150], 6
mov edx, dword [esi]
mov edx, dword [edx + 0x2c]
push eax
push str.ConnectTimeoutMs
mov ecx, esi
call edx
push esi
push 0x2733
call fcn.005a5550
add esp, 8
test ebx, ebx
je 0x5aa497
mov ecx, edi
call fcn.005a5390
cmp dword [ebp - 0x44], 0
jne 0x5aa4c4
lea ecx, [edi + 0xb0]
mov byte [edi + 0xa0], 1
call fcn.005f4120
lea ecx, [edi + 0x10]
call fcn.005ab280
lea ecx, [edi + 0x58]
call fcn.005ab280
jmp 0x5aa415
cmp dword [edi + 0x150], 0
jne 0x5aa4d7
mov dword [edi + 0x150], 7
push str.Connect_function_failed
jmp 0x5aa4ed
mov dword [edi + 0x150], 5
push str.Cannot_connect__invalid_socket__3_
mov eax, dword [esi]
mov edx, dword [eax + 0x10]
mov ecx, esi
call edx
lea ecx, [ebp - 0x98]
mov byte [ebp - 4], 0
call fcn.0053bcf0
jmp 0x5aa004
mov ecx, dword [ebp - 0x34]
mov edx, dword [ebp + 0xc]
push ecx
push eax
push esi
push edx
push ebx
mov ecx, edi
call fcn.005a91b0
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00521602
mov esp, ebp
pop ebp
ret 0x1c