Function at 0x404af0
Capabilities:
Enumerate services
Modify service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x51f9b8
mov eax, dword fs:[0]
push eax
sub esp, 0x4c
mov eax, dword [0x56a5dc]
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 eax, dword [ebp + 8]
xor ebx, ebx
push 0xf003f
push ebx
push ebx
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x50], ecx
mov dword [ebp - 0x34], ebx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
mov dword [ebp - 0x3c], edi
mov dword [ebp - 0x30], ebx
cmp edi, ebx
jne 0x404b5e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager_failed_w_err_0x_08lx_n
call fcn.004faf08
mov ebx, dword [ebp - 0x3c]
add esp, 8
jmp 0x404d50
push edi
call dword [sym.imp.ADVAPI32.dll_LockServiceDatabase]
mov dword [ebp - 0x54], eax
cmp eax, ebx
jne 0x404b88
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.LockServiceDatabase_failed_w_err_0x_08lx_n
call fcn.004faf08
mov ebx, dword [ebp - 0x3c]
add esp, 8
jmp 0x404d50
push 0x10000
push 0x40
mov dword [ebp - 0x38], ebx
mov dword [ebp - 0x44], ebx
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
push ebx
lea edx, [ebp - 0x38]
push edx
lea ecx, [ebp - 0x44]
push ecx
push 0x10000
push eax
push 3
push 0x30
push edi
mov dword [ebp - 0x40], eax
call dword [sym.imp.ADVAPI32.dll_EnumServicesStatusW]
mov esi, eax
test esi, esi
jne 0x404c0f
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
jne 0x404c07
mov eax, dword [ebp - 0x40]
mov esi, dword [ebp - 0x44]
test eax, eax
je 0x404bdc
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
push esi
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
push 0
lea edx, [ebp - 0x38]
push edx
lea ecx, [ebp - 0x44]
push ecx
push esi
push eax
push 3
push 0x30
push edi
mov dword [ebp - 0x40], eax
call dword [sym.imp.ADVAPI32.dll_EnumServicesStatusW]
mov esi, eax
test esi, esi
je 0x404bbe
jmp 0x404c0f
test esi, esi
je 0x404d50
mov dword [ebp - 0x48], ebx
cmp dword [ebp - 0x38], ebx
jbe 0x404d50
mov esi, dword [ebp - 0x40]
mov edi, edi
mov edx, dword [esi]
mov eax, dword [ebp - 0x58]
push edx
push eax
call fcn.004fb33e
add esp, 8
test eax, eax
jne 0x404c49
mov ecx, dword [esi]
push 3
push ecx
push edi
mov dword [ebp - 0x4c], ebx
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov dword [ebp - 0x30], eax
test eax, eax
jne 0x404c5d
mov eax, dword [ebp - 0x48]
inc eax
add esi, 0x24
mov dword [ebp - 0x48], eax
cmp eax, dword [ebp - 0x38]
jb 0x404c20
jmp 0x404d50
mov edi, 0x1000
push edi
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
lea edx, [ebp - 0x4c]
push edx
mov ebx, eax
mov eax, dword [ebp - 0x30]
push edi
push ebx
push eax
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
mov esi, eax
test esi, esi
jne 0x404cc6
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x404cbe
add edi, edi
test ebx, ebx
je 0x404c9b
push ebx
call dword [sym.imp.KERNEL32.dll_LocalFree]
push edi
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edx, dword [ebp - 0x30]
lea ecx, [ebp - 0x4c]
push ecx
push edi
mov ebx, eax
push ebx
push edx
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
mov esi, eax
test esi, esi
je 0x404c83
jmp 0x404cc6
test esi, esi
je 0x404d4d
mov eax, dword [ebx + 0xc]
mov esi, dword [ebp - 0x50]
push eax
push esi
call fcn.004fb33e
add esp, 8
test eax, eax
je 0x404d3d
mov eax, 0x54bef4
lea ecx, [ebp - 0x2c]
call fcn.004020a0
lea ecx, [ebp - 0x2c]
push ecx
mov eax, esi
mov dword [ebp - 4], 0
call fcn.00401bc0
lea edx, [ebp - 0x2c]
push edx
mov eax, 0x54bef4
call fcn.00401bc0
cmp dword [ebp - 0x18], 8
mov eax, dword [ebp - 0x2c]
jae 0x404d13
lea eax, [ebp - 0x2c]
push 0
push 0
push 0
push 0
push 0
push 0
push eax
mov eax, dword [ebp - 0x30]
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0xffffffffffffffff
push eax
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfigW]
lea esi, [ebp - 0x2c]
mov dword [ebp - 0x34], eax
call fcn.004014c0
jmp 0x404d44
mov dword [ebp - 0x34], 1
push ebx
call dword [sym.imp.KERNEL32.dll_LocalFree]
xor ebx, ebx
mov edi, dword [ebp - 0x3c]
mov eax, dword [ebp - 0x40]
test eax, eax
je 0x404d5e
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
test ebx, ebx
je 0x404d69
push ebx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov ecx, dword [ebp - 0x54]
push ecx
call dword [sym.imp.ADVAPI32.dll_UnlockServiceDatabase]
cmp dword [ebp - 0x30], 0
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
je 0x404d85
mov edx, dword [ebp - 0x30]
push edx
call esi
test edi, edi
je 0x404d8c
push edi
call esi
mov eax, dword [ebp - 0x34]
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.004fa0b9
mov esp, ebp
pop ebp
ret