Function at 0x405600
Capabilities:
Enumerate services
Modify service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5656f8
mov eax, dword fs:[0]
push eax
sub esp, 0x44
mov eax, dword [0x5c2f60]
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 0x405674
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager_failed_w_err_0x_08lx_n
call fcn.00404cf0
mov ebx, dword [ebp - 0x30]
add esp, 8
mov esi, dword [ebp - 0x30]
jmp 0x4058ae
push ecx
call dword [sym.imp.ADVAPI32.dll_LockServiceDatabase]
mov dword [ebp - 0x30], eax
test eax, eax
jne 0x4056a1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.LockServiceDatabase_failed_w_err_0x_08lx_n
call fcn.00404cf0
mov ebx, dword [ebp - 0x30]
add esp, 8
mov esi, dword [ebp - 0x30]
jmp 0x4058ae
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 0x40572f
nop word [eax + eax]
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
jne 0x405727
mov edi, dword [ebp - 0x40]
test ebx, ebx
je 0x4056fb
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 0x4056e0
jmp 0x40572f
test edi, edi
je 0x4058ac
mov dword [ebp - 0x34], esi
cmp dword [ebp - 0x38], esi
jbe 0x4058ac
mov edi, ebx
nop dword [eax]
push dword [edi]
push dword [ebp - 0x4c]
call fcn.00547848
add esp, 8
test eax, eax
jne 0x405768
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 0x40577f
mov eax, dword [ebp - 0x34]
add edi, 0x24
inc eax
mov dword [ebp - 0x34], eax
cmp eax, dword [ebp - 0x38]
jb 0x405740
mov edi, dword [ebp - 0x2c]
jmp 0x4058ae
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 0x4057e6
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x4057e0
add edi, edi
test esi, esi
je 0x4057bd
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 0x4057a5
jmp 0x4057e6
cmp dword [ebp - 0x34], 0
je 0x405777
push dword [esi + 0xc]
mov edi, dword [ebp - 0x50]
push edi
call fcn.00547848
add esp, 8
test eax, eax
je 0x405897
push 0x5a618c
lea ecx, [ebp - 0x28]
call fcn.00401e20
push edi
lea ecx, [ebp - 0x28]
mov dword [ebp - 4], 0
call fcn.00401e70
push 0x5a618c
lea ecx, [ebp - 0x28]
call fcn.00401e70
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 0x4058a1
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x405882
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x405909
push edx
push ecx
call fcn.00540fb2
add esp, 8
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
xor esi, esi
jmp 0x4058ae
mov edi, dword [ebp - 0x2c]
mov dword [ebp - 0x44], 1
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
xor esi, esi
jmp 0x4058ae
xor edi, edi
test ebx, ebx
je 0x4058bd
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_LocalFree]
call ebx
jmp 0x4058c3
mov ebx, dword [sym.imp.KERNEL32.dll_LocalFree]
test esi, esi
je 0x4058ca
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 0x4058e0
push edi
call esi
mov eax, dword [ebp - 0x3c]
test eax, eax
je 0x4058ea
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.00540fa1
mov esp, ebp
pop ebp
ret
call fcn.00547145
int3