Function at 0x40ca00
Capabilities:
Create service
Delete service
Start service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [0x46b008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
push esi
mov esi, dword [ebp + 0xc]
push edi
push 2
xor edi, edi
push edi
push edi
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov dword [ebp - 0x20], eax
test eax, eax
je 0x40cba5
cmp dword [ebx + 0x14], 8
jb 0x40ca38
mov ebx, dword [ebx]
push 0
push 0
push 0
push 0
push 0
push ebx
push 0
push 3
push 1
push 0x10030
push 0x4632b4
push 0x4632b4
push eax
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov edi, eax
test edi, edi
je 0x40cb01
push 0
push 0
push edi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x40cb95
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
cmp eax, 0x420
je 0x40cb95
call ebx
push eax
lea eax, [ebp - 0x1c]
push str.StartService_failed_with__i.
push eax
call fcn.004123e0
add esp, 0xc
mov ecx, esi
push eax
call fcn.00403310
mov edx, dword [ebp - 8]
cmp edx, 8
jb 0x40cae5
mov ecx, dword [ebp - 0x1c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40cadb
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40cc46
push edx
push ecx
call fcn.0041b677
add esp, 8
push edi
call dword [sym.imp.ADVAPI32.dll_DeleteService]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
call esi
push dword [ebp - 0x20]
xor edi, edi
call esi
jmp 0x40cc31
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x1c]
push str.CreateService_failed_with__i.
push eax
call fcn.004123e0
mov ebx, eax
add esp, 0xc
cmp esi, ebx
je 0x40cb5b
mov ecx, esi
call fcn.004012a0
mov ecx, dword [ebx]
mov dword [esi], ecx
mov ecx, dword [ebx + 4]
mov dword [esi + 4], ecx
mov eax, dword [ebx + 8]
mov dword [esi + 8], eax
mov eax, dword [ebx + 0xc]
mov dword [esi + 0xc], eax
mov eax, dword [ebx + 0x10]
mov dword [esi + 0x10], eax
mov eax, dword [ebx + 0x14]
mov dword [esi + 0x14], eax
xor eax, eax
mov dword [ebx + 0x10], 0
mov dword [ebx + 0x14], 7
mov word [ebx], ax
mov edx, dword [ebp - 8]
cmp edx, 8
jb 0x40cb95
mov ecx, dword [ebp - 0x1c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40cb8b
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40cc4b
push edx
push ecx
call fcn.0041b677
add esp, 8
push dword [ebp - 0x20]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
jmp 0x40cc31
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x1c]
push str.OpenSCManager_failed_with__i.
push eax
call fcn.004123e0
mov ebx, eax
add esp, 0xc
cmp esi, ebx
je 0x40cbfb
mov ecx, esi
call fcn.004012a0
mov ecx, dword [ebx]
mov dword [esi], ecx
mov ecx, dword [ebx + 4]
mov dword [esi + 4], ecx
mov eax, dword [ebx + 8]
mov dword [esi + 8], eax
mov eax, dword [ebx + 0xc]
mov dword [esi + 0xc], eax
mov eax, dword [ebx + 0x10]
mov dword [esi + 0x10], eax
mov eax, dword [ebx + 0x14]
mov dword [esi + 0x14], eax
xor eax, eax
mov dword [ebx + 0x10], edi
mov dword [ebx + 0x14], 7
mov word [ebx], ax
mov edx, dword [ebp - 8]
cmp edx, 8
jb 0x40cc31
mov ecx, dword [ebp - 0x1c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40cc27
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40cc50
push edx
push ecx
call fcn.0041b677
add esp, 8
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0041b636
mov esp, ebp
pop ebp
ret 8
call fcn.00436a99
call fcn.00436a99
call fcn.00436a99
int3