Function at 0x40e830
Capabilities:
Enumerate services
Modify service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x576868
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 0x40e8a4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x60adb8
call fcn.0040dde0
add esp, 8
jmp 0x40e9ae
push ebx
call dword [sym.imp.ADVAPI32.dll_LockServiceDatabase]
mov dword [ebp - 0x3c], eax
test eax, eax
jne 0x40e8cb
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.LockServiceDatabase_failed_w_err_0x_08lx_n
call fcn.0040dde0
add esp, 8
jmp 0x40e9ab
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 0x40e952
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
jne 0x40e94e
mov ebx, dword [ebp - 0x38]
test edi, edi
je 0x40e91f
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 0x40e904
jmp 0x40e952
test ebx, ebx
je 0x40e991
xor ebx, ebx
cmp dword [ebp - 0x30], ebx
jbe 0x40e991
nop dword [eax]
push dword [edi]
push dword [ebp - 0x4c]
call fcn.00554aa0
add esp, 8
test eax, eax
jne 0x40e988
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 0x40e9eb
inc ebx
add edi, 0x24
cmp ebx, dword [ebp - 0x30]
jb 0x40e960
mov ebx, dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [ebp - 0x48]
test eax, eax
je 0x40e9a1
push eax
call ebx
test esi, esi
je 0x40e9a8
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 0x40e9c5
push eax
call esi
test ebx, ebx
je 0x40e9cc
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.0054a576
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 0x40ea52
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x40ea4a
add edi, edi
test esi, esi
je 0x40ea28
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 0x40ea10
jmp 0x40ea52
test ebx, ebx
je 0x40e991
push dword [esi + 0xc]
mov edi, dword [ebp - 0x50]
push edi
call fcn.00554aa0
add esp, 8
test eax, eax
je 0x40eb03
push 0x60520c
lea ecx, [ebp - 0x28]
call fcn.004028e0
push edi
lea ecx, [ebp - 0x28]
mov dword [ebp - 4], 0
call fcn.00402930
push 0x60520c
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 0x40eb0a
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40eae9
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40eb1a
push edx
push ecx
call fcn.0054a587
mov ebx, dword [sym.imp.KERNEL32.dll_LocalFree]
add esp, 8
push esi
call ebx
xor esi, esi
jmp 0x40e997
mov dword [ebp - 0x40], 1
mov ebx, dword [sym.imp.KERNEL32.dll_LocalFree]
push esi
call ebx
xor esi, esi
jmp 0x40e997
call fcn.00554319
int3