Function at 0x40f2a0
Capabilities:
Enumerate services
Modify service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5777e8
mov eax, dword fs:[0]
push eax
sub esp, 0x44
mov eax, dword [0x628f58]
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 0x40f314
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x60ae58
call fcn.0040e850
add esp, 8
jmp 0x40f41e
push ebx
call dword [sym.imp.ADVAPI32.dll_LockServiceDatabase]
mov dword [ebp - 0x3c], eax
test eax, eax
jne 0x40f33b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.LockServiceDatabase_failed_w_err_0x_08lx_n
call fcn.0040e850
add esp, 8
jmp 0x40f41b
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 0x40f3c2
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
jne 0x40f3be
mov ebx, dword [ebp - 0x38]
test edi, edi
je 0x40f38f
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 0x40f374
jmp 0x40f3c2
test ebx, ebx
je 0x40f401
xor ebx, ebx
cmp dword [ebp - 0x30], ebx
jbe 0x40f401
nop dword [eax]
push dword [edi]
push dword [ebp - 0x4c]
call fcn.00555862
add esp, 8
test eax, eax
jne 0x40f3f8
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 0x40f45b
inc ebx
add edi, 0x24
cmp ebx, dword [ebp - 0x30]
jb 0x40f3d0
mov ebx, dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 0x48]
test eax, eax
je 0x40f411
push eax
call ebx
test esi, esi
je 0x40f418
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 0x40f435
push eax
call esi
test ebx, ebx
je 0x40f43c
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.0054b34c
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 0x40f4c2
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x40f4ba
add edi, edi
test esi, esi
je 0x40f498
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 0x40f480
jmp 0x40f4c2
test ebx, ebx
je 0x40f401
push dword [esi + 0xc]
mov edi, dword [ebp - 0x50]
push edi
call fcn.00555862
add esp, 8
test eax, eax
je 0x40f573
push 0x6062b4
lea ecx, [ebp - 0x28]
call fcn.004028e0
push edi
lea ecx, [ebp - 0x28]
mov dword [ebp - 4], 0
call fcn.00402930
push 0x6062b4
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 0x40f57a
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40f559
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40f58a
push edx
push ecx
call fcn.0054b35d
mov ebx, dword [sym.imp.KERNEL32.dll_LocalFree]
add esp, 8
push esi
call ebx
xor esi, esi
jmp 0x40f407
mov dword [ebp - 0x40], 1
mov ebx, dword [sym.imp.KERNEL32.dll_LocalFree]
push esi
call ebx
xor esi, esi
jmp 0x40f407
call fcn.005550db
int3