Function at 0x140039778
Capabilities:
Create thread

Disassembly:
mov rax, rsp
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rax - 0xd08]
sub rsp, 0xde0
mov qword [rsp + 0x60], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov rax, qword [0x14017a140]
xor rax, rsp
mov qword [rbp + 0xcd0], rax
mov r14, rdx
mov rbx, rcx
mov qword [rsp + 0x58], rcx
mov byte [rsp + 0x30], 0
and dword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0x5f
lea r9, str.NGDiscovery::CDiscoveryServerXpWSD_class_NGDiscovery::CWSDSession_::MainDiscoveryThreadProc
lea r8, [0x140182890]
mov rdx, qword [0x1401828c8]
lea rcx, [rsp + 0x70]
call fcn.140003374
nop
xor esi, esi
lea rax, [0x140037df8]
mov qword [rsp + 0x20], rax
lea r9, [0x140037e18]
lea edx, [rsi + 0x78]
lea r8d, [rsi + 0xf]
lea rcx, [rbp + 0x1b0]
call fcn.1400b99e4
nop
xor edi, edi
lea rax, vtable.NGDiscovery::CAdapterAddresses.0
mov qword [rsp + 0x48], rax
and qword [rsp + 0x50], rdi
cmp dword [r14 + 0x48], 1
jne 0x140039937
mov qword [rbp + 0x1b8], rbx
lea rax, [rbp + 0x1c0]
cmp rax, r14
je 0x1400398ab
lea rdx, [r14 + 8]
lea rax, [rbp + 0x1c8]
cmp rax, rdx
je 0x140039872
or r9, 0xffffffffffffffff
xor r8d, r8d
lea rcx, [rbp + 0x1c8]
call fcn.14000adb4
mov rax, qword [r14 + 0x28]
mov qword [rbp + 0x1e8], rax
movups xmm0, xmmword [r14 + 0x30]
movaps xmmword [rbp + 0x1f0], xmm0
movups xmm1, xmmword [r14 + 0x40]
movaps xmmword [rbp + 0x200], xmm1
mov rax, qword [r14 + 0x50]
mov qword [rbp + 0x210], rax
mov rax, qword [r14 + 0x58]
mov qword [rbp + 0x218], rax
and qword [rbp + 0x1d8], 0
lea rax, [rbp + 0x1c8]
cmp qword [rbp + 0x1e0], 0x10
cmovae rax, qword [rbp + 0x1c8]
mov byte [rax], 0
lea rax, [rsp + 0x40]
mov qword [rsp + 0x28], rax
and dword [rsp + 0x20], 0
lea r9, [rbp + 0x1b0]
lea r8, [0x140039de4]
xor edx, edx
xor ecx, ecx
call fcn.1400c5d28
mov qword [rbp + 0x130], rax
test rax, rax
je 0x140039909
mov edi, 1
jmp 0x140039bbc
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0x20], eax
lea r9, str._beginthreadex_failed__err_d
mov edx, 0x80
lea r8d, [rdx - 3]
lea rcx, [rsp + 0x70]
call fcn.1400037a4
mov esi, reloc.WS2_32.dll_inet_ntoa
jmp 0x140039d58
lea rcx, [rsp + 0x48]
call fcn.14003e138
test al, al
jne 0x14003996e
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0x20], eax
lea r9, str.CAdapterAddresses.Enum_failed__err_d
mov edx, 0x80
lea r8d, [rdx + 6]
lea rcx, [rsp + 0x70]
call fcn.1400037a4
mov esi, reloc.WS2_32.dll_listen
mov byte [rsp + 0x30], 0
and dword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0x63
lea r9, str.NGDiscovery::CAdapterAddresses::GetFirst
lea r8, [0x140182c90]
mov rdx, qword [0x1401828c8]
lea rcx, [rbp + 0x10]
call fcn.140003374
nop
lea rcx, [rbp + 0x10]
call fcn.1400034bc
mov r13, qword [rsp + 0x50]
test r13, r13
je 0x140039bb2
cmp dword [r13 + 0x68], 1
jne 0x140039ba5
cmp dword [r13 + 0x64], 6
je 0x1400399d3
cmp dword [r13 + 0x64], 0x47
jne 0x140039ba5
mov r15, qword [r13 + 0x18]
test r15, r15
je 0x140039ba5
xor edx, edx
mov r8d, 0x401
lea rcx, [rbp + 0x8c0]
call fcn.1400bbca0
cmp dword [r15 + 0x28], 4
jne 0x140039b7a
mov ebx, dword [r15 + 0x18]
mov r12, qword [r15 + 0x10]
mov rax, qword [0x140184800]
test rax, rax
jne 0x140039a22
lea ecx, [rax + 1]
call fcn.14003885c
mov qword [0x140184800], rax
mov dword [rsp + 0x30], 2
and qword [rsp + 0x28], 0
and qword [rsp + 0x20], 0
mov r9d, 0x401
lea r8, [rbp + 0x8c0]
mov edx, ebx
mov rcx, r12
call rax
mov ebx, eax
mov ecx, eax
call qword [sym.imp.WS2_32.dll_WSASetLastError]
test ebx, ebx
je 0x140039a81
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [rsp + 0x20], eax
lea r9, str.getnameinfo_failed__err_d
mov edx, 0x80
lea r8d, [rdx + 0x27]
lea rcx, [rsp + 0x70]
call fcn.1400037a4
jmp 0x140039b7a
mov eax, edi
imul rax, rax, 0x78
lea r12, [rbp + 0x1b0]
add r12, rax
mov rax, qword [rsp + 0x58]
mov qword [r12 + 8], rax
lea rbx, [r12 + 0x10]
cmp rbx, r14
je 0x140039ae8
lea rdx, [r14 + 8]
lea rcx, [rbx + 8]
cmp rcx, rdx
je 0x140039abe
or r9, 0xffffffffffffffff
xor r8d, r8d
call fcn.14000adb4
mov rax, qword [r14 + 0x28]
mov qword [rbx + 0x28], rax
movups xmm0, xmmword [r14 + 0x30]
movups xmmword [rbx + 0x30], xmm0
movups xmm1, xmmword [r14 + 0x40]
movups xmmword [rbx + 0x40], xmm1
mov rax, qword [r14 + 0x50]
mov qword [rbx + 0x50], rax
mov rax, qword [r14 + 0x58]
mov qword [rbx + 0x58], rax
cmp byte [rbp + 0x8c0], 0
jne 0x140039af5
xor eax, eax
jmp 0x140039b01
lea rcx, [rbp + 0x8c0]
call fcn.1400c2f80
lea rcx, [r12 + 0x18]
mov r8, rax
lea rdx, [rbp + 0x8c0]
call fcn.14000acb4
lea rax, [rsp + 0x40]
mov qword [rsp + 0x28], rax
and dword [rsp + 0x20], 0
mov r9, r12
lea r8, [0x140039de4]
xor edx, edx
xor ecx, ecx
call fcn.1400c5d28
mov qword [rbp + rdi*8 + 0x130], rax
test rax, rax
je 0x140039b4d
inc edi
cmp edi, 0xf
jae 0x140039b83
jmp 0x140039b7a
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0x28], eax
mov dword [rsp + 0x20], edi
lea r9, str._beginthreadex__d__failed__err_d
mov edx, 0x80
lea r8d, [rdx + 0x3e]
lea rcx, [rsp + 0x70]
call fcn.1400037a4
mov esi, reloc.WS2_32.dll_inet_ntoa
mov r15, qword [r15 + 8]
jmp 0x1400399d7
mov dword [rsp + 0x20], reloc.OLEAUT32.dll_SafeArrayDestroy
lea r9, str.Reached_maximum_discovery_threads_allowed___d_
mov edx, 0x40
lea r8d, [rdx + 0x78]
lea rcx, [rsp + 0x70]
call fcn.1400037a4
mov r13, qword [r13 + 8]
cmp edi, 0xf
jb 0x1400399ad
test edi, edi
je 0x140039d28
xor esi, esi
mov r13d, dword [r14 + 0x30]
xor eax, eax
cmp r13d, 2
sete al
mov dword [rsp + 0x40], eax
mov ebx, edi
test edi, edi
je 0x140039c10
lea r15, [rbp + 0x1b0]
mov r12d, edi
mov r8d, edi
shl r8, 3
lea rdx, [rbp + 0x130]
lea rcx, [rbp + 0x10]
call fcn.1400bb850
xor eax, eax
mov qword [rbp + rax + 0xb0], r15
add r15, 0x78
lea rax, [rax + 8]
sub r12, 1
jne 0x140039bf6
mov eax, dword [rsp + 0x40]
or r15d, 0xffffffff
mov r9d, r15d
mov r8d, eax
lea rdx, [rbp + 0x10]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
mov r9d, eax
cmp eax, r15d
je 0x140039ca4
cmp r13d, 2
je 0x140039c81
mov rcx, qword [rbp + r9*8 + 0xb0]
mov esi, dword [rcx + 0x70]
test esi, esi
je 0x140039ccd
dec ebx
cmp r9d, ebx
jae 0x140039c77
lea r8d, [r9 + 1]
mov ecx, r9d
mov rax, qword [rbp + r8*8 + 0x10]
mov qword [rbp + rcx*8 + 0x10], rax
mov rax, qword [rbp + r8*8 + 0xb0]
mov qword [rbp + rcx*8 + 0xb0], rax
mov r9d, r8d
cmp r8d, ebx
jb 0x140039c4e
test ebx, ebx
je 0x140039ccd
mov eax, dword [rsp + 0x40]
jmp 0x140039c14
xor edx, edx
test ebx, ebx
je 0x140039ccd
lea rcx, [rbp + 0xb0]
mov rax, qword [rcx]
mov esi, dword [rax + 0x70]
test esi, esi
je 0x140039ccd
inc edx
add rcx, 8
cmp edx, ebx
jb 0x140039c8e
jmp 0x140039ccd
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0x20], eax
lea r9, str.WaitForMultipleObjects_failed__err_d
mov edx, 0x80
lea r8d, [rdx + 0x68]
lea rcx, [rsp + 0x70]
call fcn.1400037a4
mov esi, reloc.WS2_32.dll_inet_ntoa
cmp r13d, 2
je 0x140039d35
test ebx, ebx
je 0x140039d35
mov rcx, qword [r14 + 0x28]
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov r9d, r15d
mov r8d, 1
lea rdx, [rbp + 0x10]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
cmp eax, r15d
jne 0x140039d35
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0x20], eax
lea r9, str.WaitForMultipleObjects_failed__err_d
mov edx, 0x80
mov r8d, 0x118
lea rcx, [rsp + 0x70]
call fcn.1400037a4
mov esi, reloc.WS2_32.dll_inet_ntoa
jmp 0x140039d35
or r15d, 0xffffffff
test esi, esi
jne 0x140039d35
mov esi, reloc.WS2_32.dll_listen
test edi, edi
je 0x140039d58
mov eax, edi
lea rbx, [rbp + 0x130]
lea rbx, [rbx + rax*8]
lea rbx, [rbx - 8]
mov rcx, qword [rbx]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
add edi, r15d
jne 0x140039d46
lea rcx, [rsp + 0x48]
call fcn.14003e0a4
nop
lea r9, [0x140037df8]
mov edx, 0x78
lea r8d, [rdx - 0x69]
lea rcx, [rbp + 0x1b0]
call fcn.1400b9a54
nop
lea rcx, [rsp + 0x70]
call fcn.1400034bc
mov eax, esi
mov rcx, qword [rbp + 0xcd0]
xor rcx, rsp
call fcn.1400b9f80
lea r11, [rsp + 0xde0]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret