Function at 0x140009020
Capabilities:
Connect to wmi namespace via wbemlocator
Reference sql statements

Disassembly:
push rbx
push rdi
push r12
push r13
sub rsp, 0x8d8
xor r13d, r13d
mov r12, rcx
lea rax, [rsp + 0x68]
mov rbx, rdx
lea r9, [0x140027c10]
lea rcx, [0x140027ce0]
lea r8d, [r13 + 1]
xor edx, edx
mov qword [rsp + 0xa0], r13
mov qword [rsp + 0x68], r13
mov qword [rsp + 0x20], rax
call qword [sym.imp.ole32.dll_CoCreateInstance]
mov rcx, qword [rsp + 0x68]
mov edi, eax
test rcx, rcx
je 0x1400090e3
mov rax, qword [rcx]
lea rdx, [rsp + 0xa0]
xor r9d, r9d
mov qword [rsp + 0x40], rdx
mov qword [rsp + 0x38], r13
mov qword [rsp + 0x30], r13
xor r8d, r8d
mov rdx, rbx
mov dword [rsp + 0x28], r13d
mov qword [rsp + 0x20], r13
call qword [rax + 0x18]
mov rcx, qword [rsp + 0xa0]
mov dword [rsp + 0x38], r13d
mov qword [rsp + 0x30], r13
lea edx, [r13 + 0xa]
xor r9d, r9d
xor r8d, r8d
mov dword [rsp + 0x28], 3
mov edi, eax
mov dword [rsp + 0x20], 3
call qword [sym.imp.ole32.dll_CoSetProxyBlanket]
mov rcx, qword [rsp + 0x68]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_SafeArrayGetDim]
cmp qword [rsp + 0xa0], r13
je 0x14000973f
lea rcx, [rsp + 0xd2]
xor edx, edx
mov r8d, 0x7fe
mov qword [rsp + 0x908], rsi
mov word [rsp + 0xd0], r13w
mov qword [rsp + 0x8d0], r15
call sub.msvcrt.dll_memset
lea rcx, str.SELECT__FROM_SoftwareLicensingProduct_WHERE_PartialProductKey_IS_NOT_NULL
mov dx, 0x20
lea rsi, str.SELECT__FROM_SoftwareLicensingProduct_WHERE_PartialProductKey_IS_NOT_NULL
mov r15d, r13d
call sub.msvcrt.dll_wcschr
test rax, rax
jne 0x140009272
lea r9, str.SELECT__FROM_SoftwareLicensingProduct_WHERE_PartialProductKey_IS_NOT_NULL
lea r8, str.SELECT__FROM__s
lea rcx, [rsp + 0xd0]
mov edx, 0x3ff
call sub.msvcrt.dll__snwprintf
mov rcx, qword [rsp + 0xa0]
lea rdx, [rsp + 0x50]
mov dword [rsp + 0x90], 0x400
mov dword [rsp + 0x94], 0x100
mov dword [rsp + 0x70], r13d
mov dword [rsp + 0x74], r13d
mov qword [rsp + 0x80], r13
mov qword [rsp + 0x88], r13
mov dword [rsp + 0x98], r13d
mov dword [rsp + 0x78], r13d
mov rax, qword [rcx]
mov qword [rsp + 0x28], r13
mov qword [rsp + 0x20], rdx
lea rdx, str.SELECT__FROM_SoftwareLicensingProduct_WHERE_PartialProductKey_IS_NOT_NULL
xor r9d, r9d
xor r8d, r8d
lea rsi, [rsp + 0xd0]
mov qword [rsp + 0x50], r13
call qword [rax + 0x30]
mov rcx, qword [rsp + 0x50]
test rcx, rcx
je 0x140009247
lea rdx, [rsp + 0x60]
xor r9d, r9d
mov qword [rsp + 0x60], r13
mov rax, qword [rcx]
mov qword [rsp + 0x20], rdx
lea r8d, [r9 + 0x40]
xor edx, edx
call qword [rax + 0x38]
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x14000923c
mov rdi, qword [rcx + 0x10]
mov ebx, r13d
cmp dword [rcx + 0x18], ebx
jbe 0x140009236
mov rdx, qword [rdi]
lea rcx, [rsp + 0x70]
or r8d, 0xffffffff
call fcn.14001d680
mov rcx, qword [rsp + 0x60]
add ebx, 1
add rdi, 8
cmp ebx, dword [rcx + 0x18]
jb 0x140009214
call qword [sym.imp.OLEAUT32.dll_SafeArrayGetDim]
mov rcx, qword [rsp + 0x50]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_SafeArrayGetDim]
mov rax, qword [r12]
lea rdx, [rsp + 0x70]
mov rcx, r12
call qword [rax + 0x18]
mov rcx, qword [rsp + 0x88]
call sub.msvcrt.dll_free
mov rcx, qword [rsp + 0x80]
call sub.msvcrt.dll_free
jmp 0x140009278
mov r15d, 1
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov rcx, qword [rsp + 0xa0]
lea rdx, [rsp + 0x68]
mov qword [rsp + 0x28], rdx
mov dword [r12 + 0x28], eax
mov qword [rsp + 0x68], r13
mov rax, qword [rcx]
lea rdx, [0x140028d40]
mov r9d, gethostbyname
mov r8, rsi
mov qword [rsp + 0x20], r13
call qword [rax + 0xa0]
mov rcx, qword [rsp + 0x68]
test rcx, rcx
mov edi, eax
je 0x140009721
mov dword [rsp + 0x38], r13d
xor r9d, r9d
mov qword [rsp + 0x30], r13
lea edx, [r9 + 0xa]
xor r8d, r8d
mov qword [rsp + 0x900], rbp
mov dword [rsp + 0x28], 3
mov qword [rsp + 0x910], r14
mov dword [rsp + 0x20], 3
call qword [sym.imp.ole32.dll_CoSetProxyBlanket]
xor edx, edx
lea rbx, [r12 + 8]
lea r9, [0x140027a10]
lea rcx, [0x140027a90]
lea r8d, [rdx + 1]
mov qword [rsp + 0x20], rbx
call qword [sym.imp.ole32.dll_CoCreateInstance]
mov dword [rsp + 0xa8], r13d
mov qword [rsp + 0x58], r13
mov rcx, qword [rsp + 0x68]
lea rdx, [rsp + 0xa8]
lea r9, [rsp + 0x58]
mov rax, qword [rcx]
mov qword [rsp + 0x20], rdx
mov r8d, 1
mov edx, 0x7530
call qword [rax + 0x20]
cmp eax, 1
mov edi, eax
cmove edi, r13d
cmp dword [rsp + 0xa8], 0
je 0x1400096e1
test r15d, r15d
je 0x1400095f1
mov rbp, qword [rsp + 0x58]
mov r15d, r13d
mov dword [rsp + 0x90], 0x400
test rbp, rbp
mov dword [rsp + 0x94], 0x100
mov dword [rsp + 0x70], r13d
mov dword [rsp + 0x74], r13d
mov qword [rsp + 0x80], r13
mov qword [rsp + 0x88], r13
mov dword [rsp + 0x98], r13d
mov dword [rsp + 0x78], r13d
je 0x1400095c8
mov rax, qword [rbp]
mov edx, 0x40
mov rcx, rbp
call qword [rax + 0x40]
mov rax, qword [rbp]
lea rcx, [rsp + 0xb0]
mov qword [rsp + 0x28], r13
mov qword [rsp + 0x20], rcx
lea r9, [rsp + 0xb8]
lea r8, [rsp + 0x50]
mov rcx, rbp
xor edx, edx
mov qword [rsp + 0x50], r13
call qword [rax + 0x48]
test eax, eax
jne 0x1400095be
mov rsi, qword [rsp + 0x50]
test rsi, rsi
je 0x14000957d
movsxd r13, dword [rsp + 0x74]
or rcx, 0xffffffffffffffff
xor eax, eax
mov rdi, rsi
repne scasw ax, word [rdi]
not rcx
lea edx, [r13 + rcx]
lea r14, [rcx - 1]
cmp edx, 0xffffffff
mov dword [rsp + 0x74], edx
jne 0x140009453
mov rcx, qword [rsp + 0x88]
call sub.msvcrt.dll_free
jmp 0x1400094ae
mov eax, dword [rsp + 0x70]
cmp edx, eax
jl 0x1400094ae
mov rdi, qword [rsp + 0x88]
mov ecx, dword [rsp + 0x90]
mov ebx, eax
nop
add eax, ecx
cmp eax, edx
jle 0x140009470
mov dword [rsp + 0x70], eax
add eax, eax
movsxd rcx, eax
call sub.msvcrt.dll_malloc
test ebx, ebx
mov rcx, rax
mov qword [rsp + 0x88], rax
jle 0x1400094ae
test rax, rax
je 0x1400094a6
lea eax, [rbx + rbx]
mov rdx, rdi
movsxd r8, eax
call sub.msvcrt.dll_memcpy
mov rcx, rdi
call sub.msvcrt.dll_free
mov ecx, dword [rsp + 0x98]
cmp ecx, 0xffffffff
jne 0x1400094c9
mov rcx, qword [rsp + 0x80]
call sub.msvcrt.dll_free
jmp 0x140009525
mov eax, dword [rsp + 0x78]
cmp ecx, eax
jl 0x140009525
mov rdi, qword [rsp + 0x80]
mov edx, dword [rsp + 0x94]
mov ebx, eax
add eax, edx
cmp ecx, eax
jge 0x1400094e2
mov dword [rsp + 0x78], eax
shl eax, 2
movsxd rcx, eax
call sub.msvcrt.dll_malloc
test ebx, ebx
mov rcx, rax
mov qword [rsp + 0x80], rax
jle 0x140009525
test rax, rax
je 0x14000951d
lea eax, [rbx*4]
mov rdx, rdi
movsxd r8, eax
call sub.msvcrt.dll_memcpy
mov rcx, rdi
call sub.msvcrt.dll_free
mov rax, qword [rsp + 0x88]
movsxd rbx, r14d
mov rdx, rsi
lea rcx, [rax + r13*2]
lea r8, [rbx + rbx]
call sub.msvcrt.dll_memcpy
mov rax, qword [rsp + 0x88]
lea rdx, [r13 + rbx]
mov word [rax + rdx*2], 0
movsxd rcx, dword [rsp + 0x98]
mov rax, qword [rsp + 0x80]
mov dword [rax + rcx*4], r13d
mov rcx, qword [rsp + 0x50]
add dword [rsp + 0x98], 1
call qword [sym.imp.OLEAUT32.dll_SysStringLen]
xor r13d, r13d
lea rcx, [rsp + 0xb8]
call qword [sym.imp.OLEAUT32.dll_VariantCopy]
mov rax, qword [rbp]
lea rcx, [rsp + 0xb0]
mov qword [rsp + 0x28], r13
mov qword [rsp + 0x20], rcx
lea r9, [rsp + 0xb8]
lea r8, [rsp + 0x50]
mov rcx, rbp
xor edx, edx
call qword [rax + 0x48]
test eax, eax
je 0x140009410
mov rax, qword [rbp]
mov rcx, rbp
call qword [rax + 0x50]
mov rax, qword [r12]
lea rdx, [rsp + 0x70]
mov rcx, r12
call qword [rax + 0x18]
mov rcx, qword [rsp + 0x88]
call sub.msvcrt.dll_free
mov rcx, qword [rsp + 0x80]
call sub.msvcrt.dll_free
cmp qword [rsp + 0x58], 0
je 0x140009333
mov rax, qword [r12]
mov rcx, r12
call qword [rax + htons]
mov rcx, qword [rsp + 0x58]
mov edx, 0x40
mov rax, qword [rcx]
call qword [rax + 0x40]
mov rcx, qword [rsp + 0x58]
lea rdx, [rsp + 0xac]
mov qword [rsp + 0x60], r13
mov rax, qword [rcx]
mov qword [rsp + 0x28], r13
mov qword [rsp + 0x20], rdx
lea r9, [rsp + 0xb8]
lea r8, [rsp + 0x60]
xor edx, edx
call qword [rax + 0x48]
test eax, eax
jne 0x1400096bc
nop
mov rax, qword [r12]
mov r9d, dword [rsp + 0xac]
mov rdx, qword [rsp + 0x60]
lea r8, [rsp + 0xb8]
mov rcx, r12
call qword [rax]
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x14000967e
call qword [sym.imp.OLEAUT32.dll_SysStringLen]
lea rcx, [rsp + 0xb8]
call qword [sym.imp.OLEAUT32.dll_VariantCopy]
mov rcx, qword [rsp + 0x58]
lea rdx, [rsp + 0xac]
mov rax, qword [rcx]
mov qword [rsp + 0x28], r13
mov qword [rsp + 0x20], rdx
lea r9, [rsp + 0xb8]
lea r8, [rsp + 0x60]
xor edx, edx
call qword [rax + 0x48]
test eax, eax
je 0x140009650
mov rcx, qword [rsp + 0x58]
mov rax, qword [rcx]
call qword [rax + 0x50]
mov rcx, qword [rsp + 0x58]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_SafeArrayGetDim]
mov rdx, qword [r12]
mov rcx, r12
call qword [rdx + reloc.OLEAUT32.dll_SafeArrayGetDim]
jmp 0x140009333
mov rcx, qword [r12 + 8]
mov r14, qword [rsp + 0x910]
mov rbp, qword [rsp + 0x900]
test rcx, rcx
je 0x140009706
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_SafeArrayGetDim]
mov qword [r12 + 8], r13
mov rcx, qword [rsp + 0x68]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_SafeArrayGetDim]
call qword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [r12 + 0x28]
mov dword [r12 + 0x2c], eax
mov rcx, qword [rsp + 0xa0]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_SafeArrayGetDim]
mov r15, qword [rsp + 0x8d0]
mov rsi, qword [rsp + 0x908]
mov eax, edi
add rsp, 0x8d8
pop r13
pop r12
pop rdi
pop rbx
ret