Function at 0x14004e710
Capabilities:
Create service
Delete service
Modify service
Persist via windows service
Start service

Disassembly:
push rbx
push rbp
push rsi
sub rsp, 0x1c0
mov rax, qword [0x140116008]
xor rax, rsp
mov qword [rsp + 0x1b0], rax
mov rbx, r8
lea rdx, [rsp + 0xa0]
mov ebp, ecx
mov r8d, 0x104
xor ecx, ecx
mov rsi, r9
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x14004e776
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, str.Cannot_install_service___d__n
mov edx, 0x100
mov r9d, eax
mov rcx, rsi
call fcn.140040c30
mov eax, 0xfffffff8
jmp 0x14004e99f
mov rcx, 0xffffffffffffffff
mov rax, rcx
inc rax
cmp byte [rbx + rax], 0
jne 0x14004e780
lea rdx, [rsp + 0xa0]
inc rcx
cmp byte [rdx + rcx], 0
jne 0x14004e791
add rax, rcx
cmp rax, 0x104
jbe 0x14004e7c3
lea r8, str.Too_many_arguments_for_services_please_contact_suport_yoctopuce.com_n
mov edx, 0x100
mov rcx, rsi
call fcn.140040c30
mov eax, 0xfffffff8
jmp 0x14004e99f
mov r8, rbx
mov qword [rsp + 0x1e0], rdi
mov edx, 0x104
lea rcx, [rsp + 0xa0]
call fcn.14005cc04
xor edx, edx
xor ecx, ecx
lea r8d, [rdx + 2]
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov rdi, rax
test rax, rax
jne 0x14004e81b
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, str.OpenSCManager_failed___d__n
mov edx, 0x100
mov r9d, eax
mov rcx, rsi
call fcn.140040c30
lea eax, [rdi - 8]
jmp 0x14004e997
mov r8d, 0xf01ff
lea rdx, str.yVirtualHub
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov rbx, rax
test rax, rax
jne 0x14004e939
test ebp, ebp
jne 0x14004e866
lea r8, str.unable_to_open_VirtualHub_service_n
mov edx, 0x100
mov rcx, rsi
call fcn.140040c30
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea eax, [rbx - 8]
jmp 0x14004e997
xor eax, eax
lea r8, str.Yoctopuce_Virtual_Hub
mov qword [rsp + 0x60], rax
lea rdx, str.yVirtualHub
mov qword [rsp + 0x58], rax
mov r9d, 0xf01ff
mov qword [rsp + 0x50], rax
mov rcx, rdi
mov qword [rsp + 0x48], rax
mov qword [rsp + 0x40], rax
lea rax, [rsp + 0xa0]
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 1
mov dword [rsp + 0x28], 2
mov dword [rsp + 0x20], reloc.WS2_32.dll_recv
call qword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov rbx, rax
test rax, rax
jne 0x14004e8f9
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, str.CreateService_failed___d__n
mov edx, 0x100
mov r9d, eax
mov rcx, rsi
call fcn.140040c30
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea eax, [rbx - 8]
jmp 0x14004e997
lea rax, str.The_VirtualHub_is_a_toolbox_for_Yoctopuce_USB_devices._It_will_allow_you_to_n___configure_and_test_Yoctopuce_devices_n___remotely_control_Yoctopuce_devices_through_network_n___control_Yoctopuce_devices_with_languages_which_do_not_allow_a_direct_access_to_USB_devices__such_as_Javascript_and_PHP.
mov edx, 1
lea r8, [rsp + 0x70]
mov qword [rsp + 0x70], rax
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2A]
test eax, eax
jne 0x14004e930
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.Unable_to_set_service_description___d__n
call fcn.140021b20
lea rcx, str.Service_successfully_installed_n
jmp 0x14004e970
test ebp, ebp
jne 0x14004e969
lea r8, [rsp + 0x78]
mov rcx, rbx
lea edx, [rbp + 1]
call qword [sym.imp.ADVAPI32.dll_ControlService]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
je 0x14004e995
lea rcx, str.Service_successfully_uninstalled_n
call fcn.140021b20
jmp 0x14004e995
lea rcx, str.Service_allready_installed_n
call fcn.140021b20
xor r8d, r8d
xor edx, edx
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_StartServiceA]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor eax, eax
mov rdi, qword [rsp + 0x1e0]
mov rcx, qword [rsp + 0x1b0]
xor rcx, rsp
call fcn.14004ee60
add rsp, 0x1c0
pop rsi
pop rbp
pop rbx
ret