Function at 0x401320
Capabilities:
Create service
Delete service
Persist via windows service
Start service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc88
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
push esi
lea eax, [ebp - 0x288]
xor ebx, ebx
push 0x411148
push eax
mov dword [ebp - 4], ebx
mov dword [ebp - 8], ebx
call fcn.004057b0
add esp, 0xc
lea ecx, [ebp - 0x108]
push esi
push 0x411160
push ecx
call fcn.004057b0
mov ecx, dword [ebp + 0x10]
add esp, 0xc
lea edx, [ebp - 8]
lea eax, [ebp - 0x188]
push edx
push eax
push ecx
call fcn.00402200
add esp, 0xc
xor esi, esi
xor edi, edi
mov edx, dword [esi + 0x411038]
lea eax, [ebp + edi - 0xc88]
push edx
push eax
call fcn.004057b0
mov ecx, dword [esi + 0x411050]
add esp, 8
lea edx, [ebp + edi - 0x888]
push ecx
push edx
call fcn.004057b0
add esi, 4
add esp, 8
add edi, 0x20
cmp esi, 0x18
jl 0x40137c
lea eax, [ebp - 4]
lea ecx, [ebp - 0x7c8]
push eax
mov eax, dword [ebp - 8]
lea edx, [ebp - 0xbc8]
push ecx
push edx
lea ecx, [ebp - 0x188]
push eax
push ecx
call fcn.00401eb0
add esp, 0x14
cmp eax, ebx
je 0x401402
mov edx, dword [ebp - 4]
mov ecx, dword [ebp + 0xc]
lea eax, [ebp + 8]
push edx
push eax
push ebx
push 8
push ebx
push ecx
call fcn.00401c10
add esp, 0x18
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 4]
mov esi, 6
add edx, esi
cmp eax, ebx
mov dword [ebp - 8], edx
je 0x40141c
mov ecx, edx
dec ecx
mov dword [ebp - 8], ecx
mov ebx, dword [ebp + 0xc]
lea edx, [ebp + 8]
push eax
push edx
push 0x24
lea eax, [ebp - 0x108]
push 1
push eax
push ebx
call fcn.00401c10
mov eax, dword [ebp + 8]
add esp, 0x18
cmp eax, esi
je 0x40144b
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea ecx, [ebp - 0x488]
push 0x200
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x40148b
mov edx, dword [ebp - 4]
lea eax, [ebp + 8]
push edx
push eax
push 0x10
lea ecx, [ebp - 0x108]
push 2
push ecx
push ebx
call fcn.00401c10
add esp, 0x18
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea edi, [ebp - 0x488]
or ecx, 0xffffffff
xor eax, eax
mov edx, dword [str.__start_service]
repne scasb al, byte es:[edi]
mov eax, dword [0x411180]
mov ecx, dword [0x411184]
dec edi
push 0xf003f
push 0
push 0
mov dword [edi], edx
mov edx, dword [0x411188]
mov dword [edi + 4], eax
mov dword [edi + 8], ecx
mov dword [edi + 0xc], edx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov edi, eax
test edi, edi
jne 0x4014f8
mov eax, dword [ebp - 4]
lea ecx, [ebp + 8]
push eax
push ecx
push 0x10
lea edx, [ebp - 0x108]
push 2
push edx
push ebx
call fcn.00401c10
add esp, 0x18
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0
push 0
push 0
push 0
lea eax, [ebp - 0x488]
push 0
push eax
push 1
push 2
push 0x110
lea ecx, [ebp - 0x108]
push 0xf01ff
lea edx, [ebp - 0x288]
push ecx
push edx
push edi
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov esi, eax
test esi, esi
jne 0x401561
mov eax, dword [ebp - 4]
lea ecx, [ebp + 8]
push eax
push ecx
push 0x10
lea edx, [ebp - 0x108]
push 2
push edx
push ebx
call fcn.00401c10
add esp, 0x18
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 8]
lea ecx, [ebp - 0x888]
push eax
lea edx, [ebp - 0xc88]
push ecx
lea eax, [ebp - 0x288]
push edx
push eax
call fcn.00401cb0
add esp, 0x10
test eax, eax
je 0x4015ab
mov ecx, dword [ebp - 4]
lea edx, [ebp + 8]
push ecx
push edx
push 0
push 2
push 0
push ebx
call fcn.00401c10
add esp, 0x18
push esi
call dword [sym.imp.ADVAPI32.dll_DeleteService]
mov ebx, 1
jmp 0x4015c9
mov eax, dword [ebp - 4]
lea ecx, [ebp + 8]
push eax
push ecx
push 0x40
lea edx, [ebp - 0x108]
push 5
push edx
push ebx
call fcn.00401c10
add esp, 0x18
xor ebx, ebx
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push edi
call esi
pop edi
mov eax, ebx
pop esi
pop ebx
mov esp, ebp
pop ebp
ret