Function at 0x4018f5
Capabilities:
Create service
Modify service
Persist via run registry key
Set registry value

Disassembly:
sub esp, 0xa08
mov eax, dword [0x40704c]
xor eax, esp
mov dword [esp + 0xa04], eax
push ebx
push esi
mov esi, ecx
call fcn.00401610
push 0x3ff
lea eax, [esp + 0x210]
push eax
xor ebx, ebx
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x401961
push 0x100
lea ecx, [esp + 0x10]
push ecx
mov ecx, esi
call fcn.00401570
mov edx, dword [esi + 8]
push eax
push edx
push str.Unable_to_install__s____s_n
call dword [sym.imp.MSVCR90.dll___iob_func]
add eax, 0x40
push eax
call dword [sym.imp.MSVCR90.dll_fwprintf]
add esp, 0x10
pop esi
mov eax, 0xc8
pop ebx
mov ecx, dword [esp + 0xa04]
xor ecx, esp
call fcn.004041ee
add esp, 0xa08
ret
push ebp
mov dword [esp + 0xc], ebx
cmp dword [esi + 0x44], ebx
jne 0x4019f0
mov ecx, dword [str.SoftwareMicrosoftWindowsCurrentVersionRunServices]
lea eax, [esp + 0xc]
push eax
push ecx
push 0x80000002
mov dword [esp + 0x18], ebx
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyW]
test eax, eax
jne 0x401b41
lea eax, [esp + 0x210]
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x4019a0
mov ecx, dword [esp + 0xc]
sub eax, edx
sar eax, 1
inc eax
push eax
mov eax, dword [esi + 4]
lea edx, [esp + 0x214]
push edx
push 2
push ebx
push eax
push ecx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov edx, dword [esp + 0xc]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop ebp
pop esi
xor eax, eax
pop ebx
mov ecx, dword [esp + 0xa04]
xor ecx, esp
call fcn.004041ee
add esp, 0xa08
ret
push 0xf003f
push ebx
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov ebp, eax
cmp ebp, ebx
je 0x401b17
mov ecx, dword [esi + 0x50]
cmp ecx, 1
je 0x401a14
cmp ecx, 2
jne 0x401a20
mov eax, dword [esi + 0x54]
cmp eax, ebx
je 0x401a24
cmp eax, 1
je 0x401a24
xor eax, eax
jmp 0x401a27
lea eax, [esi + 0x60]
mov edx, dword [esi + 0x6c]
push edi
push edx
mov edx, dword [esi + 0x68]
push edx
mov edx, dword [esi + 0x64]
push edx
push eax
mov eax, dword [esi + 0x5c]
push eax
mov eax, dword [esi + 0x58]
lea edx, [esp + 0x228]
push edx
mov edx, dword [esi + 0x54]
push eax
mov eax, dword [esi + 0x4c]
push edx
mov edx, dword [esi + 4]
push ecx
mov ecx, dword [esi + 8]
push eax
push ecx
push edx
push ebp
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov edi, eax
cmp edi, ebx
mov ebx, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
je 0x401aa2
cmp dword [esi + 0xc], 0
lea eax, [esi + 0xc]
je 0x401a7c
push eax
push 1
push edi
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
mov eax, dword [esi + 8]
push eax
push str._s_installed._n
call dword [sym.imp.MSVCR90.dll___iob_func]
add eax, 0x40
push eax
call dword [sym.imp.MSVCR90.dll_fwprintf]
add esp, 0xc
push edi
call ebx
mov edi, 1
jmp 0x401ad0
push 0x100
lea ecx, [esp + 0x18]
push ecx
mov ecx, esi
call fcn.00401570
push eax
push str.CreateService_failed____s_n
call dword [sym.imp.MSVCR90.dll___iob_func]
add eax, 0x40
push eax
call dword [sym.imp.MSVCR90.dll_fwprintf]
mov edi, dword [esp + 0x1c]
add esp, 0xc
push ebp
call ebx
test edi, edi
pop edi
je 0x401b41
mov eax, dword [esi]
mov edx, dword [eax + 0x34]
push 7
lea ecx, [esp + 0x214]
push ecx
mov ecx, esi
call edx
mov eax, dword [esi]
mov edx, dword [eax + 0x3c]
push 0xffffffffffffffff
push 4
push str.Service_installed
mov ecx, esi
call edx
pop ebp
pop esi
xor eax, eax
pop ebx
mov ecx, dword [esp + 0xa04]
xor ecx, esp
call fcn.004041ee
add esp, 0xa08
ret
push 0x100
lea edx, [esp + 0x14]
push edx
mov ecx, esi
call fcn.00401570
push eax
push 0x4053a8
call dword [sym.imp.MSVCR90.dll___iob_func]
add eax, 0x40
push eax
call dword [sym.imp.MSVCR90.dll_fwprintf]
add esp, 0xc
mov ecx, dword [esp + 0xa10]
pop ebp
pop esi
pop ebx
xor ecx, esp
mov eax, 0xc8
call fcn.004041ee
add esp, 0xa08
ret