Function at 0x4f7ce8
Capabilities:
Modify service

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffdc
push ebx
push esi
push edi
mov dword [ebp - 8], ecx
mov dword [ebp - 0xc], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__System__UStrAddRef_qqrpv
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrAddRef_qqrpv
xor eax, eax
push ebp
push 0x4f7f41
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 0xd], 1
xor esi, esi
xor eax, eax
mov dword [ebp - 0x1c], eax
push 0xf003f
push 0
push 0
call sub.advapi32.dll_OpenSCManagerW
mov ebx, eax
test ebx, ebx
jne 0x4f7d3b
mov byte [ebp - 0xd], 0
push ebx
call sub.advapi32.dll_LockServiceDatabase
mov dword [ebp - 0x14], eax
xor edx, edx
push ebp
push 0x4f7f1f
push dword fs:[edx]
mov dword fs:[edx], esp
cmp dword [ebp - 0x14], 0
jne 0x4f7d99
call sub.kernel32.dll_GetLastError
cmp eax, 0x41f
je 0x4f7d68
mov byte [ebp - 0xd], 0
push 0x10c
push 0x40
call sub.kernel32.dll_LocalAlloc_1
mov edi, eax
test edi, edi
lea eax, [ebp - 0x18]
push eax
push 0x10c
push edi
push ebx
call sub.advapi32.dll_QueryServiceLockStatusW
test eax, eax
jne 0x4f7d90
mov byte [ebp - 0xd], 0
cmp dword [edi], 0
push edi
call sub.kernel32.dll_LocalFree
push 2
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
push ebx
call sub.advapi32.dll_OpenServiceW
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jne 0x4f7db7
mov byte [ebp - 0xd], 0
xor edx, edx
push ebp
push 0x4f7ef8
push dword fs:[edx]
mov dword fs:[edx], esp
mov eax, dword [ebp - 0xc]
cmp eax, 4
ja case.default.0x4f7dcd
jmp dword [eax*4 + 0x4f7dd4]
xor esi, esi
jmp case.default.0x4f7dcd
mov esi, 1
jmp case.default.0x4f7dcd
mov esi, 2
jmp case.default.0x4f7dcd
mov esi, 3
jmp case.default.0x4f7dcd
mov esi, 4
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push 0xffffffffffffffff
push esi
push 0x110
mov eax, dword [ebp - 0x1c]
push eax
call sub.advapi32.dll_ChangeServiceConfigW
test eax, eax
jne 0x4f7e2d
mov byte [ebp - 0xd], 0
push 0x4f7f54
call sub.kernel32.dll_GetModuleHandleW_1
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
setne al
test al, al
jne 0x4f7e54
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x4f7f26
xor edx, edx
push ebp
push 0x4f7eda
push dword fs:[edx]
mov dword fs:[edx], esp
push 0x4f7f70
mov eax, dword [ebp - 0x20]
push eax
call fcn.00401c60
mov ebx, eax
test ebx, ebx
setne al
test al, al
jne 0x4f7e8f
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x4f7f26
cmp dword [ebp - 8], 0
je 0x4f7ea2
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov dword [ebp - 0x24], eax
jmp 0x4f7ea7
xor eax, eax
mov dword [ebp - 0x24], eax
lea ecx, [ebp - 0x24]
mov edx, dword [0x5a0f24]
mov eax, dword [ebp - 0x1c]
call ebx
cmp eax, 1
sbb eax, eax
inc eax
test al, al
jne 0x4f7ec3
mov byte [ebp - 0xd], 0
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4f7ee1
mov eax, dword [ebp - 0x20]
push eax
call sub.kernel32.dll_FreeLibrary
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4f7f48
lea eax, [ebp - 8]
mov edx, 2
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
ret