Function at 0x140016c70
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Resolve dns

Disassembly:
mov dword [rsp + 0x20], r9d
mov qword [rsp + 0x18], r8
mov byte [rsp + 0x10], dl
mov qword [rsp + 8], rcx
sub rsp, 0x188
mov r8d, 6
mov edx, 1
mov ecx, 2
call qword [sym.imp.WS2_32.dll_socket]
mov qword [rsp + 0x38], rax
cmp qword [rsp + 0x38], 0xffffffffffffffff
jne 0x140016cb4
xor eax, eax
jmp 0x1400172c9
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
call qword [sym.imp.WS2_32.dll_WSACreateEvent]
mov qword [rsp + 0x30], rax
cmp qword [rsp + 0x30], 0
jne 0x140016cd7
jmp 0x1400172ac
mov r8d, gethostbyname
mov rdx, qword [rsp + 0x30]
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.WS2_32.dll_WSAEventSelect]
test eax, eax
je 0x140016cfb
jmp 0x1400172a1
movzx eax, byte [rsp + 0x1b0]
test eax, eax
jne 0x140016f1e
movzx eax, byte [rsp + 0x198]
test eax, eax
jne 0x140016d24
mov eax, dword [rsp + 0x1a0]
mov dword [rsp + 0x40], eax
jmp 0x140016d76
mov rcx, qword [rsp + 0x1a0]
call qword [sym.imp.WS2_32.dll_inet_addr]
mov dword [rsp + 0x40], eax
cmp dword [rsp + 0x40], 0xffffffff
jne 0x140016d76
mov rcx, qword [rsp + 0x1a0]
call qword [sym.imp.WS2_32.dll_gethostbyname]
mov qword [rsp + 0x58], rax
cmp qword [rsp + 0x58], 0
je 0x140016d6c
mov rax, qword [rsp + 0x58]
mov rax, qword [rax + 0x18]
mov rax, qword [rax]
mov eax, dword [rax]
mov dword [rsp + 0x40], eax
jmp 0x140016d76
jmp 0x1400172a1
mov eax, 2
mov word [rsp + 0x48], ax
movzx ecx, word [rsp + 0x1a8]
call qword [sym.imp.WS2_32.dll_htons]
mov word [rsp + 0x4a], ax
mov eax, dword [rsp + 0x40]
mov dword [rsp + 0x4c], eax
mov r8d, reloc.WS2_32.dll_recv
lea rdx, [rsp + 0x48]
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x140016f19
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x140016f19
mov dword [rsp + 0x70], 1
mov rax, qword [rsp + 0x30]
mov qword [rsp + 0x60], rax
cmp qword [rsp + 0x190], 0
je 0x140016dff
mov rax, qword [rsp + 0x190]
mov qword [rsp + 0x68], rax
mov eax, dword [rsp + 0x70]
inc eax
mov dword [rsp + 0x70], eax
mov dword [rsp + 0x20], 0
mov r9d, dword [rsp + 0x1d0]
xor r8d, r8d
lea rdx, [rsp + 0x60]
mov ecx, dword [rsp + 0x70]
call qword [sym.imp.WS2_32.dll_WSAWaitForMultipleEvents]
mov dword [rsp + 0x74], eax
cmp dword [rsp + 0x74], 0xffffffff
jne 0x140016e49
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.WS2_32.dll_WSACloseEvent]
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x1400172c9
cmp dword [rsp + 0x74], 0x102
jne 0x140016e70
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.WS2_32.dll_WSACloseEvent]
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x1400172c9
cmp dword [rsp + 0x74], 0
jne 0x140016ef5
lea r8, [rsp + 0x78]
mov rdx, qword [rsp + 0x30]
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.WS2_32.dll_WSAEnumNetworkEvents]
test eax, eax
je 0x140016ead
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.WS2_32.dll_closesocket]
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.WS2_32.dll_WSACloseEvent]
xor eax, eax
jmp 0x1400172c9
mov eax, dword [rsp + 0x78]
and eax, 0x20
test eax, eax
je 0x140016ed5
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.WS2_32.dll_closesocket]
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.WS2_32.dll_WSACloseEvent]
xor eax, eax
jmp 0x1400172c9
mov eax, dword [rsp + 0x78]
and eax, 0x10
test eax, eax
je 0x140016ef5
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.WS2_32.dll_WSACloseEvent]
mov rax, qword [rsp + 0x38]
jmp 0x1400172c9
cmp dword [rsp + 0x74], 1
jne 0x140016f19
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.WS2_32.dll_closesocket]
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.WS2_32.dll_WSACloseEvent]
xor eax, eax
jmp 0x1400172c9
jmp 0x1400172a1
mov dword [rsp + 0xac], 0
movzx eax, byte [rsp + 0x1b8]
test eax, eax
jne 0x140016f45
mov eax, dword [rsp + 0x1c0]
mov dword [rsp + 0xa8], eax
jmp 0x140016fa9
mov rcx, qword [rsp + 0x1c0]
call qword [sym.imp.WS2_32.dll_inet_addr]
mov dword [rsp + 0xa8], eax
cmp dword [rsp + 0xa8], 0xffffffff
jne 0x140016fa9
mov rcx, qword [rsp + 0x1c0]
call qword [sym.imp.WS2_32.dll_gethostbyname]
mov qword [rsp + 0xc0], rax
cmp qword [rsp + 0xc0], 0
je 0x140016f9f
mov rax, qword [rsp + 0xc0]
mov rax, qword [rax + 0x18]
mov rax, qword [rax]
mov eax, dword [rax]
mov dword [rsp + 0xa8], eax
jmp 0x140016fa9
jmp 0x1400172a1
mov eax, 2
mov word [rsp + 0xb0], ax
movzx ecx, word [rsp + 0x1c8]
call qword [sym.imp.WS2_32.dll_htons]
mov word [rsp + 0xb2], ax
mov eax, dword [rsp + 0xa8]
mov dword [rsp + 0xb4], eax
mov r8d, reloc.WS2_32.dll_recv
lea rdx, [rsp + 0xb0]
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x1400172a1
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x1400172a1
mov dword [rsp + 0xd8], 1
mov rax, qword [rsp + 0x30]
mov qword [rsp + 0xc8], rax
cmp qword [rsp + 0x190], 0
je 0x140017050
mov rax, qword [rsp + 0x190]
mov qword [rsp + 0xd0], rax
mov eax, dword [rsp + 0xd8]
inc eax
mov dword [rsp + 0xd8], eax
mov dword [rsp + 0x20], 0
mov r9d, dword [rsp + 0x1d0]
xor r8d, r8d
lea rdx, [rsp + 0xc8]
mov ecx, dword [rsp + 0xd8]
call qword [sym.imp.WS2_32.dll_WSAWaitForMultipleEvents]
mov dword [rsp + 0xdc], eax
cmp dword [rsp + 0xdc], 0xffffffff
je 0x1400170a0
cmp dword [rsp + 0xdc], 0x102
je 0x1400170a0
cmp dword [rsp + 0xdc], 1
jne 0x1400170bd
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.WS2_32.dll_WSACloseEvent]
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x1400172c9
cmp dword [rsp + 0xdc], 0
jne 0x1400172a1
lea r8, [rsp + 0xe0]
mov rdx, qword [rsp + 0x30]
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.WS2_32.dll_WSAEnumNetworkEvents]
test eax, eax
je 0x140017104
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.WS2_32.dll_WSACloseEvent]
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x1400172c9
cmp dword [rsp + 0xe0], 0x10
je 0x14001712b
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.WS2_32.dll_WSACloseEvent]
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x1400172c9
movzx eax, byte [rsp + 0x198]
test eax, eax
jne 0x140017152
mov dword [rsp + 0xac], 1
mov eax, dword [rsp + 0x1a0]
mov dword [rsp + 0x110], eax
jmp 0x140017189
mov rcx, qword [rsp + 0x1a0]
call qword [sym.imp.WS2_32.dll_inet_addr]
mov dword [rsp + 0x110], eax
cmp dword [rsp + 0x110], 0xffffffff
jne 0x14001717e
mov dword [rsp + 0xac], 2
jmp 0x140017189
mov dword [rsp + 0xac], 1
cmp dword [rsp + 0xac], 1
jne 0x14001721a
mov rax, qword [rsp + 0x38]
mov qword [rsp + 0x118], rax
mov rax, qword [rsp + 0x30]
mov qword [rsp + 0x120], rax
mov rax, qword [rsp + 0x190]
mov qword [rsp + 0x128], rax
mov eax, dword [rsp + 0x110]
mov dword [rsp + 0x130], eax
mov eax, dword [rsp + 0x1a8]
mov dword [rsp + 0x134], eax
mov eax, dword [rsp + 0x1d8]
mov dword [rsp + 0x138], eax
lea rcx, [rsp + 0x118]
call fcn.1400172e0
movzx eax, al
cmp eax, 1
jne 0x140017215
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rsp + 0x38]
jmp 0x1400172c9
jmp 0x1400172a1
cmp dword [rsp + 0xac], 2
jne 0x1400172a1
mov rax, qword [rsp + 0x38]
mov qword [rsp + 0x148], rax
mov rax, qword [rsp + 0x30]
mov qword [rsp + 0x150], rax
mov rax, qword [rsp + 0x190]
mov qword [rsp + 0x158], rax
mov rax, qword [rsp + 0x1a0]
mov qword [rsp + 0x160], rax
mov eax, dword [rsp + 0x1a8]
mov dword [rsp + 0x168], eax
mov eax, dword [rsp + 0x1d8]
mov dword [rsp + 0x16c], eax
lea rcx, [rsp + 0x148]
call fcn.140017470
movzx eax, al
cmp eax, 1
jne 0x1400172a1
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rsp + 0x38]
jmp 0x1400172c9
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, 2
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.WS2_32.dll_shutdown]
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
add rsp, 0x188
ret