Function at 0x413f90
Capabilities:
Create service
Get common file path
Modify service
Persist via windows service
Set registry value
Start service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5cbbcc
mov eax, dword fs:[0]
push eax
sub esp, 0x294
mov eax, dword [0x664340]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0x14]
mov edx, dword [ebp + 0xc]
mov ecx, edx
mov edi, dword [ebp + 0x10]
mov esi, dword [ebp + 8]
mov dword [ebp - 0x274], eax
mov eax, dword [ebp + 0x18]
lea ebx, [ecx + 2]
mov dword [ebp - 0x278], eax
xor eax, eax
mov dword [ebp - 0x26c], edi
mov dword [ebp - 0x220], 0
mov dword [ebp - 0x21c], 7
mov word [ebp - 0x230], ax
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x414001
sub ecx, ebx
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x230]
call fcn.00403240
lea eax, [ebp - 0x264]
mov dword [ebp - 4], 0
push eax
push 3
push 0
push str.SOFTWAREMicrosoftWindows_NTCurrentVersionSvchost
push reloc.OLEAUT32.dll_SysReAllocString
mov dword [ebp - 0x264], 0
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x4140c4
mov edx, edi
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x414052
sub edx, ecx
lea ecx, [ebp - 0x230]
sar edx, 1
cmp dword [ebp - 0x21c], 8
cmovae ecx, dword [ebp - 0x230]
lea eax, [edx*2 + 2]
push eax
push edi
push 7
push 0
push ecx
push dword [ebp - 0x264]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test eax, eax
jne 0x4140c4
push dword [ebp - 0x264]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
call ebx
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov dword [ebp - 0x270], eax
test eax, eax
jne 0x414109
push 0x7a
call fcn.00451635
add esp, 4
xor esi, esi
mov edx, dword [ebp - 0x21c]
cmp edx, 8
jb 0x414379
mov ecx, dword [ebp - 0x230]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x41436f
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x414399
jmp 0x41436f
push 0x208
lea eax, [ebp - 0x218]
push 0
push eax
call fcn.0046cf80
add esp, 0xc
lea ecx, [ebp - 0x248]
push 0x6568a4
call fcn.00403040
lea ecx, [ebp - 0x2a0]
mov byte [ebp - 4], 1
call fcn.00464805
lea ecx, [ebp - 0x2a0]
mov byte [ebp - 4], 2
call fcn.00464839
test eax, eax
lea eax, [ebp - 0x218]
push 0x104
push eax
je 0x414165
call dword [sym.imp.KERNEL32.dll_GetSystemWow64DirectoryW]
jmp 0x41416b
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
lea ecx, [ebp - 0x218]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x414174
sub ecx, edx
lea eax, [ebp - 0x218]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x248]
call fcn.00403240
push 0x10
push str._svchost.exe__k
lea ecx, [ebp - 0x248]
call fcn.004058f0
cmp dword [ebp - 0x21c], 8
lea eax, [ebp - 0x230]
push dword [ebp - 0x220]
cmovae eax, dword [ebp - 0x230]
lea ecx, [ebp - 0x248]
push eax
call fcn.004058f0
cmp dword [ebp - 0x234], 8
lea eax, [ebp - 0x248]
push 0
cmovae eax, dword [ebp - 0x248]
push 0
push 0
push 0
push 0
push eax
push 1
push 2
push 0x20
push 0xf01ff
push dword [ebp - 0x274]
push edi
push dword [ebp - 0x270]
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov edi, eax
test edi, edi
jne 0x414222
push 0x7b
call fcn.00451635
add esp, 4
xor esi, esi
jmp 0x414354
mov eax, dword [ebp - 0x278]
mov dword [ebp - 0x27c], eax
lea eax, [ebp - 0x27c]
push eax
push 1
push edi
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
push str.SYSTEMCurrentControlSetServices_
lea ecx, [ebp - 0x260]
call fcn.00403040
mov edx, dword [ebp - 0x26c]
mov ecx, edx
mov byte [ebp - 4], 3
lea eax, [ecx + 2]
mov dword [ebp - 0x26c], eax
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x414263
sub ecx, dword [ebp - 0x26c]
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x260]
call fcn.004058f0
cmp dword [ebp - 0x24c], 8
lea ecx, [ebp - 0x264]
push ecx
push 0xf003f
lea eax, [ebp - 0x260]
cmovae eax, dword [ebp - 0x260]
push 0
push eax
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x414347
mov dword [ebp - 0x268], eax
lea eax, [ebp - 0x268]
push eax
push str.Parameters
push dword [ebp - 0x264]
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyW]
test eax, eax
jne 0x414347
cmp dword [esi + 0x14], 8
mov eax, dword [esi + 0x10]
jb 0x4142e6
mov esi, dword [esi]
lea eax, [eax*2 + 2]
push eax
push esi
push 2
push 0
push str.ServiceDll
push dword [ebp - 0x268]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test eax, eax
jne 0x414347
push eax
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x41431f
push 0x7c
call fcn.00451635
add esp, 4
push dword [ebp - 0x264]
call ebx
push dword [ebp - 0x268]
call ebx
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
call esi
push dword [ebp - 0x270]
call esi
mov esi, 1
jmp 0x414349
xor esi, esi
lea ecx, [ebp - 0x260]
call fcn.00402fe0
lea ecx, [ebp - 0x2a0]
call fcn.00464818
lea ecx, [ebp - 0x248]
call fcn.00402fe0
jmp 0x4140c6
push edx
push ecx
call fcn.0044a315
add esp, 8
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0044a851
mov esp, ebp
pop ebp
ret 0x14
call fcn.00470179
int3