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

Disassembly:
push 0xffffffffffffffff
push 0x4216f8
mov eax, dword fs:[0]
push eax
sub esp, 0x28
mov eax, dword [0x42b1d0]
xor eax, esp
mov dword [esp + 0x24], eax
push ebx
push ebp
push esi
mov eax, dword [0x42b1d0]
xor eax, esp
push eax
lea eax, [esp + 0x38]
mov dword fs:[0], eax
xor ebx, ebx
cmp dword [edi], ebx
jne 0x40f0cb
push str.the_SCM_handl_is_NULL.
call fcn.00412560
add esp, 4
xor al, al
jmp 0x40f2ea
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
push 1
push 0x4249ac
lea ecx, [esp + 0x20]
mov dword [esp + 0x38], 0xf
mov dword [esp + 0x34], ebx
mov byte [esp + 0x24], bl
call fcn.00401c30
push ebx
lea ebp, [edi + 8]
push ebp
or eax, 0xffffffff
lea esi, [esp + 0x20]
mov dword [esp + 0x48], ebx
call fcn.00401b40
push 0xa
push str.___service
mov eax, esi
call fcn.00401740
mov eax, dword [esp + 0x1c]
mov esi, 0x10
cmp dword [esp + 0x30], esi
jae 0x40f128
lea eax, [esp + 0x1c]
push eax
push str.strPath_is_:__s
call fcn.004124a0
mov edx, dword [esp + 0x24]
add esp, 8
cmp dword [esp + 0x30], esi
jae 0x40f144
lea edx, [esp + 0x1c]
cmp dword [edi + 0x58], esi
jb 0x40f14e
mov ecx, dword [edi + 0x44]
jmp 0x40f151
lea ecx, [edi + 0x44]
mov eax, dword [0x42c140]
cmp dword [0x42c154], esi
jae 0x40f163
mov eax, 0x42c140
push ebx
push ebx
push ebx
push ebx
push ebx
push edx
push 1
push 2
push 0x110
push 0xf01ff
push ecx
push eax
mov eax, dword [edi]
push eax
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov dword [edi + 4], eax
cmp eax, ebx
jne 0x40f1ff
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, 0x10
mov esi, eax
mov eax, dword [0x42c140]
cmp dword [0x42c154], ebx
jae 0x40f1a8
mov eax, 0x42c140
push esi
push eax
push str.error_happens_during_creating_a_service_:_s.Error_Code:_d.
call fcn.00412560
add esp, 0xc
cmp esi, 0x431
jne 0x40f1e5
mov eax, edi
call fcn.0040ef80
test al, al
je 0x40f1e5
push str.startService_successfully.
call fcn.004124a0
add esp, 4
lea ecx, [esp + 0x18]
call fcn.00401570
jmp 0x40f2e8
cmp dword [esp + 0x30], ebx
jb 0x40f1f8
mov ecx, dword [esp + 0x1c]
push ecx
call fcn.0041288e
add esp, 4
xor al, al
jmp 0x40f2ea
cmp dword [edi + 0x74], esi
jb 0x40f20d
mov edx, dword [edi + 0x60]
mov dword [esp + 0x14], edx
jmp 0x40f214
lea ecx, [edi + 0x60]
mov dword [esp + 0x14], ecx
lea edx, [esp + 0x14]
push edx
push 1
push eax
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2A]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x40f23b
call esi
push eax
push str.ChangeServiceConfig2_failed__errno___d
call fcn.00412560
jmp 0x40f24a
mov eax, dword [esp + 0x14]
push eax
push str.service_descpition_is___s_
call fcn.004124a0
add esp, 8
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ecx, dword [edi + 4]
push ebx
push ebx
push ecx
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
test eax, eax
jne 0x40f2b5
call esi
mov ecx, dword [0x42c140]
mov esi, 0x10
cmp dword [0x42c154], esi
jae 0x40f27e
mov ecx, 0x42c140
push eax
push ecx
push str.error_happens_during_starting_a_service:_s.Error_Code:_d
call fcn.00412560
mov edx, dword [edi + 4]
add esp, 0xc
push edx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov dword [edi + 4], ebx
cmp dword [esp + 0x30], esi
jb 0x40f1f8
mov eax, dword [esp + 0x1c]
push eax
call fcn.0041288e
add esp, 4
xor al, al
jmp 0x40f2ea
mov esi, 0x10
cmp dword [ebp + 0x18], esi
jb 0x40f2c4
mov eax, dword [ebp + 4]
jmp 0x40f2c7
lea eax, [ebp + 4]
push eax
push str.Install_service_:_s_successfully.
call fcn.004124a0
add esp, 8
cmp dword [esp + 0x30], esi
jb 0x40f2e8
mov ecx, dword [esp + 0x1c]
push ecx
call fcn.0041288e
add esp, 4
mov al, 1
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x24]
xor ecx, esp
call fcn.00412899
add esp, 0x34
ret