Function at 0xbef073d0
Capabilities:
Accept command line arguments
Create process on windows
Modify service
Query environment variable
Query service status
Set environment variable

Disassembly:
push rbp
push rdi
push r14
push r15
lea rbp, [rsp - 0x3f]
sub rsp, 0xf8
xor r8d, r8d
xor edx, edx
mov r15, rcx
xor edi, edi
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
jne 0xbef07706
mov r8d, 1
mov qword [rbp + 0x77], rdi
lea rdx, [0xbeef4520]
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov r14, rax
test rax, rax
je 0xbef07706
mov qword [rsp + 0xf0], rbx
lea rdx, [0xbeef4de8]
mov qword [rsp + 0xe8], rsi
mov r8d, 3
mov rcx, rax
mov qword [rsp + 0xe0], r12
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rbx, rax
test rax, rax
je 0xbef074ec
mov rcx, qword [0xbef0e4e0]
xor edx, edx
mov r8d, 0x2000
mov dword [rbp + 0x6f], 0x2000
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov r8d, dword [rbp + 0x6f]
lea r9, [rbp + 0x6f]
mov rdx, rax
mov rcx, rbx
mov rsi, rax
call qword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
test eax, eax
je 0xbef07497
cmp dword [rsi + 4], 4
jb 0xbef074d1
mov qword [rsp + 0x50], rdi
mov edx, 0xffffffff
mov qword [rsp + 0x48], rdi
mov r9d, edx
mov qword [rsp + 0x40], rdi
mov r8d, 3
mov qword [rsp + 0x38], rdi
mov rcx, r14
mov qword [rsp + 0x30], rdi
mov qword [rsp + 0x28], rdi
mov qword [rsp + 0x20], rdi
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfigW]
mov rcx, qword [0xbef0e4e0]
mov r8, rsi
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea rbx, [0xbeef5360]
lea r12, [0xbeef5370]
nop word [rax + rax]
mov rdx, qword [rbx]
mov r8d, 4
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rsi, rax
test rax, rax
je 0xbef075eb
lea rax, [rbp + 0x6f]
mov r9d, 0x24
lea r8, [rbp - 9]
mov qword [rsp + 0x20], rax
xor edx, edx
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0xbef075dc
xor eax, eax
mov dword [rbp - 0x39], 0x30
mov qword [rbp - 0x11], rax
lea r9, [rbp - 0x51]
mov eax, dword [rbp + 0x13]
lea r8, [rbp - 0x39]
xorps xmm0, xmm0
mov qword [rbp - 0x51], rax
mov rax, qword [0xbef0de98]
lea rcx, [rbp - 0x59]
mov edx, 0x1000
mov qword [rbp - 0x49], rdi
movups xmmword [rbp - 0x31], xmm0
movups xmmword [rbp - 0x21], xmm0
call rax
test eax, eax
jne 0xbef075dc
mov rax, qword [0xbef0df78]
lea r8, [rbp + 0x7f]
mov rcx, qword [rbp - 0x59]
mov edx, 2
call rax
test eax, eax
jne 0xbef075d2
mov rcx, qword [rbp + 0x7f]
lea rax, [rbp + 0x77]
mov qword [rsp + 0x28], rax
mov r9d, 1
xor r8d, r8d
mov dword [rsp + 0x20], 1
mov edx, 0x2000000
call qword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
mov rcx, qword [rbp + 0x7f]
call qword [0xbef0e4f8]
mov rcx, qword [rbp - 0x59]
call qword [0xbef0e4f8]
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
cmp qword [rbp + 0x77], rdi
jne 0xbef075f8
add rbx, 8
cmp rbx, r12
jne 0xbef07500
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov r12, qword [rsp + 0xe0]
cmp qword [rbp + 0x77], rdi
je 0xbef076e6
mov rcx, qword [0xbef0e4e0]
xor edx, edx
mov r8d, 0x2000
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov r9d, 0x2000
mov qword [rsp + 0x20], rdi
mov r8, rax
mov edx, 0x2b
mov rcx, 0xffffffffffffffff
mov rsi, rax
call qword [0xbef0dec0]
movzx edx, word [rsi]
mov rcx, qword [rsi + 8]
shr rdx, 1
mov word [rcx + rdx*2], di
mov rcx, r15
mov rdx, qword [rsi + 8]
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
call qword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GetCommandLineW]
mov r8, qword [rsi + 8]
lea rcx, [rbp - 0x51]
mov qword [rsp + 0x40], rcx
mov r9, rax
lea rcx, [0xbef0d990]
xor edx, edx
mov qword [rsp + 0x38], rcx
mov rcx, qword [rbp + 0x77]
mov qword [rsp + 0x30], rdi
mov qword [rsp + 0x28], rbx
mov dword [rsp + 0x20], 0x480
call qword [sym.imp.ADVAPI32.dll_CreateProcessWithTokenW]
test eax, eax
je 0xbef076ca
mov rcx, qword [rbp - 0x49]
call qword [0xbef0e4f8]
mov rcx, qword [rbp - 0x51]
call qword [0xbef0e4f8]
mov edi, dword [rbp - 0x41]
mov rcx, qword [0xbef0e4e0]
mov r8, rsi
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rcx, qword [rbp + 0x77]
call qword [0xbef0e4f8]
mov rsi, qword [rsp + 0xe8]
mov eax, edi
mov rbx, qword [rsp + 0xf0]
add rsp, 0xf8
pop r15
pop r14
pop rdi
pop rbp
ret
xor eax, eax
add rsp, 0xf8
pop r15
pop r14
pop rdi
pop rbp
ret