Function at 0x140015640
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 0x140015684
xor eax, eax
jmp 0x140015c99
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 0x1400156a7
jmp 0x140015c7c
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 0x1400156cb
jmp 0x140015c71
movzx eax, byte [rsp + 0x1b0]
test eax, eax
jne 0x1400158ee
movzx eax, byte [rsp + 0x198]
test eax, eax
jne 0x1400156f4
mov eax, dword [rsp + 0x1a0]
mov dword [rsp + 0x40], eax
jmp 0x140015746
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 0x140015746
mov rcx, qword [rsp + 0x1a0]
call qword [sym.imp.WS2_32.dll_gethostbyname]
mov qword [rsp + 0x58], rax
cmp qword [rsp + 0x58], 0
je 0x14001573c
mov rax, qword [rsp + 0x58]
mov rax, qword [rax + 0x18]
mov rax, qword [rax]
mov eax, dword [rax]
mov dword [rsp + 0x40], eax
jmp 0x140015746
jmp 0x140015c71
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 0x1400158e9
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x1400158e9
mov dword [rsp + 0x70], 1
mov rax, qword [rsp + 0x30]
mov qword [rsp + 0x60], rax
cmp qword [rsp + 0x190], 0
je 0x1400157cf
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 0x140015819
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 0x140015c99
cmp dword [rsp + 0x74], 0x102
jne 0x140015840
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 0x140015c99
cmp dword [rsp + 0x74], 0
jne 0x1400158c5
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 0x14001587d
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 0x140015c99
mov eax, dword [rsp + 0x78]
and eax, 0x20
test eax, eax
je 0x1400158a5
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 0x140015c99
mov eax, dword [rsp + 0x78]
and eax, 0x10
test eax, eax
je 0x1400158c5
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.WS2_32.dll_WSACloseEvent]
mov rax, qword [rsp + 0x38]
jmp 0x140015c99
cmp dword [rsp + 0x74], 1
jne 0x1400158e9
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 0x140015c99
jmp 0x140015c71
mov dword [rsp + 0xac], 0
movzx eax, byte [rsp + 0x1b8]
test eax, eax
jne 0x140015915
mov eax, dword [rsp + 0x1c0]
mov dword [rsp + 0xa8], eax
jmp 0x140015979
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 0x140015979
mov rcx, qword [rsp + 0x1c0]
call qword [sym.imp.WS2_32.dll_gethostbyname]
mov qword [rsp + 0xc0], rax
cmp qword [rsp + 0xc0], 0
je 0x14001596f
mov rax, qword [rsp + 0xc0]
mov rax, qword [rax + 0x18]
mov rax, qword [rax]
mov eax, dword [rax]
mov dword [rsp + 0xa8], eax
jmp 0x140015979
jmp 0x140015c71
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 0x140015c71
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x140015c71
mov dword [rsp + 0xd8], 1
mov rax, qword [rsp + 0x30]
mov qword [rsp + 0xc8], rax
cmp qword [rsp + 0x190], 0
je 0x140015a20
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 0x140015a70
cmp dword [rsp + 0xdc], 0x102
je 0x140015a70
cmp dword [rsp + 0xdc], 1
jne 0x140015a8d
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 0x140015c99
cmp dword [rsp + 0xdc], 0
jne 0x140015c71
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 0x140015ad4
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 0x140015c99
cmp dword [rsp + 0xe0], 0x10
je 0x140015afb
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 0x140015c99
movzx eax, byte [rsp + 0x198]
test eax, eax
jne 0x140015b22
mov dword [rsp + 0xac], 1
mov eax, dword [rsp + 0x1a0]
mov dword [rsp + 0x110], eax
jmp 0x140015b59
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 0x140015b4e
mov dword [rsp + 0xac], 2
jmp 0x140015b59
mov dword [rsp + 0xac], 1
cmp dword [rsp + 0xac], 1
jne 0x140015bea
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.140015cb0
movzx eax, al
cmp eax, 1
jne 0x140015be5
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rsp + 0x38]
jmp 0x140015c99
jmp 0x140015c71
cmp dword [rsp + 0xac], 2
jne 0x140015c71
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.140015e40
movzx eax, al
cmp eax, 1
jne 0x140015c71
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rsp + 0x38]
jmp 0x140015c99
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