Function at 0x1400039d0
Capabilities:
Get thread local storage value
Query service status
Set thread local storage value
Stop service
Terminate process

Disassembly:
mov rax, rsp
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rax - 0x5f]
sub rsp, 0xd0
mov qword [rbp - 0x39], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov rax, qword [0x140022218]
xor rax, rsp
mov qword [rbp + 0x2f], rax
mov byte [rbp - 0x67], r9b
movzx r12d, r8b
mov dword [rbp - 0x65], edx
mov rsi, rcx
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
lea r14, [0x140024670]
mov ecx, dword [0x140023468]
cmp ecx, 0xffffffff
je 0x140003a49
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdi, rax
test rax, rax
je 0x140003a49
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x140003a54
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rdi, r14
mov qword [rsp + 0x28], rsi
lea rax, [0x14001bf48]
mov qword [rsp + 0x20], rax
mov r9d, 0x128
lea r13, str.......CommonSetupHelper.cpp
mov r8, r13
lea rdx, [0x14001bf50]
mov rcx, rdi
call fcn.1400074b0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov ecx, dword [0x140023468]
cmp ecx, 0xffffffff
je 0x140003aaf
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdi, rax
test rax, rax
je 0x140003aaf
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x140003aba
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rdi, r14
xor ebx, ebx
mov qword [rbp - 0x59], rbx
mov qword [rbp - 0x51], rbx
mov qword [rbp - 0x49], rdi
mov dword [rbp - 0x41], 0xff
mov ecx, dword [0x14002346c]
cmp ecx, 0xffffffff
je 0x140003b24
cmp dword [0x140023470], 0xffffffff
je 0x140003b24
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov qword [rbp - 0x59], rax
mov ecx, dword [0x140023470]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov qword [rbp - 0x51], rax
lea rdx, str.SwitchOffService
mov ecx, dword [0x14002346c]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
lea rdx, [rbp - 0x59]
mov ecx, dword [0x140023470]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov rdi, qword [rbp - 0x49]
test rdi, rdi
je 0x140003b32
mov rcx, rdi
call fcn.140005d90
nop
mov edi, 0x41d
mov r14d, ebx
xor edx, edx
xor ecx, ecx
mov r8d, 0xf003f
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov r15, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov qword [rbp - 0x21], r15
mov ecx, eax
call qword [sym.imp.KERNEL32.dll_SetLastError]
nop
test r15, r15
je 0x14000407a
mov r8d, 0xf01ff
mov rdx, rsi
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov r13, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov qword [rbp - 0x29], r13
mov ecx, eax
call qword [sym.imp.KERNEL32.dll_SetLastError]
nop
test r13, r13
je 0x140003feb
test r12b, r12b
je 0x140003bbb
mov rcx, r13
call fcn.140003700
test eax, eax
cmovne r14d, eax
mov rcx, r13
call fcn.1400038e0
test eax, eax
cmovne r14d, eax
xor bl, bl
mov byte [rbp - 0x68], bl
mov byte [rbp - 0x69], bl
mov eax, dword [rbp - 0x65]
mov r12d, eax
test eax, eax
jle 0x140004053
xor sil, sil
xor ecx, ecx
xor eax, eax
mov qword [rbp - 0x19], rcx
mov qword [rbp - 0x11], rax
mov qword [rbp - 9], rax
mov qword [rbp - 1], rax
mov dword [rbp + 7], eax
mov dword [rbp - 0x61], ecx
lea rax, [rbp - 0x61]
mov qword [rsp + 0x20], rax
lea r9d, [rcx + 0x24]
lea r8, [rbp - 0x19]
xor edx, edx
mov rcx, r13
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x140003f7a
mov eax, dword [rbp - 0x15]
cmp eax, 1
je 0x140003db5
jbe 0x140003d78
cmp eax, 3
jbe 0x140003d15
cmp eax, 4
jne 0x140003d78
call fcn.140004c10
mov rcx, rax
mov dword [rsp + 0x20], 0x15a
lea r9, str.......CommonSetupHelper.cpp
lea r8, str.Service_is_running
lea rdx, [0x14001bf50]
call fcn.140007a40
mov sil, 1
test bl, bl
jne 0x140003d62
mov byte [rbp - 0x68], sil
xor eax, eax
mov qword [rbp + 0xf], rax
mov qword [rbp + 0x17], rax
mov qword [rbp + 0x1f], rax
mov dword [rbp + 0x27], eax
lea r8, [rbp + 0xf]
lea edx, [rax + 1]
mov rcx, r13
call qword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
je 0x140003cd3
xor sil, sil
call fcn.140004c10
mov rcx, rax
mov dword [rsp + 0x28], 0x163
lea rbx, str.......CommonSetupHelper.cpp
mov qword [rsp + 0x20], rbx
mov r9d, dword [rbp + 0x13]
lea r8, str.Send_Stop_Command_to_Service
lea rdx, [0x14001bf50]
call fcn.140007d00
mov r12d, dword [rbp - 0x65]
jmp 0x140003d69
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
call fcn.140004c10
mov rcx, rax
mov dword [rsp + 0x28], 0x169
lea rbx, str.......CommonSetupHelper.cpp
mov qword [rsp + 0x20], rbx
mov r9d, edi
lea r8, str.Sending_Stop_Command_to_Service_failed
lea rdx, [0x14001bf50]
call fcn.140007d00
xor r12d, r12d
jmp 0x140003e1c
mov sil, 1
call fcn.140004c10
mov rcx, rax
mov dword [rsp + 0x28], 0x14f
lea rbx, str.......CommonSetupHelper.cpp
mov qword [rsp + 0x20], rbx
mov r9d, dword [rbp - 0x15]
lea r8, str.Service_is_in_pending_state
lea rdx, [0x14001bf50]
call fcn.140007d00
cmp r12d, 1
jle 0x140003e1c
mov ecx, 0x3e8
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x140003d69
lea rbx, str.......CommonSetupHelper.cpp
cmp r12d, 1
jg 0x140003f65
jmp 0x140003e1c
call fcn.140004c10
mov rcx, rax
mov dword [rsp + 0x28], 0x16f
lea rbx, str.......CommonSetupHelper.cpp
mov qword [rsp + 0x20], rbx
mov r9d, dword [rbp - 0x15]
lea r8, str.Unexpected_Service_state
lea rdx, [0x14001bf50]
call fcn.140007d00
mov edi, 0x139f
xor r12d, r12d
jmp 0x140003e1c
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov ecx, dword [0x140023468]
cmp ecx, 0xffffffff
je 0x140003de0
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdi, rax
test rax, rax
je 0x140003de0
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x140003def
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
lea rdi, [0x140024670]
mov dword [rsp + 0x20], 0x154
lea rbx, str.......CommonSetupHelper.cpp
mov r9, rbx
lea r8, str.Service_is_stopped
lea rdx, [0x14001bf50]
mov rcx, rdi
call fcn.140007a40
xor r12d, r12d
xor edi, edi
cmp byte [rbp - 0x67], 0
je 0x140003f65
test sil, sil
je 0x140003f65
cmp byte [rbp - 0x69], 0
jne 0x140003f65
test byte [rbp - 0x19], 0x10
je 0x140003f65
cmp dword [rbp + 3], 0
je 0x140003f65
mov byte [rbp - 0x69], 1
call fcn.140004c10
mov rcx, rax
mov eax, dword [rbp + 3]
mov dword [rsp + 0x28], eax
mov dword [rsp + 0x20], 0x177
mov r9, rbx
lea r8, str.Trying_to_terminate_service_process__u
lea rdx, [0x14001bf50]
call fcn.140007e70
mov r8d, dword [rbp + 3]
xor edx, edx
mov ecx, 0x1f0fff
call qword [sym.imp.KERNEL32.dll_OpenProcess]
mov rsi, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov qword [rbp - 0x31], rsi
mov ecx, eax
call qword [sym.imp.KERNEL32.dll_SetLastError]
nop
test rsi, rsi
je 0x140003f13
xor edx, edx
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_TerminateProcess]
test eax, eax
je 0x140003ef5
mov edx, 0xbb8
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
call fcn.140004c10
mov rcx, rax
mov dword [rsp + 0x20], 0x17d
mov r9, rbx
lea r8, str.Terminated_service_process
lea rdx, [0x14001bf50]
call fcn.140007e70
mov r12d, 0xa
jmp 0x140003f47
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
call fcn.140004c10
mov dword [rsp + 0x28], 0x183
lea r8, str.Forcefully_terminating_service_process_failed
jmp 0x140003f2f
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
call fcn.140004c10
mov dword [rsp + 0x28], 0x189
lea r8, str.Opening_service_process_failed
mov qword [rsp + 0x20], rbx
mov r9d, edi
lea rdx, [0x14001bf50]
mov rcx, rax
call fcn.140007d00
nop
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
test rsi, rsi
je 0x140003f5d
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
dec r12d
test r12d, r12d
movzx ebx, byte [rbp - 0x68]
jg 0x140003bd1
jmp 0x140004053
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov ecx, dword [0x140023468]
cmp ecx, 0xffffffff
je 0x140003fad
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rsi, rax
test rax, rax
je 0x140003fad
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x140003fbc
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
lea rsi, [0x140024670]
mov dword [rsp + 0x28], 0x146
lea r9, str.......CommonSetupHelper.cpp
mov qword [rsp + 0x20], r9
mov r9d, edi
lea r8, str.QueryServiceStatusEx_failed
lea rdx, [0x14001bf50]
mov rcx, rsi
call fcn.140007d00
jmp 0x140004053
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov ecx, dword [0x140023468]
cmp ecx, 0xffffffff
je 0x14000401e
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rsi, rax
test rax, rax
je 0x14000401e
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x14000402d
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
lea rsi, [0x140024670]
mov dword [rsp + 0x20], 0x1a1
lea r9, str.......CommonSetupHelper.cpp
lea r8, str.Failed_to_open_Service
lea rdx, [0x14001bf50]
mov rcx, rsi
call fcn.140007a40
nop
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
test r13, r13
je 0x140004069
mov rcx, r13
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
lea r13, str.......CommonSetupHelper.cpp
jmp 0x1400040de
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov ecx, dword [0x140023468]
cmp ecx, 0xffffffff
je 0x1400040ad
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rsi, rax
test rax, rax
je 0x1400040ad
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x1400040bc
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
lea rsi, [0x140024670]
mov dword [rsp + 0x20], 0x1a7
mov r9, r13
lea r8, str.Failed_to_open_Service_Manager
lea rdx, [0x14001bf50]
mov rcx, rsi
call fcn.140007a40
nop
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
test r15, r15
je 0x1400040f4
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
test r14d, r14d
je 0x140004107
test edi, edi
cmove edi, r14d
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov ecx, dword [0x140023468]
cmp ecx, 0xffffffff
je 0x140004132
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rsi, rax
test rax, rax
je 0x140004132
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x140004141
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
lea rsi, [0x140024670]
mov dword [rsp + 0x28], 0x1af
mov qword [rsp + 0x20], r13
xor r9d, r9d
mov r8d, edi
lea rdx, [0x14001bf50]
mov rcx, rsi
call fcn.140007770
nop
lea rcx, [rbp - 0x59]
call fcn.1400044b0
mov eax, edi
mov rcx, qword [rbp + 0x2f]
xor rcx, rsp
call fcn.14000c410
lea r11, [rsp + 0xd0]
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