Function at 0x140022680
Capabilities:
Persist via windows service
Set registry value

Disassembly:
mov qword [rsp + 8], rcx
sub rsp, 0x178
mov rax, qword [0x1400b3668]
xor rax, rsp
mov qword [rsp + 0x160], rax
lea rcx, [rsp + 0xf0]
call fcn.1400069e0
nop
lea r8, [rsp + 0xf0]
lea rdx, [0x140053010]
lea rcx, [rsp + 0x110]
call fcn.140022e20
nop
mov r8, qword [rsp + 0x180]
lea rdx, [0x140053058]
lea rcx, [rsp + 0xd0]
call fcn.140022e20
nop
lea rcx, [rsp + 0x110]
call fcn.140014060
lea r8, [rsp + 0xc0]
mov rdx, rax
mov rcx, 0xffffffff80000002
call qword [sym.imp.ADVAPI32.dll_RegCreateKeyW]
mov dword [rsp + 0x38], eax
cmp dword [rsp + 0x38], 0
je 0x140022777
lea rdx, str.____Cant_create_service_key
lea rcx, [0x1400b5020]
call fcn.140007000
mov qword [rsp + 0x68], rax
lea rdx, [0x14000c0b0]
mov rcx, qword [rsp + 0x68]
call fcn.14000efd0
mov byte [rsp + 0x30], 0
lea rcx, [rsp + 0xd0]
call fcn.14000e770
nop
lea rcx, [rsp + 0x110]
call fcn.14000e770
nop
lea rcx, [rsp + 0xf0]
call fcn.14000e770
movzx eax, byte [rsp + 0x30]
jmp 0x140022b9d
lea rcx, [rsp + 0xd0]
call fcn.1400166a0
shl rax, 1
mov dword [rsp + 0x50], eax
lea rcx, [rsp + 0xd0]
call fcn.140014060
mov qword [rsp + 0x70], rax
mov rax, qword [rsp + 0xc0]
mov qword [rsp + 0x78], rax
mov eax, dword [rsp + 0x50]
mov dword [rsp + 0x28], eax
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0x20], rax
mov r9d, 2
lea r8, str.ImagePath
xor edx, edx
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.ADVAPI32.dll_RegSetKeyValueW]
mov dword [rsp + 0x38], eax
cmp dword [rsp + 0x38], 0
je 0x140022856
mov rcx, qword [rsp + 0xc0]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea rdx, str.____Cant_create_ImagePath_registry_value
lea rcx, [0x1400b5020]
call fcn.140007000
mov qword [rsp + 0x80], rax
lea rdx, [0x14000c0b0]
mov rcx, qword [rsp + 0x80]
call fcn.14000efd0
mov byte [rsp + 0x31], 0
lea rcx, [rsp + 0xd0]
call fcn.14000e770
nop
lea rcx, [rsp + 0x110]
call fcn.14000e770
nop
lea rcx, [rsp + 0xf0]
call fcn.14000e770
movzx eax, byte [rsp + 0x31]
jmp 0x140022b9d
mov dword [rsp + 0x28], 4
lea rax, [0x140053354]
mov qword [rsp + 0x20], rax
mov r9d, 4
lea r8, str.Type
xor edx, edx
mov rcx, qword [rsp + 0xc0]
call qword [sym.imp.ADVAPI32.dll_RegSetKeyValueW]
mov dword [rsp + 0x38], eax
cmp dword [rsp + 0x38], 0
je 0x140022907
mov rcx, qword [rsp + 0xc0]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea rdx, str.____Cant_create_Type_registry_value
lea rcx, [0x1400b5020]
call fcn.140007000
mov qword [rsp + 0x88], rax
lea rdx, [0x14000c0b0]
mov rcx, qword [rsp + 0x88]
call fcn.14000efd0
mov byte [rsp + 0x32], 0
lea rcx, [rsp + 0xd0]
call fcn.14000e770
nop
lea rcx, [rsp + 0x110]
call fcn.14000e770
nop
lea rcx, [rsp + 0xf0]
call fcn.14000e770
movzx eax, byte [rsp + 0x32]
jmp 0x140022b9d
mov rcx, qword [rsp + 0xc0]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea rcx, [0x140053108]
call qword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov qword [rsp + 0x48], rax
cmp qword [rsp + 0x48], 0
jne 0x140022967
mov byte [rsp + 0x33], 0
lea rcx, [rsp + 0xd0]
call fcn.14000e770
nop
lea rcx, [rsp + 0x110]
call fcn.14000e770
nop
lea rcx, [rsp + 0xf0]
call fcn.14000e770
movzx eax, byte [rsp + 0x33]
jmp 0x140022b9d
lea rdx, str.RtlAdjustPrivilege
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rsp + 0x90], rax
lea rdx, str.NtLoadDriver
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rsp + 0xa8], rax
mov dword [rsp + 0x54], 0xa
mov rax, qword [rsp + 0x90]
mov qword [rsp + 0x98], rax
lea r9, [rsp + 0xc8]
xor r8d, r8d
mov dl, 1
mov ecx, dword [rsp + 0x54]
call qword [rsp + 0x98]
mov dword [rsp + 0x3c], eax
cmp dword [rsp + 0x3c], 0
jge 0x140022a3d
lea rdx, str.Fatal_error:_failed_to_acquire_SE_LOAD_DRIVER_PRIVILEGE._Make_sure_you_are_running_as_administrator.
lea rcx, [0x1400b5020]
call fcn.140007000
mov qword [rsp + 0xa0], rax
lea rdx, [0x14000c0b0]
mov rcx, qword [rsp + 0xa0]
call fcn.14000efd0
mov byte [rsp + 0x34], 0
lea rcx, [rsp + 0xd0]
call fcn.14000e770
nop
lea rcx, [rsp + 0x110]
call fcn.14000e770
nop
lea rcx, [rsp + 0xf0]
call fcn.14000e770
movzx eax, byte [rsp + 0x34]
jmp 0x140022b9d
lea r8, [rsp + 0xf0]
lea rdx, [0x1400531b0]
lea rcx, [rsp + 0x140]
call fcn.140022e20
nop
lea rcx, [rsp + 0x140]
call fcn.140014060
mov rdx, rax
lea rcx, [rsp + 0x130]
call sub.ntdll.dll_RtlInitUnicodeString
mov rax, qword [rsp + 0xa8]
mov qword [rsp + 0xb0], rax
lea rcx, [rsp + 0x130]
call qword [rsp + 0xb0]
mov dword [rsp + 0x3c], eax
lea rdx, str.___NtLoadDriver_Status_0x
lea rcx, [0x1400b5020]
call fcn.140007000
mov qword [rsp + 0xb8], rax
lea rdx, [0x140016310]
mov rcx, qword [rsp + 0xb8]
call fcn.14000f000
mov qword [rsp + 0x58], rax
mov edx, dword [rsp + 0x3c]
mov rcx, qword [rsp + 0x58]
call fcn.14001f420
mov qword [rsp + 0x60], rax
lea rdx, [0x14000c0b0]
mov rcx, qword [rsp + 0x60]
call fcn.14000efd0
cmp dword [rsp + 0x3c], 0xc000010e
jne 0x140022b3f
mov byte [rsp + 0x35], 1
lea rcx, [rsp + 0x140]
call fcn.14000e770
nop
lea rcx, [rsp + 0xd0]
call fcn.14000e770
nop
lea rcx, [rsp + 0x110]
call fcn.14000e770
nop
lea rcx, [rsp + 0xf0]
call fcn.14000e770
movzx eax, byte [rsp + 0x35]
jmp 0x140022b9d
cmp dword [rsp + 0x3c], 0
jl 0x140022b50
mov dword [rsp + 0x40], 1
jmp 0x140022b58
mov dword [rsp + 0x40], 0
movzx eax, byte [rsp + 0x40]
mov byte [rsp + 0x36], al
lea rcx, [rsp + 0x140]
call fcn.14000e770
nop
lea rcx, [rsp + 0xd0]
call fcn.14000e770
nop
lea rcx, [rsp + 0x110]
call fcn.14000e770
nop
lea rcx, [rsp + 0xf0]
call fcn.14000e770
movzx eax, byte [rsp + 0x36]
mov rcx, qword [rsp + 0x160]
xor rcx, rsp
call fcn.140027d50
add rsp, 0x178
ret