Function at 0x40c9d0
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 0x40cb75
cmp dword [ebx + 0x14], 8
jb 0x40ca08
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 0x462e5c
push 0x462e5c
push eax
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov edi, eax
test edi, edi
je 0x40cad1
push 0
push 0
push edi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x40cb65
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
cmp eax, 0x420
je 0x40cb65
call ebx
push eax
lea eax, [ebp - 0x1c]
push str.StartService_failed_with__i.
push eax
call fcn.004123b0
add esp, 0xc
mov ecx, esi
push eax
call fcn.004032f0
mov edx, dword [ebp - 8]
cmp edx, 8
jb 0x40cab5
mov ecx, dword [ebp - 0x1c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40caab
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40cc16
push edx
push ecx
call fcn.0041b657
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 0x40cc01
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x1c]
push str.CreateService_failed_with__i.
push eax
call fcn.004123b0
mov ebx, eax
add esp, 0xc
cmp esi, ebx
je 0x40cb2b
mov ecx, esi
call fcn.00401280
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 0x40cb65
mov ecx, dword [ebp - 0x1c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40cb5b
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40cc1b
push edx
push ecx
call fcn.0041b657
add esp, 8
push dword [ebp - 0x20]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
jmp 0x40cc01
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x1c]
push str.OpenSCManager_failed_with__i.
push eax
call fcn.004123b0
mov ebx, eax
add esp, 0xc
cmp esi, ebx
je 0x40cbcb
mov ecx, esi
call fcn.00401280
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 0x40cc01
mov ecx, dword [ebp - 0x1c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40cbf7
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40cc20
push edx
push ecx
call fcn.0041b657
add esp, 8
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0041b616
mov esp, ebp
pop ebp
ret 8
call fcn.00436a89
call fcn.00436a89
call fcn.00436a89
int3