Function at 0x406ca0
Capabilities:
Enumerate services
Modify service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x56d658
mov eax, dword fs:[0]
push eax
sub esp, 0x44
mov eax, dword [0x618f60]
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 - 0x44], 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov ecx, eax
xor edi, edi
mov dword [ebp - 0x3c], ecx
mov dword [ebp - 0x2c], edi
test ecx, ecx
jne 0x406d14
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x5fc3d8
call fcn.00406250
mov ebx, dword [ebp - 0x30]
add esp, 8
mov esi, dword [ebp - 0x30]
jmp 0x406f4e
push ecx
call dword [sym.imp.ADVAPI32.dll_LockServiceDatabase]
mov dword [ebp - 0x30], eax
test eax, eax
jne 0x406d41
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.LockServiceDatabase_failed_w_err_0x_08lx_n
call fcn.00406250
mov ebx, dword [ebp - 0x30]
add esp, 8
mov esi, dword [ebp - 0x30]
jmp 0x406f4e
push 0x10000
xor esi, esi
push 0x40
mov dword [ebp - 0x38], esi
mov dword [ebp - 0x40], esi
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
push esi
mov ebx, eax
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x40]
push eax
push 0x10000
push ebx
push 3
push 0x30
push dword [ebp - 0x3c]
call dword [sym.imp.ADVAPI32.dll_EnumServicesStatusW]
mov edi, eax
test edi, edi
jne 0x406dcf
nop word [eax + eax]
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
jne 0x406dc7
mov edi, dword [ebp - 0x40]
test ebx, ebx
je 0x406d9b
push ebx
call dword [sym.imp.KERNEL32.dll_LocalFree]
push edi
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
push 0
mov ebx, eax
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x40]
push eax
push edi
push ebx
push 3
push 0x30
push dword [ebp - 0x3c]
call dword [sym.imp.ADVAPI32.dll_EnumServicesStatusW]
mov edi, eax
test edi, edi
je 0x406d80
jmp 0x406dcf
test edi, edi
je 0x406f4c
mov dword [ebp - 0x34], esi
cmp dword [ebp - 0x38], esi
jbe 0x406f4c
mov edi, ebx
nop dword [eax]
push dword [edi]
push dword [ebp - 0x4c]
call fcn.0054ca00
add esp, 8
test eax, eax
jne 0x406e08
push 3
push dword [edi]
mov dword [ebp - 0x48], esi
push dword [ebp - 0x3c]
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov dword [ebp - 0x2c], eax
test eax, eax
jne 0x406e1f
mov eax, dword [ebp - 0x34]
add edi, 0x24
inc eax
mov dword [ebp - 0x34], eax
cmp eax, dword [ebp - 0x38]
jb 0x406de0
mov edi, dword [ebp - 0x2c]
jmp 0x406f4e
mov edi, 0x1000
push edi
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov esi, eax
lea eax, [ebp - 0x48]
push eax
push edi
push esi
push dword [ebp - 0x2c]
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
mov dword [ebp - 0x34], eax
test eax, eax
jne 0x406e86
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x406e80
add edi, edi
test esi, esi
je 0x406e5d
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 - 0x48]
push eax
push edi
push esi
push dword [ebp - 0x2c]
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
mov dword [ebp - 0x34], eax
test eax, eax
je 0x406e45
jmp 0x406e86
cmp dword [ebp - 0x34], 0
je 0x406e17
push dword [esi + 0xc]
mov edi, dword [ebp - 0x50]
push edi
call fcn.0054ca00
add esp, 8
test eax, eax
je 0x406f37
push 0x5fc474
lea ecx, [ebp - 0x28]
call fcn.00402870
push edi
lea ecx, [ebp - 0x28]
mov dword [ebp - 4], 0
call fcn.004028c0
push 0x5fc474
lea ecx, [ebp - 0x28]
call fcn.004028c0
cmp dword [ebp - 0x14], 8
lea eax, [ebp - 0x28]
mov edi, dword [ebp - 0x2c]
cmovae eax, dword [ebp - 0x28]
push 0
push 0
push 0
push 0
push 0
push 0
push eax
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0xffffffffffffffff
push edi
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfigW]
mov edx, dword [ebp - 0x14]
mov dword [ebp - 0x44], eax
cmp edx, 8
jb 0x406f41
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x406f22
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406fa9
push edx
push ecx
call fcn.005424fd
add esp, 8
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
xor esi, esi
jmp 0x406f4e
mov edi, dword [ebp - 0x2c]
mov dword [ebp - 0x44], 1
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
xor esi, esi
jmp 0x406f4e
xor edi, edi
test ebx, ebx
je 0x406f5d
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_LocalFree]
call ebx
jmp 0x406f63
mov ebx, dword [sym.imp.KERNEL32.dll_LocalFree]
test esi, esi
je 0x406f6a
push esi
call ebx
push dword [ebp - 0x30]
call dword [sym.imp.ADVAPI32.dll_UnlockServiceDatabase]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test edi, edi
je 0x406f80
push edi
call esi
mov eax, dword [ebp - 0x3c]
test eax, eax
je 0x406f8a
push eax
call esi
mov eax, dword [ebp - 0x44]
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.005424ec
mov esp, ebp
pop ebp
ret
call fcn.0054c279
int3