Function at 0x40a2d8
Capabilities:
Create service
Delete service
Modify service
Query service status
Start service
Stop service

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff78
mov eax, 0x4823c4
push ebx
push esi
push edi
call fcn.004734f8
mov dword [ebp - 0x28], 3
lea edx, [ebp + 0x10]
lea eax, [ebp + 0x10]
call fcn.0047c200
inc dword [ebp - 0x28]
lea edx, [ebp + 0xc]
mov word [ebp - 0x34], 8
lea eax, [ebp + 0xc]
call fcn.0047c200
inc dword [ebp - 0x28]
lea edx, [ebp + 8]
lea eax, [ebp + 8]
call fcn.0047c200
inc dword [ebp - 0x28]
xor edx, edx
mov word [ebp - 0x34], 0x14
mov dword [ebp - 4], edx
mov dl, 1
inc dword [ebp - 0x28]
mov eax, dword [0x41d964]
mov word [ebp - 0x34], 8
call fcn.0041da64
mov dword [ebp - 0x48], eax
mov edx, Ordinal_5
mov eax, dword [ebp - 0x48]
call fcn.0047c18c
mov word [ebp - 0x34], 0x20
xor ecx, ecx
mov dword [ebp - 0xc], ecx
lea ecx, [ebp - 0xc]
inc dword [ebp - 0x28]
lea edx, [ebp + 8]
mov eax, 0x47f396
call fcn.0047c548
lea edx, [ebp - 0xc]
mov edx, dword [edx]
xor ecx, ecx
mov eax, dword [ebp - 0x48]
call fcn.0041db6c
push eax
dec dword [ebp - 0x28]
lea eax, [ebp - 0xc]
mov edx, 2
call fcn.0047c298
pop ecx
test cl, cl
je 0x40a3ee
mov word [ebp - 0x34], 0x2c
mov edx, str.ImagePath
lea eax, [ebp - 0x10]
call fcn.0047c1c8
inc dword [ebp - 0x28]
mov edx, dword [eax]
xor eax, eax
mov dword [ebp - 0x14], eax
lea ecx, [ebp - 0x14]
inc dword [ebp - 0x28]
mov eax, dword [ebp - 0x48]
call fcn.0041dfdc
lea edx, [ebp - 0x14]
lea eax, [ebp - 4]
call fcn.0047c2c8
dec dword [ebp - 0x28]
lea eax, [ebp - 0x14]
mov edx, 2
call fcn.0047c298
dec dword [ebp - 0x28]
lea eax, [ebp - 0x10]
mov edx, 2
call fcn.0047c298
mov eax, dword [ebp - 0x48]
call fcn.0041dad4
mov eax, dword [ebp - 0x48]
call fcn.00431a60
mov word [ebp - 0x34], 0x38
lea edx, [ebp + 0xc]
lea eax, [ebp - 8]
call fcn.0047c200
inc dword [ebp - 0x28]
mov word [ebp - 0x34], 8
push 0xf003f
push 0
push 0
call sub.ADVAPI32.DLL_OpenSCManagerA
mov dword [ebp - 0x4c], eax
cmp dword [ebp - 0x4c], 0
jne 0x40a492
xor eax, eax
mov edx, 2
push eax
lea eax, [ebp - 8]
dec dword [ebp - 0x28]
call fcn.0047c298
dec dword [ebp - 0x28]
lea eax, [ebp - 4]
mov edx, 2
call fcn.0047c298
dec dword [ebp - 0x28]
lea eax, [ebp + 8]
mov edx, 2
call fcn.0047c298
dec dword [ebp - 0x28]
lea eax, [ebp + 0xc]
mov edx, 2
call fcn.0047c298
dec dword [ebp - 0x28]
lea eax, [ebp + 0x10]
mov edx, 2
call fcn.0047c298
pop eax
mov edx, dword [ebp - 0x44]
mov dword fs:[0], edx
jmp 0x40a7f9
push 0xf01ff
cmp dword [ebp + 8], 0
je 0x40a4a2
mov ecx, dword [ebp + 8]
jmp 0x40a4a7
mov ecx, 0x47f3c4
push ecx
mov eax, dword [ebp - 0x4c]
push eax
call sub.ADVAPI32.DLL_OpenServiceA
mov dword [ebp - 0x50], eax
cmp dword [ebp - 0x50], 0
je 0x40a59b
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 4]
call fcn.00420910
test eax, eax
je 0x40a597
mov word [ebp - 0x34], 0x44
mov edx, 0x47f3c5
lea eax, [ebp - 0x18]
call fcn.0047c1c8
inc dword [ebp - 0x28]
lea edx, [ebp - 0x18]
lea eax, [ebp - 4]
call fcn.0047c380
test al, al
lea eax, [ebp - 0x18]
setne dl
and edx, 1
push edx
mov edx, 2
dec dword [ebp - 0x28]
call fcn.0047c298
pop ecx
test ecx, ecx
je 0x40a597
mov bl, 1
lea eax, [ebp - 0x6c]
push eax
push 1
mov edx, dword [ebp - 0x50]
push edx
call sub.ADVAPI32.DLL_ControlService
mov ecx, dword [ebp - 0x50]
push ecx
call sub.ADVAPI32.DLL_DeleteService
test eax, eax
jne 0x40a59d
xor eax, eax
mov edx, 2
push eax
lea eax, [ebp - 8]
dec dword [ebp - 0x28]
call fcn.0047c298
dec dword [ebp - 0x28]
lea eax, [ebp - 4]
mov edx, 2
call fcn.0047c298
dec dword [ebp - 0x28]
lea eax, [ebp + 8]
mov edx, 2
call fcn.0047c298
dec dword [ebp - 0x28]
lea eax, [ebp + 0xc]
mov edx, 2
call fcn.0047c298
dec dword [ebp - 0x28]
lea eax, [ebp + 0x10]
mov edx, 2
call fcn.0047c298
pop eax
mov edx, dword [ebp - 0x44]
mov dword fs:[0], edx
jmp 0x40a7f9
xor ebx, ebx
jmp 0x40a59d
mov bl, 1
test bl, bl
je 0x40a66b
push 0
push 0
push 0
push 0
push 0
cmp dword [ebp - 8], 0
je 0x40a5ba
mov eax, dword [ebp - 8]
jmp 0x40a5bf
mov eax, 0x47f3c8
push eax
push 1
push 2
push 0x10
push 0xf01ff
cmp dword [ebp + 8], 0
je 0x40a5d6
mov edx, dword [ebp + 8]
jmp 0x40a5db
mov edx, 0x47f3c7
push edx
cmp dword [ebp + 8], 0
je 0x40a5e7
mov eax, dword [ebp + 8]
jmp 0x40a5ec
mov eax, 0x47f3c6
push eax
mov edx, dword [ebp - 0x4c]
push edx
call sub.ADVAPI32.DLL_CreateServiceA
mov dword [ebp - 0x50], eax
cmp dword [ebp - 0x50], 0
jne 0x40a66b
mov ecx, dword [ebp - 0x4c]
push ecx
call sub.ADVAPI32.DLL_CloseServiceHandle
xor eax, eax
mov edx, 2
push eax
lea eax, [ebp - 8]
dec dword [ebp - 0x28]
call fcn.0047c298
dec dword [ebp - 0x28]
lea eax, [ebp - 4]
mov edx, 2
call fcn.0047c298
dec dword [ebp - 0x28]
lea eax, [ebp + 8]
mov edx, 2
call fcn.0047c298
dec dword [ebp - 0x28]
lea eax, [ebp + 0xc]
mov edx, 2
call fcn.0047c298
dec dword [ebp - 0x28]
lea eax, [ebp + 0x10]
mov edx, 2
call fcn.0047c298
pop eax
mov edx, dword [ebp - 0x44]
mov dword fs:[0], edx
jmp 0x40a7f9
lea ecx, [ebp - 0x88]
push ecx
mov eax, dword [ebp - 0x50]
push eax
call sub.ADVAPI32.DLL_QueryServiceStatus
cmp dword [ebp - 0x84], 1
jne 0x40a789
mov edx, dword [0x487d78]
mov eax, dword [edx]
call fcn.0045c250
mov dl, 1
mov eax, dword [0x41d964]
call fcn.0041da64
mov dword [ebp - 0x48], eax
mov edx, Ordinal_5
mov word [ebp - 0x34], 0x50
mov eax, dword [ebp - 0x48]
call fcn.0047c18c
mov word [ebp - 0x34], 0x5c
xor edx, edx
mov dword [ebp - 0x1c], edx
lea ecx, [ebp - 0x1c]
inc dword [ebp - 0x28]
lea edx, [ebp + 8]
mov eax, str.SYSTEMCurrentControlSetServices_
call fcn.0047c548
lea edx, [ebp - 0x1c]
mov edx, dword [edx]
xor ecx, ecx
mov eax, dword [ebp - 0x48]
call fcn.0041db6c
push eax
dec dword [ebp - 0x28]
lea eax, [ebp - 0x1c]
mov edx, 2
call fcn.0047c298
pop ecx
test cl, cl
je 0x40a72d
mov word [ebp - 0x34], 0x68
mov edx, str.Description
lea eax, [ebp - 0x20]
call fcn.0047c1c8
inc dword [ebp - 0x28]
mov edx, dword [eax]
mov ecx, dword [ebp + 0x10]
mov eax, dword [ebp - 0x48]
call fcn.0041dfb0
dec dword [ebp - 0x28]
lea eax, [ebp - 0x20]
mov edx, 2
call fcn.0047c298
mov eax, dword [ebp - 0x48]
call fcn.0041dad4
mov word [ebp - 0x34], 8
jmp 0x40a748
mov eax, dword [ebp - 0x48]
call fcn.00431a60
push 0
push 0
mov edx, dword [ebp - 0x50]
push edx
call sub.ADVAPI32.DLL_StartServiceA
cmp dword [ebp + 0x10], 0
je 0x40a768
mov ecx, dword [ebp + 0x10]
jmp 0x40a76d
mov ecx, 0x47f3f9
push ecx
push 0
push 0
push 0
push 0
push 0
push 0
push 0xffffffffffffffff
push 2
push 0xffffffffffffffff
mov eax, dword [ebp - 0x50]
push eax
call sub.ADVAPI32.DLL_ChangeServiceConfigA
mov edx, dword [ebp - 0x50]
push edx
call sub.ADVAPI32.DLL_CloseServiceHandle
mov eax, dword [ebp - 0x4c]
push eax
call sub.ADVAPI32.DLL_CloseServiceHandle
mov al, 1
mov edx, 2
push eax
lea eax, [ebp - 8]
dec dword [ebp - 0x28]
call fcn.0047c298
dec dword [ebp - 0x28]
lea eax, [ebp - 4]
mov edx, 2
call fcn.0047c298
dec dword [ebp - 0x28]
lea eax, [ebp + 8]
mov edx, 2
call fcn.0047c298
dec dword [ebp - 0x28]
lea eax, [ebp + 0xc]
mov edx, 2
call fcn.0047c298
dec dword [ebp - 0x28]
lea eax, [ebp + 0x10]
mov edx, 2
call fcn.0047c298
pop eax
mov edx, dword [ebp - 0x44]
mov dword fs:[0], edx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret