Function at 0x40f880
Capabilities:
Create service
Get common file path
Start service

Disassembly:
sub esp, 0x204
mov eax, dword [0x449e30]
xor eax, esp
mov dword [esp + 0x200], eax
push ebx
push ebp
push esi
mov ebx, ecx
call fcn.0040e250
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov ebp, eax
test ebp, ebp
jne 0x40f90d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Fail_To_Open_schManager_:__08X__r_n
push ebx
call fcn.004089d0
mov eax, dword [ebx + 4]
mov edx, dword [eax + 0x28]
add esp, 0xc
push 2
lea esi, [ebx + 4]
push ebp
push ebp
mov ecx, esi
call edx
mov ecx, dword [ebx]
mov eax, dword [esi]
mov edx, dword [eax + 0x54]
push ecx
mov ecx, esi
call edx
mov eax, dword [esi]
mov edx, dword [eax + 0x54]
push 0x43968c
mov ecx, esi
call edx
pop esi
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x200]
xor ecx, esp
call fcn.0041fd8a
add esp, 0x204
ret
push edi
lea eax, [esp + 0x10]
push eax
push 0xff
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
lea edi, [esp + 0x10]
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x40f925
mov eax, dword [ebx + 0x38]
sub eax, 1
mov ecx, dword [0x43967c]
mov dword [edi], ecx
je 0x40fa64
sub eax, 1
lea eax, [esp + 0x10]
je 0x40f9e1
add eax, 0xfffffffe
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x40f955
mov edx, dword [str.ADDMEM]
mov ecx, dword [0x43b748]
mov dword [eax], edx
mov edx, dword [0x43b74c]
mov dword [eax + 4], ecx
mov cx, word [0x43b750]
mov dword [eax + 8], edx
mov word [eax + 0xc], cx
lea eax, [esp + 0x10]
add eax, 0xfffffffe
lea ecx, [ecx]
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x40f990
mov edx, dword [str..SYS]
mov ecx, dword [0x43b8d0]
push 0
push 0
push 0
push 0
mov dword [eax], edx
mov dx, word [0x43b8d4]
push 0
mov dword [eax + 4], ecx
mov word [eax + 8], dx
lea eax, [esp + 0x24]
push eax
push 1
push 2
push 1
push 0xf01ff
push str.ADDMEM
push str.ADDMEM
jmp 0x40fafc
add eax, 0xfffffffe
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x40f9e4
mov ecx, dword [str.SABI]
mov edx, dword [0x43b73c]
mov dword [eax], ecx
mov cx, word [0x43b740]
mov dword [eax + 4], edx
mov word [eax + 8], cx
lea eax, [esp + 0x10]
add eax, 0xfffffffe
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x40fa13
mov edx, dword [str..SYS]
mov ecx, dword [0x43b8d0]
push 0
push 0
push 0
push 0
mov dword [eax], edx
mov dx, word [0x43b8d4]
push 0
mov dword [eax + 4], ecx
mov word [eax + 8], dx
lea eax, [esp + 0x24]
push eax
push 1
push 2
push 1
push 0xf01ff
push str.SABI
push str.SABI
jmp 0x40fafc
lea eax, [esp + 0x10]
add eax, 0xfffffffe
jmp 0x40fa70
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x40fa70
mov ecx, dword [str.KMDFMEMIO]
mov edx, dword [0x43b728]
mov dword [eax], ecx
mov ecx, dword [0x43b72c]
mov dword [eax + 4], edx
mov edx, dword [0x43b730]
mov dword [eax + 8], ecx
mov ecx, dword [0x43b734]
mov dword [eax + 0xc], edx
mov dword [eax + 0x10], ecx
lea eax, [esp + 0x10]
add eax, 0xfffffffe
nop
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x40fab0
mov edx, dword [str..SYS]
mov ecx, dword [0x43b8d0]
push 0
push 0
push 0
push 0
mov dword [eax], edx
mov dx, word [0x43b8d4]
push 0
mov dword [eax + 4], ecx
mov word [eax + 8], dx
lea eax, [esp + 0x24]
push eax
push 1
push 2
push 1
push 0xf01ff
push str.KMDFMEMIO
push str.KMDFMEMIO
push ebp
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov edi, eax
test edi, edi
jne 0x40fb54
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Fail_To_Create_Service_:__08X__r_n
push ebx
call fcn.004089d0
mov edx, dword [ebx + 4]
mov eax, dword [edx + 0x28]
add esp, 0xc
push 2
lea esi, [ebx + 4]
push edi
push edi
mov ecx, esi
call eax
mov edx, dword [esi]
mov eax, dword [ebx]
mov edx, dword [edx + 0x54]
push eax
mov ecx, esi
call edx
mov eax, dword [esi]
mov edx, dword [eax + 0x54]
push 0x43968c
mov ecx, esi
call edx
push ebp
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor eax, eax
jmp 0x40fbc6
push 0
push 0
push edi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x40fbb5
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Fail_To_Start_Service_:__08X__r_n
push ebx
call fcn.004089d0
mov eax, dword [ebx + 4]
mov edx, dword [eax + 0x28]
add esp, 0xc
push 2
lea esi, [ebx + 4]
push 0
push 0
mov ecx, esi
call edx
mov ecx, dword [ebx]
mov eax, dword [esi]
mov edx, dword [eax + 0x54]
push ecx
mov ecx, esi
call edx
mov eax, dword [esi]
mov edx, dword [eax + 0x54]
push 0x43968c
mov ecx, esi
call edx
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
call esi
push ebp
call esi
xor eax, eax
jmp 0x40fbc6
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
call esi
push ebp
call esi
mov eax, 1
mov ecx, dword [esp + 0x210]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0041fd8a
add esp, 0x204
ret