Function at 0x18001ec40
Capabilities:
Get hostname
Get session information
Get session user name
Query or enumerate registry value

Disassembly:
mov rax, rsp
push rdi
push r12
push r13
sub rsp, 0x4c0
mov qword [rsp + 0x68], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rbp
mov qword [rax + 0x20], rsi
mov rax, qword [0x18005a960]
xor rax, rsp
mov qword [rsp + 0x4b0], rax
mov rsi, rcx
xor r13d, r13d
mov qword [rsp + 0x50], r13
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov rcx, rax
lea r9, [rsp + 0x50]
mov ebp, 1
mov r8d, ebp
lea edx, [rbp + 0xb]
call qword [sym.imp.ADVAPI32.dll_OpenThreadToken]
cmp qword [rsp + 0x50], r13
je 0x18001ecae
call qword [sym.imp.ADVAPI32.dll_RevertToSelf]
nop
mov rdi, qword [rsi]
test rdi, rdi
je 0x18001eccd
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, rax
mov r8, rdi
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov qword [rsi], r13
mov rdi, qword [rsi + 8]
test rdi, rdi
je 0x18001ecee
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, rax
mov r8, rdi
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov qword [rsi + 8], r13
mov rcx, qword [rsi + 0x10]
test rcx, rcx
je 0x18001ed01
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov qword [rsi + 0x10], r13
mov rcx, qword [rsi + 0x18]
test rcx, rcx
je 0x18001ed14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsi + 0x18], r13
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov dword [rsp + 0x40], r13d
lea rdx, [rsp + 0x40]
mov ecx, eax
call qword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
test eax, eax
je 0x18001f0c4
mov word [rsp + 0x70], 0
xor eax, eax
mov qword [rsp + 0x72], rax
mov qword [rsp + 0x7a], rax
mov qword [rsp + 0x82], rax
mov dword [rsp + 0x8a], eax
mov word [rsp + 0x8e], ax
mov dword [rsp + 0x58], reloc.OLEAUT32.dll_SafeArrayGetDim
lea rdx, [rsp + 0x58]
lea rcx, [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_GetComputerNameW]
lea rcx, [rsp + 0x70]
call sub.WTSAPI32.dll_WTSOpenServerW
mov rdi, rax
test rax, rax
je 0x18001ee4c
mov qword [rsp + 0x38], r13
mov dword [rsp + 0x30], r13d
lea rax, [rsp + 0x30]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x38]
mov r8d, 5
mov edx, dword [rsp + 0x40]
mov rcx, rdi
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
mov ebx, eax
test eax, eax
je 0x18001ee3c
cmp qword [rsp + 0x38], 0
je 0x18001ee3c
mov qword [rsp + 0x48], r13
mov dword [rsp + 0x30], r13d
lea rax, [rsp + 0x30]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x48]
mov r8d, 7
mov edx, dword [rsp + 0x40]
mov rcx, rdi
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
mov r8, qword [rsp + 0x48]
mov rdx, qword [rsp + 0x38]
mov rcx, rsi
call fcn.18001da50
mov rcx, qword [rsp + 0x48]
test rcx, rcx
je 0x18001ee16
call sub.WTSAPI32.dll_WTSFreeMemory
mov qword [rsp + 0x48], r13
mov rcx, qword [rsp + 0x38]
call sub.WTSAPI32.dll_WTSFreeMemory
mov qword [rsp + 0x38], r13
mov rdx, qword [rsi]
test rdx, rdx
je 0x18001ee3c
cmp word [rdx], 0
je 0x18001ee3c
lea rcx, [rsi + 0x20]
call fcn.18001d020
mov rcx, rdi
call sub.WTSAPI32.dll_WTSCloseServer
test ebx, ebx
jne 0x18001f0c4
lea rcx, [rsi + 0x20]
call fcn.18001d110
test rax, rax
je 0x18001ee73
cmp word [rax], 0
je 0x18001ee73
xor r8d, r8d
mov rdx, rax
mov rcx, rsi
call fcn.18001da50
jmp 0x18001f0c4
cmp dword [rsp + 0x40], 0
jne 0x18001f0c4
mov rbx, r13
mov qword [rsp + 0x60], rbx
mov qword [rsp + 0x48], r13
lea rax, [rsp + 0x48]
mov qword [rsp + 0x20], rax
mov r9d, 0x2001f
xor r8d, r8d
lea rdx, str.SoftwareMicrosoftWindows_NTCurrentVersionWinlogon
mov rcx, 0xffffffff80000002
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x18001f088
mov rbx, qword [rsp + 0x48]
mov qword [rsp + 0x60], rbx
mov word [rsp + 0x90], ax
xor edx, edx
mov r8d, 0x206
lea rcx, [rsp + 0x92]
call fcn.180026a20
mov dword [rsp + 0x30], 0x208
lea rax, [rsp + 0x30]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x90]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x38]
xor r8d, r8d
lea rdx, str.AltDefaultUserName
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x18001f088
mov eax, dword [rsp + 0x38]
cmp eax, 1
je 0x18001ef32
cmp eax, 2
jne 0x18001f088
mov eax, dword [rsp + 0x30]
test eax, eax
je 0x18001f088
test al, 1
jne 0x18001f088
shr rax, 1
cmp word [rsp + rax*2 + 0x8e], 0
jne 0x18001f088
cmp word [rsp + 0x90], 0
je 0x18001f088
mov word [rsp + 0x2a0], 0
xor edx, edx
mov r8d, 0x206
lea rcx, [rsp + 0x2a2]
call fcn.180026a20
mov dword [rsp + 0x30], 0x208
lea rax, [rsp + 0x30]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x2a0]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x38]
xor r8d, r8d
lea rdx, str.AltDefaultDomainName
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x18001efe2
mov eax, dword [rsp + 0x38]
cmp eax, 1
je 0x18001efcf
cmp eax, 2
jne 0x18001efe2
cmp dword [rsp + 0x30], 0
jne 0x18001efe2
mov word [rsp + 0x2a0], 0
jmp 0x18001eff1
cmp word [rsp + 0x2a0], 0
jne 0x18001f070
xor eax, eax
or rcx, 0xffffffffffffffff
lea rdi, [rsp + 0x90]
repne scasw ax, word [rdi]
not rcx
sub rcx, 1
mov edx, r13d
test ecx, ecx
je 0x18001f070
lea rax, [rsp + 0x90]
cmp word [rax], 0x40
je 0x18001f02b
add edx, 1
add rax, 2
cmp edx, ecx
jb 0x18001f018
jmp 0x18001f070
mov eax, edx
mov word [rsp + rax*2 + 0x90], 0
lea eax, [rdx + 1]
mov ecx, eax
lea rdx, [rsp + rax*2 + 0x90]
add rcx, rcx
lea rdi, [rsp + 0x2a0]
sub rdi, rcx
lea rax, [rsp + 0x90]
sub rdi, rax
nop
movzx eax, word [rdx]
mov word [rdi + rdx], ax
add rdx, 2
test ax, ax
jne 0x18001f060
lea r8, [rsp + 0x2a0]
lea rdx, [rsp + 0x90]
mov rcx, rsi
call fcn.18001da50
mov rax, qword [rsi]
test rax, rax
je 0x18001f096
cmp word [rax], 0
jne 0x18001f09e
mov rcx, rsi
call fcn.18001db60
mov rdx, qword [rsi]
test rdx, rdx
je 0x18001f0b6
cmp word [rdx], 0
je 0x18001f0b6
lea rcx, [rsi + 0x20]
call fcn.18001d020
nop
test rbx, rbx
je 0x18001f0c4
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov rax, qword [rsi]
test rax, rax
je 0x18001f0d2
cmp word [rax], 0
jne 0x18001f0d5
mov ebp, r13d
mov rcx, qword [rsp + 0x50]
test rcx, rcx
je 0x18001f0f4
call qword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, ebp
jmp 0x18001f0f6
mov eax, ebp
mov rcx, qword [rsp + 0x4b0]
xor rcx, rsp
call fcn.180026960
lea r11, [rsp + 0x4c0]
mov rbx, qword [r11 + 0x28]
mov rbp, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x38]
mov rsp, r11
pop r13
pop r12
pop rdi
ret