Function at 0x1000506bc
Capabilities:
Persist via windows service
Query or enumerate registry value
Set registry value

Disassembly:
mov rax, rsp
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xb0
mov qword [rsp + 0xa0], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rbp
mov qword [rax + 0x18], rsi
mov r15, r9
mov rdi, r8
mov r13, rdx
mov rbp, rcx
and qword [rax - 0x80], 0
xor r12d, r12d
lea rcx, [rax - 0x68]
call fcn.100018ee8
nop
lea rcx, [rsp + 0x60]
call fcn.10001e06c
nop
lea rcx, [rsp + 0x68]
call fcn.10001e06c
nop
mov r14, qword [rsp + 0x100]
and dword [r14], r12d
xor edx, edx
xor ecx, ecx
mov r8d, 0x80000000
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rsi, rax
test rax, rax
je 0x100050a8d
xor ebx, ebx
mov r8d, 0x80000000
mov rdx, qword [r13]
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
test rax, rax
jne 0x10005076f
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x424
jne 0x100050a8d
jmp 0x10005077d
mov ebx, 1
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea rdx, [0x1000124e0]
lea rcx, [rsp + 0x100]
call fcn.10001e134
nop
lea r8, [rsp + 0x60]
mov rdx, r13
lea rcx, [rsp + 0x100]
call fcn.10002f9d0
nop
lea rcx, [rsp + 0x100]
call fcn.10001f3ec
lea rdx, [0x100012410]
lea rcx, [rsp + 0x100]
call fcn.10001e134
nop
lea r8, [rsp + 0x68]
lea rdx, [rsp + 0x100]
lea rcx, [rsp + 0x60]
call fcn.10002f9d0
nop
lea rcx, [rsp + 0x100]
call fcn.10001f3ec
and qword [rsp + 0x40], 0
lea rax, [rsp + 0x58]
mov qword [rsp + 0x38], rax
and qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x2001f
and dword [rsp + 0x20], 0
xor r9d, r9d
xor r8d, r8d
mov rdx, qword [rsp + 0x68]
mov rcx, 0xffffffff80000002
call qword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
jne 0x100050a8d
and dword [rsp + 0x50], eax
lea rax, [rsp + 0x50]
mov qword [rsp + 0x28], rax
and qword [rsp + 0x20], 0
xor r9d, r9d
xor r8d, r8d
lea r13, [0x100010678]
mov rdx, r13
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
je 0x1000508ab
cmp eax, 2
jne 0x100050a8d
test ebx, ebx
je 0x100050920
mov r9, qword [rsp + 0x70]
xor r8d, r8d
lea rdx, [0x100010648]
lea rcx, [rsp + 0x70]
call fcn.10001f04c
mov rcx, qword [rsp + 0x70]
test rcx, rcx
je 0x10005089f
mov qword [rcx + 8], rax
jmp 0x1000508a4
mov qword [rsp + 0x78], rax
mov qword [rsp + 0x70], rax
jmp 0x100050920
test ebx, ebx
je 0x100050920
mov eax, dword [rsp + 0x50]
test eax, eax
je 0x100050920
add eax, 4
mov dword [rsp + 0x50], eax
mov ecx, eax
call sub.msvcrt.dll_void____ptr64___cdecl_operator_new___unsigned_long_long_unsigned___int64__
mov qword [rdi], rax
test rax, rax
je 0x100050a8d
mov eax, dword [rsp + 0x50]
mov dword [r15], eax
mov r8, rax
xor edx, edx
mov rcx, qword [rdi]
call sub.msvcrt.dll_memset
lea r11, [rsp + 0x50]
mov qword [rsp + 0x28], r11
mov rax, qword [rdi]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
mov rdx, r13
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x100050a8d
mov rdx, qword [rdi]
lea rcx, [rsp + 0x70]
call fcn.10003de0c
lea rax, [rsp + 0x100]
mov qword [rsp + 0xa8], rax
mov rdx, rbp
lea rcx, [rsp + 0x100]
call fcn.10001e09c
nop
mov rdx, rax
lea rcx, [rsp + 0x70]
call fcn.100032ac4
test eax, eax
je 0x1000509f7
xor eax, eax
mov rdx, qword [rsp + 0x70]
test rdx, rdx
setne al
test eax, eax
jne 0x100050972
mov ecx, 0x80004005
call fcn.10001f28c
int3
add rdx, 0x10
lea rcx, [rsp + 0x100]
call fcn.10001e09c
nop
xor ecx, ecx
mov rax, qword [rsp + 0x100]
test rax, rax
setne cl
test ecx, ecx
jne 0x1000509a3
mov ecx, 0x80004005
call fcn.10001f28c
int3
mov rcx, qword [rbp]
sub rax, rcx
movzx edx, word [rcx]
cmp dx, word [rcx + rax]
jne 0x1000509c0
add rcx, 2
test dx, dx
jne 0x1000509aa
xor eax, eax
jmp 0x1000509c5
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x1000509de
lea rdx, [rsp + 0x100]
mov rcx, qword [rsp + 0x108]
call fcn.10001e1c8
mov dword [r14], 1
lea rcx, [rsp + 0x100]
call fcn.10001f3ec
jmp 0x100050a7a
mov r9, qword [rsp + 0x70]
xor r8d, r8d
mov rdx, qword [rbp]
lea rcx, [rsp + 0x70]
call fcn.10001f04c
mov rcx, qword [rsp + 0x70]
test rcx, rcx
je 0x100050a1d
mov qword [rcx + 8], rax
jmp 0x100050a22
mov qword [rsp + 0x78], rax
mov qword [rsp + 0x70], rax
lea rdx, [rsp + 0x50]
lea rcx, [rsp + 0x70]
call fcn.100031ad4
mov rbx, rax
test rax, rax
je 0x100050a8d
mov eax, dword [rsp + 0x50]
add eax, eax
mov dword [rsp + 0x28], eax
mov qword [rsp + 0x20], rbx
mov r9d, 7
xor r8d, r8d
mov rdx, r13
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test eax, eax
je 0x100050a72
mov rcx, rbx
call sub.msvcrt.dll_void___cdecl_operator_delete_void____ptr64_
jmp 0x100050a8d
mov rcx, rbx
call sub.msvcrt.dll_void___cdecl_operator_delete_void____ptr64_
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov r12d, 1
jmp 0x100050a9d
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x100050a9d
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
test rsi, rsi
je 0x100050aac
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
nop
lea rcx, [rsp + 0x68]
call fcn.10001f3ec
nop
lea rcx, [rsp + 0x60]
call fcn.10001f3ec
nop
lea rcx, [rsp + 0x70]
call fcn.10001a784
mov eax, r12d
lea r11, [rsp + 0xb0]
mov rbx, qword [r11 + 0x30]
mov rbp, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret