Function at 0x40f540
Capabilities:
Enumerate services
Modify service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x577758
mov eax, dword fs:[0]
push eax
sub esp, 0x44
mov eax, dword [0x629f58]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x50], edx
mov dword [ebp - 0x4c], ecx
push 0xf003f
push 0
push 0
mov dword [ebp - 0x40], 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov ebx, eax
mov dword [ebp - 0x2c], 0
xor esi, esi
mov dword [ebp - 0x34], ebx
xor edi, edi
test ebx, ebx
jne 0x40f5b4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x60c1a8
call fcn.0040eaf0
add esp, 8
jmp 0x40f6be
push ebx
call dword [sym.imp.ADVAPI32.dll_LockServiceDatabase]
mov dword [ebp - 0x3c], eax
test eax, eax
jne 0x40f5db
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.LockServiceDatabase_failed_w_err_0x_08lx_n
call fcn.0040eaf0
add esp, 8
jmp 0x40f6bb
push 0x10000
push 0x40
mov dword [ebp - 0x30], esi
mov dword [ebp - 0x38], esi
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
push 0
mov edi, eax
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x38]
mov dword [ebp - 0x48], edi
push eax
push 0x10000
push edi
push 3
push 0x30
push ebx
call dword [sym.imp.ADVAPI32.dll_EnumServicesStatusW]
mov ebx, eax
test ebx, ebx
jne 0x40f662
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
jne 0x40f65e
mov ebx, dword [ebp - 0x38]
test edi, edi
je 0x40f62f
push edi
call dword [sym.imp.KERNEL32.dll_LocalFree]
push ebx
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
push 0
mov edi, eax
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x38]
mov dword [ebp - 0x48], edi
push eax
push ebx
push edi
push 3
push 0x30
push dword [ebp - 0x34]
call dword [sym.imp.ADVAPI32.dll_EnumServicesStatusW]
mov ebx, eax
test ebx, ebx
je 0x40f614
jmp 0x40f662
test ebx, ebx
je 0x40f6a1
xor ebx, ebx
cmp dword [ebp - 0x30], ebx
jbe 0x40f6a1
nop dword [eax]
push dword [edi]
push dword [ebp - 0x4c]
call fcn.00555790
add esp, 8
test eax, eax
jne 0x40f698
push 3
push dword [edi]
mov dword [ebp - 0x44], esi
push dword [ebp - 0x34]
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov dword [ebp - 0x2c], eax
test eax, eax
jne 0x40f6fb
inc ebx
add edi, 0x24
cmp ebx, dword [ebp - 0x30]
jb 0x40f670
mov ebx, dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 0x48]
test eax, eax
je 0x40f6b1
push eax
call ebx
test esi, esi
je 0x40f6b8
push esi
call ebx
mov ebx, dword [ebp - 0x34]
mov edi, dword [ebp - 0x3c]
push edi
call dword [sym.imp.ADVAPI32.dll_UnlockServiceDatabase]
mov eax, dword [ebp - 0x2c]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test eax, eax
je 0x40f6d5
push eax
call esi
test ebx, ebx
je 0x40f6dc
push ebx
call esi
mov eax, dword [ebp - 0x40]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0054b283
mov esp, ebp
pop ebp
ret
mov edi, 0x1000
push edi
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov esi, eax
lea eax, [ebp - 0x44]
push eax
push edi
push esi
push dword [ebp - 0x2c]
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
mov ebx, eax
test ebx, ebx
jne 0x40f762
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x40f75a
add edi, edi
test esi, esi
je 0x40f738
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
push edi
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov esi, eax
lea eax, [ebp - 0x44]
push eax
push edi
push esi
push dword [ebp - 0x2c]
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
mov ebx, eax
test ebx, ebx
je 0x40f720
jmp 0x40f762
test ebx, ebx
je 0x40f6a1
push dword [esi + 0xc]
mov edi, dword [ebp - 0x50]
push edi
call fcn.00555790
add esp, 8
test eax, eax
je 0x40f813
push 0x60627c
lea ecx, [ebp - 0x28]
call fcn.004028e0
push edi
lea ecx, [ebp - 0x28]
mov dword [ebp - 4], 0
call fcn.00402930
push 0x60627c
lea ecx, [ebp - 0x28]
call fcn.00402930
cmp dword [ebp - 0x14], 8
lea eax, [ebp - 0x28]
push 0
cmovae eax, dword [ebp - 0x28]
push 0
push 0
push 0
push 0
push 0
push eax
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0xffffffffffffffff
push dword [ebp - 0x2c]
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfigW]
mov edx, dword [ebp - 0x14]
mov dword [ebp - 0x40], eax
cmp edx, 8
jb 0x40f81a
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40f7f9
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40f82a
push edx
push ecx
call fcn.0054b294
mov ebx, dword [sym.imp.KERNEL32.dll_LocalFree]
add esp, 8
push esi
call ebx
xor esi, esi
jmp 0x40f6a7
mov dword [ebp - 0x40], 1
mov ebx, dword [sym.imp.KERNEL32.dll_LocalFree]
push esi
call ebx
xor esi, esi
jmp 0x40f6a7
call fcn.00555009
int3