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

Disassembly:
mov eax, 0x5ae158
call fcn.00591b5c
sub esp, 0x88
mov eax, dword [0x6c0bc0]
xor eax, dword [ebp + 4]
mov dword [ebp - 0x64], eax
mov dword [ebp - 0x94], ecx
mov eax, dword [ebp - 0x94]
and dword [eax + 0xe0], 0
mov ecx, dword [ebp - 0x94]
add ecx, 0xc4
call fcn.004cd0cb
cmp dword [ebp + 0x20], 0
je 0x515fda
cmp dword [ebp + 0x10], 0
jne 0x515ff6
push dword [ebp + 0x1c]
push dword [ebp + 0x18]
push dword [ebp + 0xc]
push dword [ebp + 8]
mov ecx, dword [ebp - 0x94]
call fcn.00515877
jmp 0x516614
mov eax, dword [ebp + 0x1c]
and byte [eax], 0
cmp dword [ebp + 8], 0
jne 0x516029
mov eax, dword [ebp - 0x94]
mov dword [eax + 0xe0], 1
push str.Cannot_connect__hostname_is_NULL
mov eax, dword [ebp + 0x18]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x18]
call dword [eax + 0x10]
xor al, al
jmp 0x516614
push dword [ebp + 8]
lea ecx, [ebp - 0x58]
call fcn.004cdd83
and dword [ebp - 4], 0
lea ecx, [ebp - 0x58]
call fcn.004ccd7e
lea ecx, [ebp - 0x58]
call fcn.004ccbf8
test eax, eax
jne 0x51608a
mov eax, dword [ebp - 0x94]
mov dword [eax + 0xe0], 1
push str.Cannot_connect__hostname_is_zero_length
mov eax, dword [ebp + 0x18]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x18]
call dword [eax + 0x10]
and byte [ebp - 0x86], 0
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x58]
call fcn.004ce1b7
mov al, byte [ebp - 0x86]
jmp 0x516614
push str.localhost
lea ecx, [ebp - 0x58]
call fcn.004cffb2
movzx eax, al
test eax, eax
je 0x5160cc
push str.127.0.0.1
mov ecx, dword [ebp - 0x94]
add ecx, 0xc4
call fcn.004cf872
push str.127.0.0.1
lea ecx, [ebp - 0x58]
call fcn.004cf872
lea ecx, [ebp - 0x58]
call fcn.0055420c
mov dword [ebp + 8], eax
movzx eax, byte [0x671264]
test eax, eax
je 0x5160e0
push dword [ebp + 0x18]
call fcn.005148d2
pop ecx
push 0x10
push 0
lea eax, [ebp - 0x74]
push eax
call fcn.0058ee10
add esp, 0xc
mov word [ebp - 0x74], 2
push dword [ebp + 0xc]
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x72], ax
push dword [ebp + 8]
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [ebp - 0x70], eax
and byte [ebp - 0x39], 0
lea ecx, [ebp - 0x28]
call fcn.004cde9c
mov byte [ebp - 4], 1
and dword [ebp - 0x2c], 0
mov eax, dword [ebp - 0x94]
mov eax, dword [eax + 0xbc]
mov dword [ebp - 0x60], eax
cmp dword [ebp - 0x70], 0xffffffff
jne 0x51631e
and byte [ebp - 0x79], 0
and byte [ebp - 0x7a], 0
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x78], eax
lea eax, [ebp - 0x7a]
push eax
lea eax, [ebp - 0x79]
push eax
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x28]
push eax
push dword [ebp + 0x20]
push dword [ebp + 0x18]
push dword [ebp + 0x10]
mov eax, dword [ebp - 0x94]
push dword [eax + 0xbc]
push 0
mov eax, dword [ebp - 0x94]
push dword [eax + 0x50]
push dword [ebp + 8]
call fcn.0051531e
add esp, 0x2c
mov byte [ebp - 0x39], al
lea eax, [ebp - 0x28]
push eax
mov ecx, dword [ebp - 0x94]
add ecx, 0xc4
call fcn.004cf8e2
movzx eax, byte [ebp - 0x39]
test eax, eax
je 0x516201
lea ecx, [ebp - 0x28]
call fcn.004ccbf8
test eax, eax
je 0x516201
cmp dword [ebp - 0x2c], 0
je 0x5161c2
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x70], eax
jmp 0x5161fc
mov eax, dword [ebp - 0x94]
mov dword [eax + 0xe0], 2
and byte [ebp - 0x87], 0
and byte [ebp - 4], 0
lea ecx, [ebp - 0x28]
call fcn.004ce1b7
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x58]
call fcn.004ce1b7
mov al, byte [ebp - 0x87]
jmp 0x516614
jmp 0x516298
mov eax, dword [ebp + 0x1c]
mov byte [eax], 1
push str.Cannot_get_host_by_name.
mov eax, dword [ebp + 0x18]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x18]
call dword [eax + 0x10]
push dword [ebp + 8]
push str.hostname
mov eax, dword [ebp + 0x18]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x18]
call dword [eax + 0x28]
movzx eax, byte [ebp - 0x79]
test eax, eax
je 0x516244
mov eax, dword [ebp - 0x94]
mov dword [eax + 0xe0], 4
jmp 0x51626e
movzx eax, byte [ebp - 0x7a]
test eax, eax
je 0x51625e
mov eax, dword [ebp - 0x94]
mov dword [eax + 0xe0], 3
jmp 0x51626e
mov eax, dword [ebp - 0x94]
mov dword [eax + 0xe0], 2
and byte [ebp - 0x88], 0
and byte [ebp - 4], 0
lea ecx, [ebp - 0x28]
call fcn.004ce1b7
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x58]
call fcn.004ce1b7
mov al, byte [ebp - 0x88]
jmp 0x516614
cmp dword [ebp - 0x60], 0
je 0x51631c
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x80], eax
mov eax, dword [ebp - 0x80]
cmp eax, dword [ebp - 0x78]
jbe 0x51631c
mov eax, dword [ebp - 0x80]
sub eax, dword [ebp - 0x78]
mov dword [ebp - 0x84], eax
mov eax, dword [ebp - 0x84]
cmp eax, dword [ebp - 0x60]
jb 0x516310
mov eax, dword [ebp - 0x94]
mov dword [eax + 0xe0], 3
push str.Application_timeout_after_DNS
mov eax, dword [ebp + 0x18]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x18]
call dword [eax + 0x10]
and byte [ebp - 0x89], 0
and byte [ebp - 4], 0
lea ecx, [ebp - 0x28]
call fcn.004ce1b7
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x58]
call fcn.004ce1b7
mov al, byte [ebp - 0x89]
jmp 0x516614
mov eax, dword [ebp - 0x60]
sub eax, dword [ebp - 0x84]
mov dword [ebp - 0x60], eax
jmp 0x516332
push dword [ebp + 8]
mov ecx, dword [ebp - 0x94]
add ecx, 0xc4
call fcn.004cf872
push dword [ebp + 0x18]
mov ecx, dword [ebp - 0x94]
call fcn.00514bad
mov byte [ebp - 0x59], al
movzx eax, byte [ebp - 0x59]
test eax, eax
je 0x516357
mov eax, dword [ebp - 0x94]
cmp dword [eax + 0x4c], 0xffffffff
jne 0x5163a1
mov eax, dword [ebp - 0x94]
mov dword [eax + 0xe0], 5
push str.Cannot_connect__invalid_socket.
mov eax, dword [ebp + 0x18]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x18]
call dword [eax + 0x10]
and byte [ebp - 0x8a], 0
and byte [ebp - 4], 0
lea ecx, [ebp - 0x28]
call fcn.004ce1b7
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x58]
call fcn.004ce1b7
mov al, byte [ebp - 0x8a]
jmp 0x516614
mov dword [ebp - 0x38], 1
cmp dword [ebp - 0x60], 0
je 0x5163c6
lea eax, [ebp - 0x38]
push eax
push 0x8004667e
mov eax, dword [ebp - 0x94]
push dword [eax + 0x4c]
call dword [sym.imp.WS2_32.dll_ioctlsocket]
and dword [ebp - 0x30], 0
push 0x10
lea eax, [ebp - 0x74]
push eax
mov eax, dword [ebp - 0x94]
push dword [eax + 0x4c]
call dword [sym.imp.WS2_32.dll_connect]
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0
je 0x51640d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0x2733
je 0x51640d
push dword [ebp - 0x30]
push str.sockError
mov eax, dword [ebp + 0x18]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x18]
call dword [eax + 0x2c]
cmp dword [ebp - 0x34], 0
je 0x51653d
cmp dword [ebp - 0x60], 0
je 0x51653d
cmp dword [ebp - 0x30], 0x2733
jne 0x51653d
and byte [ebp - 0x85], 0
lea eax, [ebp - 0x85]
push eax
push dword [ebp + 0x20]
push dword [ebp + 0x18]
push dword [ebp - 0x60]
push dword [ebp + 0x14]
push dword [ebp + 0x10]
mov ecx, dword [ebp - 0x94]
call fcn.005168bb
movzx eax, al
test eax, eax
je 0x5164bb
and dword [ebp - 0x38], 0
lea eax, [ebp - 0x38]
push eax
push 0x8004667e
mov eax, dword [ebp - 0x94]
push dword [eax + 0x4c]
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov eax, dword [ebp - 0x94]
mov byte [eax + 0x48], 1
mov ecx, dword [ebp - 0x94]
add ecx, 0x54
call fcn.0053b764
mov byte [ebp - 0x8b], 1
and byte [ebp - 4], 0
lea ecx, [ebp - 0x28]
call fcn.004ce1b7
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x58]
call fcn.004ce1b7
mov al, byte [ebp - 0x8b]
jmp 0x516614
movzx eax, byte [ebp - 0x85]
test eax, eax
je 0x51651c
and dword [ebp - 0x38], 0
lea eax, [ebp - 0x38]
push eax
push 0x8004667e
mov eax, dword [ebp - 0x94]
push dword [eax + 0x4c]
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov eax, dword [ebp - 0x94]
mov dword [eax + 0xe0], 4
and byte [ebp - 0x8c], 0
and byte [ebp - 4], 0
lea ecx, [ebp - 0x28]
call fcn.004ce1b7
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x58]
call fcn.004ce1b7
mov al, byte [ebp - 0x8c]
jmp 0x516614
mov eax, dword [ebp - 0x94]
mov dword [eax + 0xe0], 6
push dword [ebp + 0x18]
push dword [ebp - 0x30]
mov ecx, dword [ebp - 0x94]
call fcn.00514f71
cmp dword [ebp - 0x60], 0
je 0x51655f
and dword [ebp - 0x38], 0
lea eax, [ebp - 0x38]
push eax
push 0x8004667e
mov eax, dword [ebp - 0x94]
push dword [eax + 0x4c]
call dword [sym.imp.WS2_32.dll_ioctlsocket]
cmp dword [ebp - 0x34], 0
jne 0x5165c0
mov eax, dword [ebp - 0x94]
mov byte [eax + 0x48], 1
mov ecx, dword [ebp - 0x94]
add ecx, 0x54
call fcn.0053b764
mov ecx, dword [ebp - 0x94]
add ecx, 8
call fcn.0053b784
mov ecx, dword [ebp - 0x94]
add ecx, 0x28
call fcn.0053b784
mov byte [ebp - 0x8d], 1
and byte [ebp - 4], 0
lea ecx, [ebp - 0x28]
call fcn.004ce1b7
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x58]
call fcn.004ce1b7
mov al, byte [ebp - 0x8d]
jmp 0x516614
mov eax, dword [ebp - 0x94]
cmp dword [eax + 0xe0], 0
jne 0x5165df
mov eax, dword [ebp - 0x94]
mov dword [eax + 0xe0], 7
push str.Connect_function_failed
mov eax, dword [ebp + 0x18]
mov eax, dword [eax]
mov ecx, dword [ebp + 0x18]
call dword [eax + 0x10]
and byte [ebp - 0x8e], 0
and byte [ebp - 4], 0
lea ecx, [ebp - 0x28]
call fcn.004ce1b7
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x58]
call fcn.004ce1b7
mov al, byte [ebp - 0x8e]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x64]
xor ecx, dword [ebp + 4]
call fcn.0058cc82
leave
ret 0x1c