Function at 0x140006240
Capabilities:
Create service
Modify service

Disassembly:
mov rax, rsp
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rax - 0x48]
sub rsp, 0x110
mov qword [rbp - 0x40], 0xfffffffffffffffe
mov qword [rax + 0x18], rbx
mov rax, qword [0x14014d030]
xor rax, rsp
mov qword [rbp + 8], rax
mov rdi, rdx
mov r14, rcx
lea r15, [0x14014dd40]
mov rcx, qword [0x14014dd40]
cmp rcx, r15
je 0x1400062b0
test byte [rcx + 0x1c], 1
je 0x1400062b0
cmp byte [rcx + 0x19], 5
jb 0x1400062b0
mov edx, 0x1d
mov r9, rdi
lea r8, [0x14011a3d8]
mov rcx, qword [rcx + 0x10]
call fcn.140003638
xor r13d, r13d
mov esi, r13d
mov rax, qword [0x14014e920]
mov rbx, qword [rax + 0x18]
mov rcx, rbx
call qword [fcn.140009050]
lea rcx, [0x14014e920]
call rbx
add rax, 0x18
mov qword [rsp + 0x78], rax
mov rax, qword [0x14014e920]
mov rbx, qword [rax + 0x18]
mov rcx, rbx
call qword [fcn.140009050]
lea rcx, [0x14014e920]
call rbx
add rax, 0x18
mov qword [rsp + 0x70], rax
mov qword [rbp - 0x58], r13
mov qword [rbp - 0x50], r13
mov qword [rbp - 0x48], r13
lea rdx, str.SYSTEMCurrentControlSetServices_
lea rcx, [rbp - 0x78]
call fcn.140004d1c
nop
mov rdx, qword [r14 + 0x28]
mov r8d, dword [rdx - 0x10]
lea rcx, [rbp - 0x78]
call fcn.1400046e8
mov ebx, dword [r14 + 0x30]
mov ecx, ebx
call fcn.140004a9c
test rax, rax
je 0x140006354
mov r8d, ebx
mov rdx, rax
lea rcx, [rsp + 0x78]
call fcn.140004bd4
test eax, eax
jne 0x14000636b
mov r8d, reloc.OLEAUT32.dll_SafeArrayDestroy
lea rdx, str.UNKNOWN_SERVICE
lea rcx, [rsp + 0x78]
call fcn.1400051bc
mov ebx, dword [r14 + 0x34]
mov ecx, ebx
call fcn.140004a9c
test rax, rax
je 0x14000638f
mov r8d, ebx
mov rdx, rax
lea rcx, [rsp + 0x70]
call fcn.140004bd4
test eax, eax
jne 0x140006399
lea rcx, [rsp + 0x70]
call fcn.140004f24
mov rcx, r14
call fcn.140006084
mov ebx, 2
test eax, eax
jne 0x140006788
mov esi, 0xf003f
mov r8d, esi
xor edx, edx
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov r12, rax
test rax, rax
jne 0x140006415
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov rcx, qword [0x14014dd40]
cmp rcx, r15
je 0x1400063fc
test byte [rcx + 0x1c], bl
je 0x1400063fc
cmp byte [rcx + 0x19], bl
jb 0x1400063fc
lea edx, [rbx + 0x1c]
mov r9d, eax
lea r8, [0x14011a3d8]
mov rcx, qword [rcx + 0x10]
call fcn.1400036d4
cmp esi, 5
jne 0x14000640b
mov edi, 0xc00d37dc
jmp 0x140006830
mov edi, 0xc00d37dd
jmp 0x14000678d
lea rax, [0x14011a1b8]
mov qword [rsp + 0x60], rax
lea rax, str.NT_AUTHORITYNetworkService
mov qword [rsp + 0x58], rax
mov qword [rsp + 0x50], rdi
mov qword [rsp + 0x48], r13
mov qword [rsp + 0x40], r13
mov rax, qword [0x14014f8d0]
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 1
mov dword [rsp + 0x28], 3
mov dword [rsp + 0x20], reloc.OLEAUT32.dll_SafeArrayGetDim
mov r9d, 0xf01ff
mov r8, qword [rsp + 0x78]
mov rdx, qword [r14 + 0x28]
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov r15, rax
test rax, rax
jne 0x1400064d5
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov rcx, qword [0x14014dd40]
lea r15, [0x14014dd40]
cmp rcx, r15
je 0x1400064c2
test byte [rcx + 0x1c], bl
je 0x1400064c2
cmp byte [rcx + 0x19], bl
jb 0x1400064c2
mov edx, 0x1f
mov dword [rsp + 0x20], eax
mov r9, qword [r14 + 0x28]
lea r8, [0x14011a3d8]
mov rcx, qword [rcx + 0x10]
call fcn.1400056b0
mov edi, 0xc00d37de
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x14000678d
mov qword [rbp - 0x68], r13
lea rax, [rbp - 0x68]
mov qword [rsp + 0x20], rax
mov r9d, esi
xor r8d, r8d
mov rdx, qword [rbp - 0x78]
mov rcx, 0xffffffff80000002
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov esi, eax
test eax, eax
jne 0x14000650a
mov esi, r13d
mov rax, qword [rbp - 0x68]
mov qword [rbp - 0x58], rax
mov edi, 0xc00d37df
mov rax, qword [rsp + 0x70]
cmp dword [rax - 0x10], r13d
je 0x1400065af
mov qword [rbp - 0x60], rax
mov rcx, qword [0x14014dd40]
lea rax, [0x14014dd40]
cmp rcx, rax
je 0x140006555
test byte [rcx + 0x1c], bl
je 0x140006555
cmp byte [rcx + 0x19], 4
jb 0x140006555
mov edx, 0x20
lea r8, [0x14011a3d8]
mov rcx, qword [rcx + 0x10]
call fcn.140003614
lea r8, [rbp - 0x60]
mov edx, 1
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
test eax, eax
jne 0x1400065af
mov rbx, qword [0x14014dd40]
lea rax, [0x14014dd40]
cmp rbx, rax
je 0x1400065b6
test byte [rbx + 0x1c], 2
je 0x1400065b6
cmp byte [rbx + 0x19], 3
jb 0x1400065b6
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9d, eax
mov edx, 0x21
lea r8, [0x14011a3d8]
mov rcx, qword [0x14014dd40]
mov rcx, qword [rcx + 0x10]
call fcn.1400036d4
mov rbx, qword [0x14014dd40]
mov ecx, 1
mov dword [rbp - 0x10], ecx
mov eax, 0x7530
mov dword [rbp - 0xc], eax
mov dword [rbp - 8], ecx
mov qword [rbp - 4], rax
mov dword [rbp + 4], r13d
mov dword [rbp - 0x38], r13d
xor edx, edx
lea r8d, [rcx + 0x1f]
lea rcx, [rbp - 0x30]
call sub.msvcrt.dll_memset
mov dword [rbp - 0x20], 3
lea rax, [rbp - 0x10]
mov qword [rbp - 0x18], rax
lea rax, [0x14014dd40]
cmp rbx, rax
je 0x140006620
test byte [rbx + 0x1c], 2
je 0x140006620
cmp byte [rbx + 0x19], 4
jb 0x140006620
mov edx, 0x22
lea r8, [0x14011a3d8]
mov rcx, qword [rbx + 0x10]
call fcn.140003614
lea r8, [rbp - 0x38]
mov ebx, 2
mov edx, ebx
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
test eax, eax
jne 0x140006679
mov rax, qword [0x14014dd40]
lea rcx, [0x14014dd40]
cmp rax, rcx
je 0x140006679
test byte [rax + 0x1c], bl
je 0x140006679
cmp byte [rax + 0x19], 3
jb 0x140006679
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9d, eax
lea edx, [rbx + 0x21]
lea r8, [0x14011a3d8]
mov rcx, qword [0x14014dd40]
mov rcx, qword [rcx + 0x10]
call fcn.1400036d4
mov byte [rsp + 0x20], r13b
mov r9d, 0x2019d
mov r8d, ebx
lea rdx, str.S_1_5_4
mov rcx, r15
call fcn.1400bcfd0
test eax, eax
jne 0x1400066cd
mov rcx, qword [0x14014dd40]
lea rax, [0x14014dd40]
cmp rcx, rax
je 0x1400066db
test byte [rcx + 0x1c], bl
je 0x1400066db
cmp byte [rcx + 0x19], 3
jb 0x1400066db
mov edx, 0x24
lea r8, [0x14011a3d8]
mov rcx, qword [rcx + 0x10]
call fcn.140003614
lea rax, [0x14014dd40]
mov rcx, qword [0x14014dd40]
mov dword [rbp - 0x80], 1
cmp rcx, rax
je 0x140006707
test byte [rcx + 0x1c], bl
je 0x140006707
cmp byte [rcx + 0x19], 4
jb 0x140006707
mov edx, 0x25
lea r8, [0x14011a3d8]
mov rcx, qword [rcx + 0x10]
call fcn.140003614
lea r8, [rbp - 0x80]
mov edx, 5
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
test eax, eax
jne 0x140006760
mov rax, qword [0x14014dd40]
lea rcx, [0x14014dd40]
cmp rax, rcx
je 0x140006760
test byte [rax + 0x1c], bl
je 0x140006760
cmp byte [rax + 0x19], 3
jb 0x140006760
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9d, eax
mov edx, 0x26
lea r8, [0x14011a3d8]
mov rcx, qword [0x14014dd40]
mov rcx, qword [rcx + 0x10]
call fcn.1400036d4
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea r15, [0x14014dd40]
test esi, esi
jne 0x140006830
mov edi, 0x400d3778
jmp 0x14000678d
mov edi, 0x400d3779
test esi, esi
jne 0x140006830
lea edx, [rsi + 4]
mov qword [rsp + 0x28], r13
mov qword [rsp + 0x20], r13
mov r9, qword [r14 + 0x28]
mov r8d, edi
mov rcx, r14
call fcn.140005ed8
xor r8d, r8d
mov edx, edi
call fcn.140015ec8
cmp edi, 0x400d3779
jne 0x140006804
mov r10, qword [0x14014dd40]
cmp r10, r15
je 0x140006938
test byte [r10 + 0x1c], bl
je 0x1400068fe
cmp byte [r10 + 0x19], 4
jb 0x1400068fe
lea edx, [rsi + 0x27]
mov r9, qword [r14 + 0x28]
lea r8, [0x14011a3d8]
mov rcx, qword [r10 + 0x10]
call fcn.140003638
jmp 0x1400068f7
mov r10, qword [0x14014dd40]
cmp r10, r15
je 0x140006938
test byte [r10 + 0x1c], bl
je 0x1400068fe
cmp byte [r10 + 0x19], 4
jb 0x1400068fe
mov edx, 0x28
jmp 0x1400067eb
mov rax, qword [0x14014e920]
mov rbx, qword [rax + 0x18]
mov rcx, rbx
call qword [fcn.140009050]
lea rcx, [0x14014e920]
call rbx
add rax, 0x18
mov qword [rbp - 0x70], rax
mov r8d, esi
lea rdx, [0x14011a3c0]
lea rcx, [rbp - 0x70]
call fcn.14000916c
mov edx, 1
mov qword [rsp + 0x28], r13
mov rbx, qword [rbp - 0x70]
mov qword [rsp + 0x20], rbx
mov r9, qword [r14 + 0x28]
mov r8d, edi
mov rcx, r14
call fcn.140005ed8
mov r8d, esi
mov edx, edi
call fcn.140015ec8
mov rcx, qword [0x14014dd40]
cmp rcx, r15
je 0x1400068ca
test byte [rcx + 0x1c], 2
je 0x1400068ca
cmp byte [rcx + 0x19], 2
jb 0x1400068ca
mov edx, 0x29
mov dword [rsp + 0x20], esi
mov r9, qword [r14 + 0x28]
lea r8, [0x14011a3d8]
mov rcx, qword [rcx + 0x10]
call fcn.1400056b0
nop
lea r14, [rbx - 0x18]
or eax, 0xffffffff
lock xadd dword [r14 + 0x10], eax
sub eax, 1
jg 0x1400068f7
mov rdi, qword [r14]
mov rax, qword [rdi]
mov rbx, qword [rax + 8]
mov rcx, rbx
call qword [fcn.140009050]
mov rdx, r14
mov rcx, rdi
call rbx
mov r10, qword [0x14014dd40]
cmp r10, r15
je 0x140006938
test byte [r10 + 0x1c], 1
je 0x140006938
movzx edx, byte [r10 + 0x19]
mov eax, esi
neg eax
sbb ecx, ecx
and ecx, 0xfffffffd
add ecx, 5
cmp edx, ecx
jl 0x140006938
mov edx, 0x2a
mov r9d, esi
lea r8, [0x14011a3d8]
mov rcx, qword [r10 + 0x10]
call fcn.1400036d4
nop
mov r14, qword [rbp - 0x78]
or eax, 0xffffffff
lock xadd dword [r14 - 8], eax
sub eax, 1
jg 0x140006968
mov rdi, qword [r14 - 0x18]
mov rax, qword [rdi]
mov rbx, qword [rax + 8]
mov rcx, rbx
call qword [fcn.140009050]
lea rdx, [r14 - 0x18]
mov rcx, rdi
call rbx
nop
mov rcx, qword [rbp - 0x58]
test rcx, rcx
je 0x140006978
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
nop
mov r14, qword [rsp + 0x70]
or eax, 0xffffffff
lock xadd dword [r14 - 8], eax
sub eax, 1
jg 0x1400069a9
mov rdi, qword [r14 - 0x18]
mov rax, qword [rdi]
mov rbx, qword [rax + 8]
mov rcx, rbx
call qword [fcn.140009050]
lea rdx, [r14 - 0x18]
mov rcx, rdi
call rbx
nop
mov r14, qword [rsp + 0x78]
or eax, 0xffffffff
lock xadd dword [r14 - 8], eax
sub eax, 1
jg 0x1400069d9
mov rdi, qword [r14 - 0x18]
mov rax, qword [rdi]
mov rbx, qword [rax + 8]
mov rcx, rbx
call qword [fcn.140009050]
lea rdx, [r14 - 0x18]
mov rcx, rdi
call rbx
mov eax, esi
mov rcx, qword [rbp + 8]
xor rcx, rsp
call fcn.140106ed0
mov rbx, qword [rsp + 0x160]
add rsp, 0x110
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret