Function at 0x140009080
Capabilities:
Query environment variable
Stop service

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r13
push r14
push r15
lea rbp, [rsp - 0x1d0]
sub rsp, 0x2d0
mov qword [rsp + 0x78], 0xfffffffffffffffe
mov r15, rcx
mov rcx, qword [0x1400206c0]
call fcn.140006550
test eax, eax
jne 0x140009760
call fcn.1400057f0
mov byte [0x140029b2c], 0
mov r14d, 1
mov r8d, dword [0x1400238f4]
test r8d, r8d
jle 0x1400090fb
lea rdx, str.VRAY_NUM_THREADS_d
lea rcx, [rbp - 0x30]
call fcn.14000d140
lea rcx, [rbp - 0x30]
call qword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll__putenv]
mov byte [0x140029b2c], r14b
jmp 0x140009140
lea rcx, str.VRAY_NUM_THREADS
call qword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll_getenv]
test rax, rax
je 0x140009140
lea r8, [rbp + 0x218]
lea rdx, [0x14001557c]
mov rcx, rax
call fcn.14000d1a0
cmp eax, r14d
jne 0x140009140
movzx eax, byte [0x140029b2c]
cmp dword [rbp + 0x218], 0
cmovg eax, r14d
mov byte [0x140029b2c], al
call fcn.14000b440
call fcn.14000b970
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [0x140029cd4], eax
xor ecx, ecx
call qword [sym.imp.ole32.dll_CoInitialize]
xorps xmm0, xmm0
movdqu xmmword [rsp + 0x50], xmm0
xorps xmm1, xmm1
movdqu xmmword [rsp + 0x60], xmm1
xor r13d, r13d
mov qword [rsp + 0x70], r13
lea rcx, [rsp + 0x50]
call fcn.140006410
test eax, eax
js 0x1400092d3
mov qword [rbp + 0x228], r13
mov ebx, r13d
mov qword [rbp + 0x218], rbx
mov edi, r13d
mov qword [rbp + 0x220], r13
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov rcx, rax
lea r9, [rbp + 0x228]
xor r8d, r8d
lea edx, [r13 + 8]
call qword [sym.imp.ADVAPI32.dll_OpenThreadToken]
test eax, eax
je 0x1400091ff
lea r8, [rbp + 0x220]
lea rdx, [rbp + 0x218]
mov rcx, qword [rbp + 0x228]
call fcn.1400061e0
mov esi, eax
mov rcx, qword [rbp + 0x228]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rbx, qword [rbp + 0x218]
mov rdi, qword [rbp + 0x220]
jmp 0x140009206
call fcn.1400044f0
mov esi, eax
cmp si, 0x3f0
jne 0x140009287
mov qword [rbp + 0x228], r13
mov rbx, r13
mov qword [rbp + 0x218], rbx
mov rdi, r13
mov qword [rbp + 0x220], r13
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rcx, rax
lea r8, [rbp + 0x228]
mov edx, 8
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x140009280
lea r8, [rbp + 0x220]
lea rdx, [rbp + 0x218]
mov rcx, qword [rbp + 0x228]
call fcn.1400061e0
mov esi, eax
mov rcx, qword [rbp + 0x228]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rbx, qword [rbp + 0x218]
mov rdi, qword [rbp + 0x220]
jmp 0x140009287
call fcn.1400044f0
mov esi, eax
test esi, esi
js 0x1400092d3
xor r8d, r8d
mov rdx, rbx
lea rcx, [rsp + 0x50]
call fcn.140009830
mov esi, eax
test eax, eax
js 0x1400092b3
xor r8d, r8d
mov rdx, rdi
lea rcx, [rsp + 0x50]
call fcn.140009780
mov esi, eax
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test esi, esi
jns 0x1400092d3
lea rcx, [rsp + 0x50]
call fcn.140006410
mov qword [rsp + 0x40], r13
mov dword [rsp + 0x38], r13d
mov qword [rsp + 0x30], r13
mov dword [rsp + 0x28], 3
mov dword [rsp + 0x20], 4
xor r9d, r9d
xor r8d, r8d
or edx, 0xffffffff
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.ole32.dll_CoInitializeSecurity]
mov edi, r13d
mov rbx, qword [0x140029ba8]
test rbx, rbx
je 0x1400093a1
cmp qword [rbx], rdi
je 0x1400093a1
test edi, edi
jne 0x14000944d
mov qword [rbp + 0x218], r13
mov rax, qword [rbx + 0x10]
test rax, rax
jne 0x14000933f
mov edi, r13d
jmp 0x14000938f
lea r8, [rbp + 0x218]
lea rdx, [0x1400184e8]
mov rcx, qword [rbx + 0x18]
call rax
mov edi, eax
test eax, eax
js 0x14000937d
lea rax, [rbx + 0x28]
mov qword [rsp + 0x20], rax
mov r9d, r14d
mov r8d, 0x14
mov rdx, qword [rbp + 0x218]
mov rcx, qword [rbx]
call qword [sym.imp.ole32.dll_CoRegisterClassObject]
mov edi, eax
mov rcx, qword [rbp + 0x218]
test rcx, rcx
je 0x14000938f
mov rax, qword [rcx]
call qword [rax + 0x10]
add rbx, 0x48
cmp qword [rbx], 0
jne 0x140009322
test edi, edi
jne 0x14000944d
mov edi, r14d
mov rsi, qword [0x140020680]
mov rcx, qword [0x140020688]
cmp rsi, rcx
jae 0x14000944d
nop dword [rax + rax]
test edi, edi
js 0x14000944d
mov rbx, qword [rsi]
test rbx, rbx
je 0x140009440
mov qword [rbp + 0x220], r13
mov rax, qword [rbx + 0x10]
test rax, rax
jne 0x1400093e5
mov edi, r13d
jmp 0x140009440
lea r8, [rbp + 0x220]
lea rdx, [0x1400184e8]
mov rcx, qword [rbx + 0x18]
call rax
mov edi, eax
test eax, eax
js 0x140009427
mov rax, qword [rbx + 0x20]
add rax, 8
mov qword [rsp + 0x20], rax
mov r9d, r14d
mov r8d, 0x14
mov rdx, qword [rbp + 0x220]
mov rcx, qword [rbx]
call qword [sym.imp.ole32.dll_CoRegisterClassObject]
mov edi, eax
mov rcx, qword [rbp + 0x220]
test rcx, rcx
je 0x140009439
mov rax, qword [rcx]
call qword [rax + 0x10]
mov rcx, qword [0x140020688]
add rsi, 8
cmp rsi, rcx
jb 0x1400093c0
lea rdx, str.Service_started
mov rcx, r15
call fcn.140006ca0
cmp dword [r15 + 0x178], 0
je 0x140009485
mov dword [r15 + 0x15c], 4
lea rdx, [r15 + 0x158]
mov rcx, qword [r15 + 0x150]
call qword [sym.imp.ADVAPI32.dll_SetServiceStatus]
xor r9d, r9d
xor edx, edx
xor ecx, ecx
mov r8d, 0x7d0
call qword [sym.imp.USER32.dll_SetTimer]
xor r9d, r9d
xor r8d, r8d
mov edx, VarUI4FromDisp
xor ecx, ecx
call qword [sym.imp.USER32.dll_PostMessageA]
xor r9d, r9d
xor r8d, r8d
xor edx, edx
lea rcx, [rbp - 0x80]
call qword [sym.imp.USER32.dll_GetMessageA]
test eax, eax
je 0x140009682
nop word [rax + rax]
cmp dword [rbp - 0x78], 0x113
jne 0x140009654
mov esi, r13d
cmp dword [0x140029e00], r13d
jle 0x140009654
mov r14, r13
lea rdx, [rbp + 0x218]
mov rcx, qword [0x140029e08]
mov rcx, qword [r14 + rcx]
call qword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
cmp dword [rbp + 0x218], 0x103
je 0x140009642
mov ecx, esi
call fcn.140009980
test eax, eax
je 0x140009642
lea rdx, str.Exiting_our_service_due_to_errors
lea rcx, [0x140029b38]
call fcn.14000fab0
call fcn.14000c580
cmp dword [r15 + 0x178], 0
jne 0x140009593
xor edx, edx
mov r8d, 0x1f8
lea rcx, [rbp - 0x30]
call sub.VCRUNTIME140.dll_memset
mov dword [rbp - 0x30], 0x68
mov rax, qword [r15 + 0x180]
mov qword [rbp - 0x28], rax
mov dword [rbp - 0x20], r13d
lea rdx, [rbp - 0x30]
mov ecx, 2
call qword [sym.imp.SHELL32.dll_Shell_NotifyIconA]
xor edx, edx
mov rcx, qword [r15 + 0x180]
call qword [sym.imp.USER32.dll_EndDialog]
jmp 0x140009630
xor edx, edx
xor ecx, ecx
mov r8d, 0xf003f
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov rbx, rax
test rax, rax
jne 0x1400095c0
lea rdx, str.Couldnt_open_service_manager
lea rcx, [0x140029b38]
call fcn.14000fbe0
jmp 0x140009630
lea rdx, [r15 + 0x50]
mov r8d, 0x10020
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov rdi, rax
test rax, rax
jne 0x1400095f9
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea rdx, str.Couldnt_open_service
lea rcx, [0x140029b38]
call fcn.14000fbe0
jmp 0x140009630
lea r8, [rbp - 0x50]
mov edx, 1
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_ControlService]
lea rdx, str.Sending_service_manager_STOP
lea rcx, [0x140029b38]
call fcn.14000fab0
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
cmp dword [0x140029cd8], 0
jne 0x140009642
or ecx, 0xffffffff
call qword [sym.imp.USER32.dll_PostQuitMessage]
inc esi
add r14, 0x30
cmp esi, dword [0x140029e00]
jl 0x1400094f0
lea rcx, [rbp - 0x80]
call qword [sym.imp.USER32.dll_TranslateMessage]
lea rcx, [rbp - 0x80]
call qword [sym.imp.USER32.dll_DispatchMessageA]
xor r9d, r9d
xor r8d, r8d
xor edx, edx
lea rcx, [rbp - 0x80]
call qword [sym.imp.USER32.dll_GetMessageA]
test eax, eax
jne 0x1400094d0
mov eax, r13d
mov rbx, qword [0x140029ba8]
test rbx, rbx
je 0x1400096ba
cmp qword [rbx], rax
je 0x1400096ba
test eax, eax
jne 0x140009702
mov ecx, dword [rbx + 0x28]
test ecx, ecx
jne 0x1400096a6
mov eax, r13d
jmp 0x1400096ac
call qword [sym.imp.ole32.dll_CoRevokeClassObject]
add rbx, 0x48
cmp qword [rbx], 0
jne 0x140009696
test eax, eax
jne 0x140009702
mov eax, r13d
mov rbx, qword [0x140020680]
mov rdx, qword [0x140020688]
cmp rbx, rdx
jae 0x140009702
test eax, eax
jne 0x140009702
mov rcx, qword [rbx]
test rcx, rcx
je 0x1400096f9
mov rax, qword [rcx + 0x20]
mov ecx, dword [rax + 8]
test ecx, ecx
jne 0x1400096ec
mov eax, r13d
jmp 0x1400096f9
call qword [sym.imp.ole32.dll_CoRevokeClassObject]
mov rdx, qword [0x140020688]
add rbx, 8
cmp rbx, rdx
jb 0x1400096d0
call fcn.14000c580
mov rcx, qword [0x140029e08]
call fcn.14000d2b0
mov qword [0x140029e08], r13
mov dword [0x140029e00], r13d
call qword [sym.imp.ole32.dll_CoUninitialize]
nop
xor edx, edx
mov rcx, qword [rsp + 0x50]
call fcn.14000d270
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add rsp, 0x2d0
pop r15
pop r14
pop r13
pop rdi
pop rsi
pop rbx
pop rbp
ret