Function at 0x140012920
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 [0x140148058]
xor rax, rsp
mov qword [rbp + 8], rax
mov rdi, rdx
mov r14, rcx
lea r15, [0x140148ea8]
mov rcx, qword [0x140148ea8]
cmp rcx, r15
je 0x140012990
test byte [rcx + 0x1c], 1
je 0x140012990
cmp byte [rcx + 0x19], 5
jb 0x140012990
mov edx, 0x1d
mov r9, rdi
lea r8, [0x1400057f8]
mov rcx, qword [rcx + 0x10]
call fcn.14000fcd0
xor r13d, r13d
mov esi, r13d
mov rax, qword [section..data]
mov rbx, qword [rax + 0x18]
mov rcx, rbx
call qword [fcn.140015690]
lea rcx, section..data
call rbx
add rax, 0x18
mov qword [rsp + 0x78], rax
mov rax, qword [section..data]
mov rbx, qword [rax + 0x18]
mov rcx, rbx
call qword [fcn.140015690]
lea rcx, section..data
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, [0x1400130d0]
lea rcx, [rbp - 0x78]
call fcn.140011450
nop
mov rdx, qword [r14 + 0x28]
mov r8d, dword [rdx - 0x10]
lea rcx, [rbp - 0x78]
call fcn.140010e38
mov ebx, dword [r14 + 0x30]
mov ecx, ebx
call fcn.1400111d0
test rax, rax
je 0x140012a34
mov r8d, ebx
mov rdx, rax
lea rcx, [rsp + 0x78]
call fcn.140011310
test eax, eax
jne 0x140012a4b
mov r8d, reloc.OLEAUT32.dll_SafeArrayDestroy
lea rdx, [0x140013118]
lea rcx, [rsp + 0x78]
call fcn.1400118b4
mov ebx, dword [r14 + 0x34]
mov ecx, ebx
call fcn.1400111d0
test rax, rax
je 0x140012a6f
mov r8d, ebx
mov rdx, rax
lea rcx, [rsp + 0x70]
call fcn.140011310
test eax, eax
jne 0x140012a79
lea rcx, [rsp + 0x70]
call fcn.140011644
mov rcx, r14
call fcn.140012770
mov ebx, 2
test eax, eax
jne 0x140012e68
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 0x140012af5
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov rcx, qword [0x140148ea8]
cmp rcx, r15
je 0x140012adc
test byte [rcx + 0x1c], bl
je 0x140012adc
cmp byte [rcx + 0x19], bl
jb 0x140012adc
lea edx, [rbx + 0x1c]
mov r9d, eax
lea r8, [0x1400057f8]
mov rcx, qword [rcx + 0x10]
call fcn.14000fd64
cmp esi, 5
jne 0x140012aeb
mov edi, 0xc00d37dc
jmp 0x140012f10
mov edi, 0xc00d37dd
jmp 0x140012e6d
lea rax, [0x1400055f4]
mov qword [rsp + 0x60], rax
lea rax, [0x140013138]
mov qword [rsp + 0x58], rax
mov qword [rsp + 0x50], rdi
mov qword [rsp + 0x48], r13
mov qword [rsp + 0x40], r13
mov rax, qword [0x14014ba90]
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 0x140012bb5
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov rcx, qword [0x140148ea8]
lea r15, [0x140148ea8]
cmp rcx, r15
je 0x140012ba2
test byte [rcx + 0x1c], bl
je 0x140012ba2
cmp byte [rcx + 0x19], bl
jb 0x140012ba2
mov edx, 0x1f
mov dword [rsp + 0x20], eax
mov r9, qword [r14 + 0x28]
lea r8, [0x1400057f8]
mov rcx, qword [rcx + 0x10]
call fcn.140011da0
mov edi, 0xc00d37de
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x140012e6d
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 0x140012bea
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 0x140012c8f
mov qword [rbp - 0x60], rax
mov rcx, qword [0x140148ea8]
lea rax, [0x140148ea8]
cmp rcx, rax
je 0x140012c35
test byte [rcx + 0x1c], bl
je 0x140012c35
cmp byte [rcx + 0x19], 4
jb 0x140012c35
mov edx, 0x20
lea r8, [0x1400057f8]
mov rcx, qword [rcx + 0x10]
call fcn.14000fcb0
lea r8, [rbp - 0x60]
mov edx, 1
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
test eax, eax
jne 0x140012c8f
mov rbx, qword [0x140148ea8]
lea rax, [0x140148ea8]
cmp rbx, rax
je 0x140012c96
test byte [rbx + 0x1c], 2
je 0x140012c96
cmp byte [rbx + 0x19], 3
jb 0x140012c96
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9d, eax
mov edx, 0x21
lea r8, [0x1400057f8]
mov rcx, qword [0x140148ea8]
mov rcx, qword [rcx + 0x10]
call fcn.14000fd64
mov rbx, qword [0x140148ea8]
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, [0x140148ea8]
cmp rbx, rax
je 0x140012d00
test byte [rbx + 0x1c], 2
je 0x140012d00
cmp byte [rbx + 0x19], 4
jb 0x140012d00
mov edx, 0x22
lea r8, [0x1400057f8]
mov rcx, qword [rbx + 0x10]
call fcn.14000fcb0
lea r8, [rbp - 0x38]
mov ebx, 2
mov edx, ebx
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
test eax, eax
jne 0x140012d59
mov rax, qword [0x140148ea8]
lea rcx, [0x140148ea8]
cmp rax, rcx
je 0x140012d59
test byte [rax + 0x1c], bl
je 0x140012d59
cmp byte [rax + 0x19], 3
jb 0x140012d59
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9d, eax
lea edx, [rbx + 0x21]
lea r8, [0x1400057f8]
mov rcx, qword [0x140148ea8]
mov rcx, qword [rcx + 0x10]
call fcn.14000fd64
mov byte [rsp + 0x20], r13b
mov r9d, 0x2019d
mov r8d, ebx
lea rdx, [0x1400057d0]
mov rcx, r15
call fcn.1400d1990
test eax, eax
jne 0x140012dad
mov rcx, qword [0x140148ea8]
lea rax, [0x140148ea8]
cmp rcx, rax
je 0x140012dbb
test byte [rcx + 0x1c], bl
je 0x140012dbb
cmp byte [rcx + 0x19], 3
jb 0x140012dbb
mov edx, 0x24
lea r8, [0x1400057f8]
mov rcx, qword [rcx + 0x10]
call fcn.14000fcb0
lea rax, [0x140148ea8]
mov rcx, qword [0x140148ea8]
mov dword [rbp - 0x80], 1
cmp rcx, rax
je 0x140012de7
test byte [rcx + 0x1c], bl
je 0x140012de7
cmp byte [rcx + 0x19], 4
jb 0x140012de7
mov edx, 0x25
lea r8, [0x1400057f8]
mov rcx, qword [rcx + 0x10]
call fcn.14000fcb0
lea r8, [rbp - 0x80]
mov edx, 5
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
test eax, eax
jne 0x140012e40
mov rax, qword [0x140148ea8]
lea rcx, [0x140148ea8]
cmp rax, rcx
je 0x140012e40
test byte [rax + 0x1c], bl
je 0x140012e40
cmp byte [rax + 0x19], 3
jb 0x140012e40
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9d, eax
mov edx, 0x26
lea r8, [0x1400057f8]
mov rcx, qword [0x140148ea8]
mov rcx, qword [rcx + 0x10]
call fcn.14000fd64
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea r15, [0x140148ea8]
test esi, esi
jne 0x140012f10
mov edi, 0x400d3778
jmp 0x140012e6d
mov edi, 0x400d3779
test esi, esi
jne 0x140012f10
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.1400125c4
xor r8d, r8d
mov edx, edi
call fcn.140022c78
cmp edi, 0x400d3779
jne 0x140012ee4
mov r10, qword [0x140148ea8]
cmp r10, r15
je 0x140013012
test byte [r10 + 0x1c], bl
je 0x140012fd8
cmp byte [r10 + 0x19], 4
jb 0x140012fd8
lea edx, [rsi + 0x27]
mov r9, qword [r14 + 0x28]
lea r8, [0x1400057f8]
mov rcx, qword [r10 + 0x10]
call fcn.14000fcd0
jmp 0x140012fd1
mov r10, qword [0x140148ea8]
cmp r10, r15
je 0x140013012
test byte [r10 + 0x1c], bl
je 0x140012fd8
cmp byte [r10 + 0x19], 4
jb 0x140012fd8
mov edx, 0x28
jmp 0x140012ecb
mov rax, qword [section..data]
mov rbx, qword [rax + 0x18]
mov rcx, rbx
call qword [fcn.140015690]
lea rcx, section..data
call rbx
add rax, 0x18
mov qword [rbp - 0x70], rax
mov r8d, esi
lea rdx, [0x1400057e0]
lea rcx, [rbp - 0x70]
call fcn.1400157a0
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.1400125c4
mov r8d, esi
mov edx, edi
call fcn.140022c78
mov rcx, qword [0x140148ea8]
cmp rcx, r15
je 0x140012faa
test byte [rcx + 0x1c], 2
je 0x140012faa
cmp byte [rcx + 0x19], 2
jb 0x140012faa
mov edx, 0x29
mov dword [rsp + 0x20], esi
mov r9, qword [r14 + 0x28]
lea r8, [0x1400057f8]
mov rcx, qword [rcx + 0x10]
call fcn.140011da0
nop
lea r14, [rbx - 0x18]
lock add dword [r14 + 0x10], 0xffffffff
jg 0x140012fd1
mov rdi, qword [r14]
mov rax, qword [rdi]
mov rbx, qword [rax + 8]
mov rcx, rbx
call qword [fcn.140015690]
mov rdx, r14
mov rcx, rdi
call rbx
mov r10, qword [0x140148ea8]
cmp r10, r15
je 0x140013012
test byte [r10 + 0x1c], 1
je 0x140013012
movzx edx, byte [r10 + 0x19]
mov eax, esi
neg eax
sbb ecx, ecx
and ecx, 0xfffffffd
add ecx, 5
cmp edx, ecx
jl 0x140013012
mov edx, 0x2a
mov r9d, esi
lea r8, [0x1400057f8]
mov rcx, qword [r10 + 0x10]
call fcn.14000fd64
nop
mov r14, qword [rbp - 0x78]
lock add dword [r14 - 8], 0xffffffff
jg 0x14001303c
mov rdi, qword [r14 - 0x18]
mov rax, qword [rdi]
mov rbx, qword [rax + 8]
mov rcx, rbx
call qword [fcn.140015690]
lea rdx, [r14 - 0x18]
mov rcx, rdi
call rbx
nop
mov rcx, qword [rbp - 0x58]
test rcx, rcx
je 0x14001304c
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
nop
mov r14, qword [rsp + 0x70]
lock add dword [r14 - 8], 0xffffffff
jg 0x140013077
mov rdi, qword [r14 - 0x18]
mov rax, qword [rdi]
mov rbx, qword [rax + 8]
mov rcx, rbx
call qword [fcn.140015690]
lea rdx, [r14 - 0x18]
mov rcx, rdi
call rbx
nop
mov r14, qword [rsp + 0x78]
lock add dword [r14 - 8], 0xffffffff
jg 0x1400130a1
mov rdi, qword [r14 - 0x18]
mov rax, qword [rdi]
mov rbx, qword [rax + 8]
mov rcx, rbx
call qword [fcn.140015690]
lea rdx, [r14 - 0x18]
mov rcx, rdi
call rbx
mov eax, esi
mov rcx, qword [rbp + 8]
xor rcx, rsp
call fcn.140001000
mov rbx, qword [rsp + 0x160]
add rsp, 0x110
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret