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

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
mov qword [rsp + 0x20], rdi
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x37]
sub rsp, 0xa0
mov rax, qword [0x18004e508]
xor rax, rsp
mov qword [rbp + 0x27], rax
mov rdi, rcx
mov qword [rbp - 0x11], rcx
call fcn.1800015f0
mov rcx, rax
test rax, rax
je 0x18002f121
mov rax, qword [rax]
call qword [rax + 0x18]
add rax, 0x18
mov qword [rbp + 7], rax
call fcn.1800015f0
mov rcx, rax
test rax, rax
je 0x18002f12c
mov rax, qword [rax]
call qword [rax + 0x18]
lea rbx, [rax + 0x18]
mov qword [rbp + 0xf], rbx
xor esi, esi
lea r14, [rsi - 1]
cmp qword [rdi + 8], rsi
je 0x18002f0aa
cmp qword [rdi + 0x10], rsi
je 0x18002f0aa
lea rdx, str.SystemCurrentControlSetServices_
mov rax, r14
nop dword [rax + rax]
inc rax
cmp word [rdx + rax*2], si
jne 0x18002ed50
mov r8d, eax
lea rcx, [rbp + 7]
call fcn.180006f60
mov r15, qword [rdi + 8]
movsxd rax, dword [r15 - 0x10]
mov r13, r15
mov rdi, qword [rbp + 7]
sub r13, rdi
sar r13, 1
mov ebx, dword [rdi - 0x10]
mov dword [rbp - 0x19], ebx
test eax, eax
js 0x18002f116
test r15, r15
jne 0x18002ed92
mov r12d, esi
jmp 0x18002eda1
mov rdx, rax
mov rcx, r15
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsnlen]
mov r12, rax
mov ecx, 0x7fffffff
sub ecx, r12d
cmp ecx, ebx
jl 0x18002f116
add ebx, r12d
js 0x18002f116
mov ecx, 1
sub ecx, dword [rdi - 8]
mov eax, dword [rdi - 0xc]
sub eax, ebx
or eax, ecx
jge 0x18002edda
mov edx, ebx
lea rcx, [rbp + 7]
call fcn.1800071b0
mov rdi, qword [rbp + 7]
mov eax, dword [rbp - 0x19]
cmp r13, rax
ja 0x18002ede6
lea r15, [rdi + r13*2]
lea rcx, [rdi + rax*2]
movsxd r8, r12d
add r8, r8
je 0x18002ee1f
test rcx, rcx
je 0x18002ee0d
test r15, r15
je 0x18002ee06
mov rdx, r15
call sub.VCRUNTIME140.dll_memcpy
jmp 0x18002ee1f
xor edx, edx
call sub.VCRUNTIME140.dll_memset
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], 0x16
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
cmp ebx, dword [rdi - 0xc]
jg 0x18002f116
mov dword [rdi - 0x10], ebx
movsxd rax, ebx
mov word [rdi + rax*2], si
lea rdx, str.___
mov rax, r14
nop dword [rax]
inc rax
cmp word [rdx + rax*2], si
jne 0x18002ee40
mov r8d, eax
lea rcx, [rbp + 0xf]
call fcn.180006f60
mov r13, qword [rbp - 0x11]
mov r13, qword [r13 + 0x10]
movsxd rcx, dword [r13 - 0x10]
mov rax, r13
mov rbx, qword [rbp + 0xf]
sub rax, rbx
sar rax, 1
mov qword [rbp - 9], rax
mov r15d, dword [rbx - 0x10]
mov dword [rbp - 0x19], r15d
test ecx, ecx
js 0x18002f116
test r13, r13
jne 0x18002ee8f
mov edx, esi
mov qword [rbp - 0x11], rdx
jmp 0x18002eea2
mov rdx, rcx
mov rcx, r13
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsnlen]
mov rdx, rax
mov qword [rbp - 0x11], rax
mov eax, 0x7fffffff
sub eax, edx
cmp eax, r15d
jl 0x18002f116
add r15d, edx
js 0x18002f116
mov r12d, 1
mov ecx, r12d
sub ecx, dword [rbx - 8]
mov eax, dword [rbx - 0xc]
sub eax, r15d
or eax, ecx
jge 0x18002eee5
mov edx, r15d
lea rcx, [rbp + 0xf]
call fcn.1800071b0
mov rbx, qword [rbp + 0xf]
mov rdx, qword [rbp - 0x11]
mov eax, dword [rbp - 0x19]
mov rcx, qword [rbp - 9]
cmp rcx, rax
ja 0x18002eef5
lea r13, [rbx + rcx*2]
lea rcx, [rbx + rax*2]
movsxd r8, edx
add r8, r8
je 0x18002ef2e
test rcx, rcx
je 0x18002ef1c
test r13, r13
je 0x18002ef15
mov rdx, r13
call sub.VCRUNTIME140.dll_memcpy
jmp 0x18002ef2e
xor edx, edx
call sub.VCRUNTIME140.dll_memset
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], 0x16
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
cmp r15d, dword [rbx - 0xc]
jg 0x18002f116
mov dword [rbx - 0x10], r15d
movsxd rax, r15d
mov word [rbx + rax*2], si
cmp dword [rdi - 8], r12d
jle 0x18002ef59
mov edx, dword [rdi - 0x10]
lea rcx, [rbp + 7]
call fcn.180006ba0
mov rdi, qword [rbp + 7]
lea rax, [rbp + 0x17]
mov qword [rsp + 0x40], rax
lea rax, [rbp - 1]
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], rsi
mov dword [rsp + 0x28], 0xf003f
mov dword [rsp + 0x20], esi
xor r9d, r9d
xor r8d, r8d
mov rdx, rdi
mov rcx, 0xffffffff80000002
call qword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
jne 0x18002f0aa
cmp dword [rbp + 0x17], r12d
je 0x18002efaf
lea rdx, str.RegCreateKeyEx_return_REG_CREATED_NEW_KEY
lea ecx, [rax + 2]
call fcn.18002fab0
mov edx, dword [rbx - 0x10]
lea edi, [rdx*2 + 2]
cmp dword [rbx - 8], r12d
jle 0x18002efcc
lea rcx, [rbp + 0xf]
call fcn.180006ba0
mov rbx, qword [rbp + 0xf]
mov dword [rsp + 0x28], edi
mov qword [rsp + 0x20], rbx
mov r9d, 2
xor r8d, r8d
lea rdx, str.ImagePath
mov rcx, qword [rbp - 1]
call qword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov rcx, qword [rbp - 1]
test eax, eax
jne 0x18002f0a4
mov dword [rbp + 0x1b], r12d
mov dword [rsp + 0x28], 4
lea rax, [rbp + 0x1b]
mov qword [rsp + 0x20], rax
mov r9d, 4
xor r8d, r8d
lea rdx, str.Type
call qword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov esi, eax
mov rcx, qword [rbp - 1]
test eax, eax
jne 0x18002f0a4
mov dword [rbp + 0x1f], r12d
mov dword [rsp + 0x28], 4
lea rax, [rbp + 0x1f]
mov qword [rsp + 0x20], rax
lea r9d, [rsi + 4]
xor r8d, r8d
lea rdx, str.ErrorControl
call qword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov esi, eax
mov rcx, qword [rbp - 1]
test eax, eax
jne 0x18002f0a4
mov dword [rbp + 0x23], 3
mov dword [rsp + 0x28], 4
lea rax, [rbp + 0x23]
mov qword [rsp + 0x20], rax
lea r9d, [rsi + 4]
xor r8d, r8d
lea rdx, str.Start
call qword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov rdx, qword [rbp - 1]
call fcn.18002f140
mov rcx, qword [rbp - 1]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x18002f0ad
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov r12d, esi
lea rdx, [rbx - 0x18]
mov eax, r14d
lock xadd dword [rdx + 0x10], eax
sub eax, 1
jg 0x18002f0c8
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + 8]
nop
mov rdx, qword [rbp + 7]
add rdx, 0xffffffffffffffe8
lock xadd dword [rdx + 0x10], r14d
sub r14d, 1
jg 0x18002f0e6
mov rcx, qword [rdx]
mov r8, qword [rcx]
call qword [r8 + 8]
mov eax, r12d
mov rcx, qword [rbp + 0x27]
xor rcx, rsp
call fcn.18002ce50
lea r11, [rsp + 0xa0]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret
mov ecx, 0x80070057
call fcn.180001450
nop
mov ecx, 0x80004005
call fcn.180001450
nop
mov ecx, 0x80004005
call fcn.180001450
int3