Function at 0x18001e040
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, 0x4b0
mov qword [rsp + 0x58], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rbp
mov qword [rax + 0x20], rsi
mov rax, qword [0x180057b40]
xor rax, rsp
mov qword [rsp + 0x4a0], 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 0x18001e0ae
call qword [sym.imp.ADVAPI32.dll_RevertToSelf]
nop
mov rdi, qword [rsi]
test rdi, rdi
je 0x18001e0cd
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 0x18001e0ee
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 0x18001e101
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov qword [rsi + 0x10], r13
mov rcx, qword [rsi + 0x18]
test rcx, rcx
je 0x18001e114
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsi + 0x18], r13
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov dword [rsp + 0x38], r13d
lea rdx, [rsp + 0x38]
mov ecx, eax
call qword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
mov edi, eax
test eax, eax
je 0x18001e4c4
lea rcx, [rsi + 0x20]
call fcn.1800205b0
test rax, rax
je 0x18001e15d
cmp word [rax], 0
je 0x18001e15d
xor r8d, r8d
mov rdx, rax
mov rcx, rsi
call fcn.18001d500
jmp 0x18001e264
mov word [rsp + 0x60], 0
xor eax, eax
mov qword [rsp + 0x62], rax
mov qword [rsp + 0x6a], rax
mov qword [rsp + 0x72], rax
mov dword [rsp + 0x7a], eax
mov word [rsp + 0x7e], ax
mov dword [rsp + 0x34], reloc.OLEAUT32.dll_SafeArrayGetDim
lea rdx, [rsp + 0x34]
lea rcx, [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_GetComputerNameW]
lea rcx, [rsp + 0x60]
call sub.WTSAPI32.dll_WTSOpenServerW
mov rbx, rax
test rax, rax
je 0x18001e26c
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, 5
mov edx, dword [rsp + 0x38]
mov rcx, rbx
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
mov edi, eax
test eax, eax
je 0x18001e25c
cmp qword [rsp + 0x48], 0
je 0x18001e25c
mov qword [rsp + 0x40], r13
mov dword [rsp + 0x30], r13d
lea rax, [rsp + 0x30]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x40]
mov r8d, 7
mov edx, dword [rsp + 0x38]
mov rcx, rbx
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
mov r8, qword [rsp + 0x40]
mov rdx, qword [rsp + 0x48]
mov rcx, rsi
call fcn.18001d500
mov rcx, qword [rsp + 0x40]
test rcx, rcx
je 0x18001e236
call sub.WTSAPI32.dll_WTSFreeMemory
mov qword [rsp + 0x40], r13
mov rcx, qword [rsp + 0x48]
call sub.WTSAPI32.dll_WTSFreeMemory
mov qword [rsp + 0x48], r13
mov rdx, qword [rsi]
test rdx, rdx
je 0x18001e25c
cmp word [rdx], 0
je 0x18001e25c
lea rcx, [rsi + 0x20]
call fcn.1800204c0
mov rcx, rbx
call sub.WTSAPI32.dll_WTSCloseServer
test edi, edi
jne 0x18001e4c4
cmp dword [rsp + 0x38], 0
jne 0x18001e4c4
mov rbx, r13
mov qword [rsp + 0x48], rbx
mov qword [rsp + 0x40], r13
lea rax, [rsp + 0x40]
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 0x18001e488
mov rbx, qword [rsp + 0x40]
mov qword [rsp + 0x48], rbx
mov word [rsp + 0x80], ax
xor edx, edx
mov r8d, 0x206
lea rcx, [rsp + 0x82]
call fcn.180026db0
mov dword [rsp + 0x30], 0x208
lea rax, [rsp + 0x30]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x80]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x34]
xor r8d, r8d
lea rdx, str.AltDefaultUserName
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x18001e488
mov eax, dword [rsp + 0x34]
cmp eax, 1
je 0x18001e32b
cmp eax, 2
jne 0x18001e488
mov eax, dword [rsp + 0x30]
test eax, eax
je 0x18001e488
test al, 1
jne 0x18001e488
shr rax, 1
cmp word [rsp + rax*2 + 0x7e], 0
jne 0x18001e488
cmp word [rsp + 0x80], 0
je 0x18001e488
mov word [rsp + 0x290], 0
xor edx, edx
mov r8d, 0x206
lea rcx, [rsp + 0x292]
call fcn.180026db0
mov dword [rsp + 0x30], 0x208
lea rax, [rsp + 0x30]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x290]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x34]
xor r8d, r8d
lea rdx, str.AltDefaultDomainName
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x18001e3d8
mov eax, dword [rsp + 0x34]
cmp eax, 1
je 0x18001e3c5
cmp eax, 2
jne 0x18001e3d8
cmp dword [rsp + 0x30], 0
jne 0x18001e3d8
mov word [rsp + 0x290], 0
jmp 0x18001e3e7
cmp word [rsp + 0x290], 0
jne 0x18001e470
xor eax, eax
or rcx, 0xffffffffffffffff
lea rdi, [rsp + 0x80]
repne scasw ax, word [rdi]
not rcx
sub rcx, 1
mov edx, r13d
test ecx, ecx
je 0x18001e470
lea rax, [rsp + 0x80]
nop
cmp word [rax], 0x40
je 0x18001e423
add edx, 1
add rax, 2
cmp edx, ecx
jb 0x18001e410
jmp 0x18001e470
mov eax, edx
mov word [rsp + rax*2 + 0x80], 0
lea eax, [rdx + 1]
mov ecx, eax
lea rdx, [rsp + rax*2 + 0x80]
add rcx, rcx
lea rdi, [rsp + 0x290]
sub rdi, rcx
lea rax, [rsp + 0x80]
sub rdi, rax
nop
nop
nop
movzx eax, word [rdx]
mov word [rdi + rdx], ax
add rdx, 2
test ax, ax
jne 0x18001e460
lea r8, [rsp + 0x290]
lea rdx, [rsp + 0x80]
mov rcx, rsi
call fcn.18001d500
mov rax, qword [rsi]
test rax, rax
je 0x18001e496
cmp word [rax], 0
jne 0x18001e49e
mov rcx, rsi
call fcn.18001d610
mov rdx, qword [rsi]
test rdx, rdx
je 0x18001e4b6
cmp word [rdx], 0
je 0x18001e4b6
lea rcx, [rsi + 0x20]
call fcn.1800204c0
nop
test rbx, rbx
je 0x18001e4c4
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov rax, qword [rsi]
test rax, rax
je 0x18001e4d2
cmp word [rax], 0
jne 0x18001e4d5
mov ebp, r13d
mov rcx, qword [rsp + 0x50]
test rcx, rcx
je 0x18001e4f4
call qword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, ebp
jmp 0x18001e4f6
mov eax, ebp
mov rcx, qword [rsp + 0x4a0]
xor rcx, rsp
call fcn.180026cf0
lea r11, [rsp + 0x4b0]
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