Function at 0x401ea2
Capabilities:
Connect socket
Resolve dns
Set socket configuration

Disassembly:
push rbp
mov rbp, rsp
sub rsp, 0xa0
mov dword [rbp + 0x10], ecx
mov dword [rbp + 0x18], edx
mov qword [rbp + 0x20], r8
mov eax, r9d
mov word [rbp + 0x28], ax
mov rax, qword [rbp + 0x40]
mov dword [rax], 0
cmp qword [rbp + 0x38], 0
je 0x401ee6
mov rax, qword [rbp + 0x38]
mov r8d, 0x1c
mov edx, 0
mov rcx, rax
call sub.msvcrt.dll_memset
lea rax, [rbp - 0x60]
mov r8d, 0x30
mov edx, 0
mov rcx, rax
call sub.msvcrt.dll_memset
mov eax, dword [rbp + 0x18]
mov dword [rbp - 0x5c], eax
mov dword [rbp - 0x58], 1
movzx edx, word [rbp + 0x28]
lea rax, [rbp - 0x70]
mov r9d, edx
lea r8, [0x0040d15c]
mov edx, 7
mov rcx, rax
call fcn.00401ce3
mov qword [rbp - 0x68], 0
lea r8, [rbp - 0x68]
lea rcx, [rbp - 0x60]
lea rdx, [rbp - 0x70]
mov rax, qword [rbp + 0x20]
mov r9, r8
mov r8, rcx
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_getaddrinfo]
call rax
mov dword [rbp - 0x14], eax
cmp dword [rbp - 0x14], 0
je 0x401f6f
mov rax, qword [rbp + 0x40]
mov edx, dword [rbp - 0x14]
mov dword [rax], edx
mov eax, 0xffffffff
jmp 0x4022a8
mov dword [rbp - 0x14], 0xfffffffe
mov qword [rbp - 8], 0xffffffffffffffff
mov qword [rbp - 0x10], 0
mov rax, qword [rbp - 0x68]
mov qword [rbp - 0x20], rax
jmp 0x402237
cmp qword [rbp + 0x38], 0
je 0x401fb9
mov rax, qword [rbp - 0x20]
mov rcx, qword [rax + 0x10]
mov rax, qword [rbp - 0x20]
mov rdx, qword [rax + 0x20]
mov rax, qword [rbp + 0x38]
mov r8, rcx
mov rcx, rax
call sub.msvcrt.dll_memcpy
cmp dword [rbp + 0x10], 0
jne 0x401fcb
mov dword [rbp - 0x14], 0
jmp 0x402242
mov rax, qword [rbp - 0x20]
mov ecx, dword [rax + 0xc]
mov rax, qword [rbp - 0x20]
mov edx, dword [rax + 8]
mov rax, qword [rbp - 0x20]
mov eax, dword [rax + 4]
mov r8d, ecx
mov ecx, eax
mov rax, qword [sym.imp.WS2_32.dll_socket]
call rax
mov qword [rbp - 8], rax
cmp qword [rbp - 8], 0xffffffffffffffff
jne 0x402014
mov rax, qword [sym.imp.WS2_32.dll_WSAGetLastError]
call rax
mov rdx, qword [rbp + 0x40]
mov dword [rdx], eax
mov dword [rbp - 0x14], 0xfffffffd
jmp 0x402242
mov rax, qword [sym.imp.WS2_32.dll_WSACreateEvent]
call rax
mov qword [rbp - 0x10], rax
cmp qword [rbp - 0x10], 0
jne 0x402043
mov rax, qword [sym.imp.WS2_32.dll_WSAGetLastError]
call rax
mov rdx, qword [rbp + 0x40]
mov dword [rdx], eax
mov dword [rbp - 0x14], 0xfffffffd
jmp 0x402242
cmp dword [rbp + 0x10], 1
jne 0x40212c
mov dword [rbp - 0x24], 1
lea rdx, [rbp - 0x24]
mov rax, qword [rbp - 8]
mov dword [rsp + 0x20], 4
mov r9, rdx
mov r8d, 4
mov edx, pe_overlay
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_setsockopt]
call rax
mov rax, qword [rbp - 0x20]
mov rax, qword [rax + 0x10]
mov ecx, eax
mov rax, qword [rbp - 0x20]
mov rdx, qword [rax + 0x20]
mov rax, qword [rbp - 8]
mov r8d, ecx
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_bind]
call rax
test eax, eax
jne 0x402120
mov rax, qword [rbp - 8]
mov edx, 5
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_listen]
call rax
test eax, eax
jne 0x402105
mov rdx, qword [rbp - 0x10]
mov rax, qword [rbp - 8]
mov r8d, 8
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_WSAEventSelect]
call rax
test eax, eax
je 0x4020f9
mov rax, qword [sym.imp.WS2_32.dll_WSAGetLastError]
call rax
mov rdx, qword [rbp + 0x40]
mov dword [rdx], eax
mov dword [rbp - 0x14], 0xfffffffd
jmp 0x402242
mov dword [rbp - 0x14], 0
jmp 0x402242
mov rax, qword [sym.imp.WS2_32.dll_WSAGetLastError]
call rax
mov rdx, qword [rbp + 0x40]
mov dword [rdx], eax
mov dword [rbp - 0x14], 0xfffffffb
jmp 0x402242
mov dword [rbp - 0x14], 0xfffffffc
jmp 0x4021fc
mov rdx, qword [rbp - 0x10]
mov rax, qword [rbp - 8]
mov r8d, 0x30
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_WSAEventSelect]
call rax
test eax, eax
je 0x402165
mov rax, qword [sym.imp.WS2_32.dll_WSAGetLastError]
call rax
mov rdx, qword [rbp + 0x40]
mov dword [rdx], eax
mov dword [rbp - 0x14], 0xfffffffd
jmp 0x402242
mov rax, qword [rbp - 0x20]
mov rax, qword [rax + 0x10]
mov ecx, eax
mov rax, qword [rbp - 0x20]
mov rdx, qword [rax + 0x20]
mov rax, qword [rbp - 8]
mov r8d, ecx
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_connect]
call rax
test eax, eax
jne 0x4021cd
mov rdx, qword [rbp - 0x10]
mov rax, qword [rbp - 8]
mov r8d, 0x21
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_WSAEventSelect]
call rax
test eax, eax
je 0x4021c4
mov rax, qword [sym.imp.WS2_32.dll_WSAGetLastError]
call rax
mov rdx, qword [rbp + 0x40]
mov dword [rdx], eax
mov dword [rbp - 0x14], 0xfffffffd
jmp 0x402242
mov dword [rbp - 0x14], 0
jmp 0x402242
mov rax, qword [sym.imp.WS2_32.dll_WSAGetLastError]
call rax
cmp eax, 0x2733
jne 0x4021e6
mov dword [rbp - 0x14], 1
jmp 0x402242
mov rax, qword [sym.imp.WS2_32.dll_WSAGetLastError]
call rax
mov rdx, qword [rbp + 0x40]
mov dword [rdx], eax
mov dword [rbp - 0x14], 0xfffffffa
mov rax, qword [rbp - 0x10]
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_WSACloseEvent]
call rax
mov rax, qword [rbp - 8]
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_closesocket]
call rax
mov rax, qword [sym.imp.WS2_32.dll_WSAGetLastError]
call rax
mov rdx, qword [rbp + 0x40]
mov dword [rdx], eax
mov rax, qword [rbp - 0x20]
mov rax, qword [rax + 0x28]
mov qword [rbp - 0x20], rax
cmp qword [rbp - 0x20], 0
jne 0x401f93
mov rax, qword [rbp - 0x68]
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_freeaddrinfo]
call rax
cmp dword [rbp - 0x14], 0
js 0x402277
cmp dword [rbp + 0x10], 0
je 0x402277
mov rax, qword [rbp + 0x30]
mov rdx, qword [rbp - 8]
mov qword [rax], rdx
mov rax, qword [rbp + 0x30]
mov rdx, qword [rbp - 0x10]
mov qword [rax + 8], rdx
jmp 0x4022a5
cmp qword [rbp - 8], 0xffffffffffffffff
je 0x4022a5
mov rax, qword [rbp - 8]
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_closesocket]
call rax
cmp qword [rbp - 0x10], 0
je 0x4022a5
mov rax, qword [rbp - 0x10]
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_WSACloseEvent]
call rax
mov eax, dword [rbp - 0x14]
add rsp, 0xa0
pop rbp
ret