Function at 0x140005320
Capabilities:
Initialize winsock library
Resolve dns

Disassembly:
push rbx
sub rsp, 0x20
mov rax, qword [rcx]
mov rbx, rcx
call qword [rax + reloc.WS2_32.dll_htonl]
test al, al
jne 0x140005313
cmp qword [rbx + 0x40], 0
mov rcx, rbx
je 0x140005309
xor edx, edx
add rsp, 0x20
pop rbx
jmp fcn.140004aa0
add rsp, 0x20
pop rbx
jmp 0x140005320
add rsp, 0x20
pop rbx
ret
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
mov qword [rsp + 0x20], rdi
push r14
sub rsp, 0x360
mov rax, qword [0x140205108]
xor rax, rsp
mov qword [rsp + 0x358], rax
mov rdi, rcx
mov qword [rsp + 0x30], rcx
xor r9d, r9d
lea r8, [rsp + 0x20]
xor edx, edx
lea r14, [0x140212368]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_InitOnceBeginInitialize]
test eax, eax
je 0x140005596
cmp dword [rsp + 0x20], 0
je 0x140005468
mov qword [rsp + 0x90], r14
mov dword [rsp + 0x98], 4
mov ecx, 1
call fcn.140167a7c
mov rbx, rax
mov qword [rsp + 0x38], rax
xor edx, edx
mov r8d, 0x198
lea rcx, [rsp + 0x1b0]
call fcn.14016b7a0
mov ecx, 0x202
lea rdx, [rsp + 0x1b0]
call qword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
jne 0x14000559c
mov qword [rsp + 0x38], rbx
mov ecx, 0x18
call fcn.140167a7c
mov qword [rsp + 0x70], rax
xorps xmm0, xmm0
movups xmmword [rax], xmm0
mov dword [rax + 8], 1
mov dword [rax + 0xc], 1
lea rcx, vtable.std::_Ref_count_class_apache::thrift::transport::TWinsockSingleton_.0
mov qword [rax], rcx
mov qword [rax + 0x10], rbx
mov qword [0x140212370], rbx
mov rbx, qword [0x140212378]
mov qword [0x140212378], rax
test rbx, rbx
je 0x140005452
mov esi, 0xffffffff
mov eax, esi
lock xadd dword [rbx + 8], eax
cmp eax, 1
jne 0x140005452
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax]
nop
lock xadd dword [rbx + 0xc], esi
cmp esi, 1
jne 0x140005452
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + reloc.WS2_32.dll_htonl]
nop
xor r8d, r8d
xor edx, edx
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_InitOnceComplete]
test eax, eax
je 0x140005596
mov rax, qword [rdi]
mov rcx, rdi
call qword [rax + reloc.WS2_32.dll_htonl]
test al, al
jne 0x14000556c
mov r8d, dword [rdi + 0x28]
cmp r8d, 0xffff
ja 0x1400056a1
xor eax, eax
mov qword [rsp + 0x28], rax
xorps xmm0, xmm0
movdqu xmmword [rsp + 0x4c], xmm0
xorps xmm1, xmm1
movdqu xmmword [rsp + 0x5c], xmm1
mov dword [rsp + 0x6c], eax
mov dword [rsp + 0x44], eax
mov dword [rsp + 0x48], 1
mov dword [rsp + 0x40], 0x401
lea rdx, [0x1401d4f34]
lea rcx, [rsp + 0x350]
call fcn.1400031e0
lea rbx, [rdi + 8]
mov rcx, rbx
cmp qword [rbx + 0x18], 0x10
jb 0x1400054e0
mov rcx, qword [rbx]
lea r9, [rsp + 0x28]
lea r8, [rsp + 0x40]
lea rdx, [rsp + 0x350]
call qword [sym.imp.WS2_32.dll_getaddrinfo]
cmp eax, 0x2afc
jne 0x14000552c
and dword [rsp + 0x40], 0xfffffbff
cmp qword [rbx + 0x18], 0x10
jb 0x140005511
mov rbx, qword [rbx]
lea r9, [rsp + 0x28]
lea r8, [rsp + 0x40]
lea rdx, [rsp + 0x350]
mov rcx, rbx
call qword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
jne 0x1400055bf
mov rax, qword [rsp + 0x28]
mov qword [rsp + 0x20], rax
test rax, rax
je 0x140005561
mov rdx, rax
mov rcx, rdi
call fcn.140004aa0
nop
jmp 0x140005561
mov rcx, qword [rsp + 0x28]
call qword [sym.imp.WS2_32.dll_freeaddrinfo]
mov rcx, qword [rsp + 0x358]
xor rcx, rsp
call fcn.1401677c0
lea r11, [rsp + 0x360]
mov rbx, qword [r11 + 0x18]
mov rsi, qword [r11 + 0x20]
mov rdi, qword [r11 + 0x28]
mov rsp, r11
pop r14
ret
call fcn.14018001c
nop
lea rdx, str.Failed_to_initialise_Winsock.
lea rcx, [rsp + 0x78]
call fcn.14000cc40
lea rdx, [0x1401fc1f8]
lea rcx, [rsp + 0x78]
call fcn.14016c51c
nop
mov ecx, eax
call fcn.140003760
mov rdx, rax
lea rcx, [rsp + 0xf0]
call fcn.140007bb0
mov rbx, rax
lea rdx, [rsp + 0xd0]
mov rcx, rdi
call fcn.140006500
nop
mov r8, rax
lea rdx, str.TSocket::open___getaddrinfo__
lea rcx, [rsp + 0x90]
call fcn.14000a760
nop
mov r8, rbx
mov rdx, rax
lea rcx, [rsp + 0x110]
call fcn.14000a730
nop
lea rcx, [rsp + 0x90]
call fcn.140002b80
nop
lea rcx, [rsp + 0xd0]
call fcn.140002b80
nop
lea rcx, [rsp + 0xf0]
call fcn.140002b80
lea rcx, [rsp + 0x110]
call fcn.1400025b0
mov rdx, rax
call fcn.140003d70
mov rax, qword [rdi]
mov rcx, rdi
call qword [rax + 0x20]
lea rdx, str.Could_not_resolve_host_for_client_socket.
lea rcx, [rsp + 0xb0]
call fcn.140007bb0
nop
lea r8, [rsp + 0xb0]
mov edx, 1
lea rcx, [rsp + 0x130]
call fcn.140003d90
lea rdx, [0x1401fbfa0]
lea rcx, [rsp + 0x130]
call fcn.14016c51c
nop
lea rdx, str.Specified_port_is_invalid
lea rcx, [rsp + 0xb0]
call fcn.140007bb0
nop
lea r8, [rsp + 0xb0]
mov edx, 5
lea rcx, [rsp + 0x170]
call fcn.140003d90
lea rdx, [0x1401fbfa0]
lea rcx, [rsp + 0x170]
call fcn.14016c51c
int3