Function at 0x41d310
Capabilities:
Modify service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4405e5
mov eax, dword fs:[0]
push eax
sub esp, 0x2a4
mov eax, dword [0x4570d8]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov ebx, ecx
mov dword [ebp - 0x124], ebx
push 1
lea ecx, [ebp - 0x1f8]
call fcn.00401f70
mov dword [eax + 0x60], 0x64
add eax, 0x10
push str.ReconfigureService__
push eax
mov dword [ebp - 4], 0
call fcn.00401240
mov esi, eax
add esp, 8
mov ecx, dword [esi]
push 0xa
mov ecx, dword [ecx + 4]
add ecx, esi
call fcn.004075e0
movzx ecx, ax
push ecx
mov ecx, esi
call fcn.00406e20
mov ecx, esi
call fcn.00406690
lea ecx, [ebp - 0x188]
call fcn.0040c830
lea eax, [ebp - 0x188]
mov dword [ebp - 4], 1
push eax
mov dword [ebp - method.std::ios_base.virtual_0], vtable.std::ios_base.0
call fcn.004209c4
add esp, 4
mov dword [ebp - 4], 2
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
mov dword [ebp - 0x138], edi
mov byte [ebp - 4], 3
test edi, edi
jne 0x41d40a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager
lea ecx, [ebp - 0x40]
call fcn.00408120
push 0x453ea8
lea eax, [ebp - 0x40]
push eax
call fcn.00423c96
push 0xf003f
lea eax, [ebx + 0x40]
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
mov dword [ebp - 0x13c], esi
mov byte [ebp - 4], 4
test esi, esi
jne 0x41d44c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenService
lea ecx, [ebp - 0x6c]
call fcn.00408120
push 0x453ea8
lea eax, [ebp - 0x6c]
push eax
call fcn.00423c96
mov dword [ebp - 0x134], 0
mov dword [ebp - 0x130], 0
mov dword [ebp - 0x12c], 0
lea eax, [ebp - 0x128]
mov byte [ebp - 4], 5
push eax
push 0
push 0
push esi
mov dword [ebp - 0x128], 0
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
test eax, eax
jne 0x41d4c1
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
je 0x41d4c1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceConfig_1st
lea ecx, [ebp - 0x98]
call fcn.00408120
push 0x453ea8
lea eax, [ebp - 0x98]
push eax
call fcn.00423c96
push dword [ebp - 0x128]
lea ecx, [ebp - 0x134]
call fcn.0041f9a0
xor ebx, ebx
mov dword [ebp - 0x120], ebx
cmp ebx, 3
jge 0x41d61b
push 1
lea ecx, [ebp - 0x1f8]
call fcn.00401f70
mov dword [eax + 0x60], 0x64
add eax, 0x10
push str.ReconfigureService__:_trying_QueryServiceConfig__retry_attempt:
push eax
mov byte [ebp - 4], 6
call fcn.00401240
add esp, 8
mov ecx, eax
push ebx
call fcn.004145a0
mov ebx, eax
push 0xa
mov eax, dword [ebx]
mov ecx, dword [eax + 4]
add ecx, ebx
call fcn.004075e0
movzx eax, ax
mov ecx, ebx
push eax
call fcn.00406e20
mov ecx, ebx
call fcn.00406690
lea ecx, [ebp - 0x188]
call fcn.0040c830
lea eax, [ebp - 0x188]
mov byte [ebp - 4], 7
push eax
mov dword [ebp - method.std::ios_base.virtual_0], vtable.std::ios_base.0
call fcn.004209c4
mov ebx, dword [ebp - 0x134]
lea eax, [ebp - 0x128]
add esp, 4
mov byte [ebp - 4], 5
push eax
push dword [ebp - 0x128]
push ebx
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
test eax, eax
jne 0x41d621
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x41d607
push 1
lea ecx, [ebp - 0x1f8]
call fcn.00401f70
mov dword [eax + 0x60], 0x64
add eax, 0x10
push str.ReconfigureService___failed_on_2nd_call_to_QueryServiceConfig._Retrying
push eax
mov byte [ebp - 4], 8
call fcn.00401240
mov ebx, eax
add esp, 8
mov eax, dword [ebx]
push 0xa
mov ecx, dword [eax + 4]
add ecx, ebx
call fcn.004075e0
movzx eax, ax
mov ecx, ebx
push eax
call fcn.00406e20
mov ecx, ebx
call fcn.00406690
lea ecx, [ebp - 0x188]
call fcn.0040c830
lea eax, [ebp - 0x188]
mov byte [ebp - 4], 9
push eax
mov dword [ebp - method.std::ios_base.virtual_0], vtable.std::ios_base.0
call fcn.004209c4
add esp, 4
mov byte [ebp - 4], 5
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ebx, dword [ebp - 0x120]
inc ebx
jmp 0x41d4d4
mov ebx, dword [ebp - 0x134]
push 1
lea ecx, [ebp - 0x1f8]
call fcn.00401f70
mov dword [eax + 0x60], 0x64
add eax, 0x10
push str.Current_startup_type
push eax
mov byte [ebp - 4], 0xa
call fcn.00401240
add esp, 8
mov ecx, eax
push dword [ebx + 4]
call fcn.0040cb50
mov edx, eax
push 0xa
mov dword [ebp - 0x120], edx
mov eax, dword [edx]
mov ecx, dword [eax + 4]
add ecx, edx
call fcn.004075e0
mov ecx, dword [ebp - 0x120]
movzx eax, ax
push eax
call fcn.00406e20
mov ecx, dword [ebp - 0x120]
call fcn.00406690
lea ecx, [ebp - 0x188]
call fcn.0040c830
lea eax, [ebp - 0x188]
mov byte [ebp - 4], 0xb
push eax
mov dword [ebp - method.std::ios_base.virtual_0], vtable.std::ios_base.0
call fcn.004209c4
mov eax, dword [ebx + 4]
add esp, 4
mov byte [ebp - 4], 5
cmp eax, 3
je 0x41d794
cmp eax, 4
je 0x41d794
push 1
lea ecx, [ebp - 0x1f8]
call fcn.00401f70
mov dword [eax + 0x60], 0xa
add eax, 0x10
push str.Changing_startup_type_to_SERVICE_DEMAND_START
push eax
mov byte [ebp - 4], 0xc
call fcn.00401240
mov edx, eax
add esp, 8
mov dword [ebp - 0x120], edx
mov eax, dword [edx]
push 0xa
mov ecx, dword [eax + 4]
add ecx, edx
call fcn.004075e0
mov ecx, dword [ebp - 0x120]
movzx eax, ax
push eax
call fcn.00406e20
mov ecx, dword [ebp - 0x120]
call fcn.00406690
lea ecx, [ebp - 0x188]
call fcn.0040c830
lea eax, [ebp - 0x188]
mov byte [ebp - 4], 0xd
push eax
mov dword [ebp - method.std::ios_base.virtual_0], vtable.std::ios_base.0
call fcn.004209c4
add esp, 4
mov byte [ebp - 4], 5
push 0
push 0
push 0
push str.RPCSS
push 0
push 0
push 0
push 0xffffffffffffffff
push 3
push 0xffffffffffffffff
push esi
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfigW]
test eax, eax
jne 0x41d794
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ChangeServiceConfig
lea ecx, [ebp - 0xc4]
call fcn.00408120
push 0x453ea8
lea eax, [ebp - 0xc4]
push eax
call fcn.00423c96
push 1
lea ecx, [ebp - 0x1f8]
call fcn.00401f70
mov dword [eax + 0x60], 0xa
add eax, 0x10
push str.Adjusting_privileges
push eax
mov byte [ebp - 4], 0xe
call fcn.00401240
mov edx, eax
add esp, 8
mov dword [ebp - 0x120], edx
mov eax, dword [edx]
push 0xa
mov ecx, dword [eax + 4]
add ecx, edx
call fcn.004075e0
mov ecx, dword [ebp - 0x120]
movzx eax, ax
push eax
call fcn.00406e20
mov ecx, dword [ebp - 0x120]
call fcn.00406690
lea ecx, [ebp - 0x188]
call fcn.0040c830
lea eax, [ebp - 0x188]
mov byte [ebp - 4], 0xf
push eax
mov dword [ebp - method.std::ios_base.virtual_0], vtable.std::ios_base.0
call fcn.004209c4
add esp, 4
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x1f8]
push 1
call fcn.00401f70
mov dword [eax + 0x60], 0x64
add eax, 0x10
push str.Disabling_privilege:
push eax
mov byte [ebp - 4], 0x10
call fcn.00401240
add esp, 8
push str.SeImpersonatePrivilege
push eax
call fcn.0040ba90
mov edx, eax
add esp, 8
mov dword [ebp - 0x120], edx
mov eax, dword [edx]
push 0xa
mov ecx, dword [eax + 4]
add ecx, edx
call fcn.004075e0
mov ecx, dword [ebp - 0x120]
movzx eax, ax
push eax
call fcn.00406e20
mov ecx, dword [ebp - 0x120]
call fcn.00406690
lea ecx, [ebp - 0x188]
call fcn.0040c830
lea eax, [ebp - 0x188]
mov byte [ebp - 4], 0x11
push eax
mov dword [ebp - method.std::ios_base.virtual_0], vtable.std::ios_base.0
call fcn.004209c4
mov ecx, dword [ebp - 0x124]
add esp, 4
mov byte [ebp - 4], 5
push 0
push 0
push str.SeImpersonatePrivilege
call fcn.0041e700
test eax, eax
je 0x41d8ec
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetPrivilege_SE_IMPERSONATE_NAME
lea ecx, [ebp - 0xf0]
call fcn.00408120
push 0x453ea8
lea eax, [ebp - 0xf0]
push eax
call fcn.00423c96
push 1
lea ecx, [ebp - 0x1f8]
call fcn.00401f70
mov dword [eax + 0x60], 0x64
add eax, 0x10
push str.Disabling_privilege:
push eax
mov byte [ebp - 4], 0x12
call fcn.00401240
add esp, 8
push str.SeTcbPrivilege
push eax
call fcn.0040ba90
mov edx, eax
add esp, 8
mov dword [ebp - 0x120], edx
mov eax, dword [edx]
push 0xa
mov ecx, dword [eax + 4]
add ecx, edx
call fcn.004075e0
mov ecx, dword [ebp - 0x120]
movzx eax, ax
push eax
call fcn.00406e20
mov ecx, dword [ebp - 0x120]
call fcn.00406690
lea ecx, [ebp - 0x188]
call fcn.0040c830
lea eax, [ebp - 0x188]
mov byte [ebp - 4], 0x13
push eax
mov dword [ebp - method.std::ios_base.virtual_0], vtable.std::ios_base.0
call fcn.004209c4
mov ecx, dword [ebp - 0x124]
add esp, 4
mov byte [ebp - 4], 5
push 0
push 0
push str.SeTcbPrivilege
call fcn.0041e700
test eax, eax
je 0x41d9bf
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetPrivilege_SE_TCB_NAME
lea ecx, [ebp - 0x11c]
call fcn.00408120
push 0x453ea8
lea eax, [ebp - 0x11c]
push eax
call fcn.00423c96
push 1
lea ecx, [ebp - 0x1f8]
call fcn.00401f70
mov dword [eax + 0x60], 0x64
add eax, 0x10
push str.ReconfigureStartup___done
push eax
mov byte [ebp - 4], 0x14
call fcn.00401240
mov edx, eax
add esp, 8
mov dword [ebp - 0x124], edx
mov eax, dword [edx]
push 0xa
mov ecx, dword [eax + 4]
add ecx, edx
call fcn.004075e0
mov ecx, dword [ebp - 0x124]
movzx eax, ax
push eax
call fcn.00406e20
mov ecx, dword [ebp - 0x124]
call fcn.00406690
lea ecx, [ebp - 0x188]
call fcn.0040c830
lea eax, [ebp - 0x188]
mov byte [ebp - 4], 0x15
push eax
mov dword [ebp - method.std::ios_base.virtual_0], vtable.std::ios_base.0
call fcn.004209c4
add esp, 4
test ebx, ebx
je 0x41da9c
mov eax, dword [ebp - 0x12c]
sub eax, ebx
sar eax, 2
cmp eax, 0x3fffffff
jbe 0x41da5b
call fcn.00426ddc
shl eax, 2
cmp eax, 0x1000
jb 0x41da93
test bl, 0x1f
je 0x41da6f
call fcn.00426ddc
mov eax, dword [ebx - 4]
cmp eax, ebx
jb 0x41da7b
call fcn.00426ddc
sub ebx, eax
cmp ebx, 4
jae 0x41da87
call fcn.00426ddc
cmp ebx, 0x23
jbe 0x41da91
call fcn.00426ddc
mov ebx, eax
push ebx
call fcn.004214e6
add esp, 4
test esi, esi
je 0x41daa7
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test edi, edi
je 0x41dab2
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor eax, eax
jmp 0x41db4d
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0042199f
mov esp, ebp
pop ebp
ret