Function at 0x402640
Capabilities:
Create process on windows
Create process suspended
Enumerate services
Get common file path

Disassembly:
sub esp, 0x168
push ebx
push ebp
push esi
push edi
xor ebx, ebx
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x75]
mov byte [esp + 0x74], bl
mov dword [esp + 0x30], ebx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x10
xor eax, eax
lea edi, [esp + 0x34]
mov dword [esp + 0x14], ebx
rep stosd dword es:[edi], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x10], ebx
mov dword [esp + 0x28], eax
mov dword [esp + 0x18], ebx
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x17c]
cmp eax, ebx
mov dword [esp + 0x20], ebx
je 0x402715
cmp dword [esp + 0x180], ebx
je 0x402715
push 0xf003f
push ebx
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov edi, eax
cmp edi, ebx
je 0x402715
lea ecx, [esp + 0x18]
lea edx, [esp + 0x10]
mov ebp, dword [sym.imp.ADVAPI32.dll_EnumServicesStatusA]
push ecx
lea eax, [esp + 0x18]
push edx
push eax
push ebx
push ebx
push 3
push 0x30
push edi
call ebp
mov ecx, dword [esp + 0x14]
push ecx
call fcn.004094fa
mov esi, eax
add esp, 4
cmp esi, ebx
je 0x40270e
lea edx, [esp + 0x18]
lea eax, [esp + 0x10]
push edx
mov edx, dword [esp + 0x18]
lea ecx, [esp + 0x18]
push eax
push ecx
push edx
push esi
push 3
push 0x30
push edi
call ebp
test eax, eax
jne 0x402722
push esi
call fcn.00409491
add esp, 4
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x168
ret
mov eax, dword [esp + 0x10]
xor ebp, ebp
cmp eax, ebx
jbe 0x402753
mov ebx, esi
mov ecx, dword [esp + 0x180]
mov eax, dword [ebx]
push ecx
push eax
call fcn.00409323
add esp, 8
test eax, eax
je 0x402751
mov eax, dword [esp + 0x10]
inc ebp
add ebx, 0x24
cmp ebp, eax
jb 0x40272e
xor ebx, ebx
push esi
call fcn.00409491
add esp, 4
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
cmp ebp, dword [esp + 0x10]
jb 0x402779
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x168
ret
lea edx, [esp + 0x74]
push 0x104
push edx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
mov edi, dword [0x4143dc]
cmp edi, ebx
jne 0x402798
mov edi, 0x40f15c
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x74]
mov ebp, ecx
mov esi, edi
or ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea edx, [esp + 0x74]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
or ecx, 0xffffffff
mov edi, 0x411088
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov dword [esp + 0x30], 0x44
mov ebp, ecx
mov esi, edi
or ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea edx, [esp + 0x74]
and ecx, 3
mov dword [esp + 0x34], ebx
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x17c]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov dword [esp + 0x64], ebx
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea edx, [esp + 0x74]
and ecx, 3
mov word [esp + 0x62], bx
rep movsb byte es:[edi], byte [esi]
mov edi, str.__remove
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov dword [esp + 0x38], ebx
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea eax, [esp + 0x20]
and ecx, 3
mov dword [esp + 0x5c], ebx
rep movsb byte es:[edi], byte [esi]
push eax
lea ecx, [esp + 0x34]
push ecx
push ebx
push ebx
push 0x20
push 1
push ebx
lea edx, [esp + 0x90]
push ebx
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x402715
mov eax, dword [esp + 0x24]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call esi
mov ecx, dword [esp + 0x20]
push ecx
call esi
mov eax, dword [0x4110a0]
mov dword [esp + 0x1c], ebx
cmp eax, ebx
jle 0x402997
push 0xf003f
push ebx
push ebx
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x20], ebx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov edi, eax
cmp edi, ebx
je 0x402715
lea edx, [esp + 0x18]
lea eax, [esp + 0x10]
mov ebp, dword [sym.imp.ADVAPI32.dll_EnumServicesStatusA]
push edx
lea ecx, [esp + 0x18]
push eax
push ecx
push ebx
push ebx
push 3
push 0x30
push edi
call ebp
mov edx, dword [esp + 0x14]
push edx
call fcn.004094fa
mov esi, eax
add esp, 4
cmp esi, ebx
je 0x40270e
lea eax, [esp + 0x18]
lea ecx, [esp + 0x10]
push eax
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x18]
push ecx
push edx
push eax
push esi
push 3
push 0x30
push edi
call ebp
test eax, eax
je 0x402705
mov eax, dword [esp + 0x10]
xor ebp, ebp
cmp eax, ebx
jbe 0x40295f
mov ebx, esi
mov ecx, dword [esp + 0x180]
mov eax, dword [ebx]
push ecx
push eax
call fcn.00409323
add esp, 8
test eax, eax
je 0x40295d
mov eax, dword [esp + 0x10]
inc ebp
add ebx, 0x24
cmp ebp, eax
jb 0x40293a
xor ebx, ebx
push esi
call fcn.00409491
add esp, 4
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
cmp ebp, dword [esp + 0x10]
jae 0x402997
push 0x7d0
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [esp + 0x1c]
mov ecx, dword [0x4110a0]
inc eax
cmp eax, ecx
mov dword [esp + 0x1c], eax
jl 0x4028b2
mov edx, dword [esp + 0x1c]
pop edi
cmp edx, 3
pop esi
setl al
pop ebp
and eax, 0xff
pop ebx
add esp, 0x168
ret