Function at 0x40b7b0
Capabilities:
Start service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4f4
mov eax, dword [0x4703d0]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov bl, byte [ebp + 0xc]
push esi
push edi
mov edi, dword [ebp + 8]
movzx eax, bl
push eax
xor esi, esi
push edi
push str.StartService:__S__enableservice_u__n
mov byte [ebp - 0x4b5], 0
mov dword [ebp - 0x4d4], esi
mov dword [ebp - 0x4d0], esi
mov dword [ebp - 0x4c4], esi
call fcn.0040ef30
push esi
call fcn.0042d5c0
push edi
mov dword [ebp - 0x4d8], eax
call fcn.0042c770
add esp, 0x14
push esi
push edi
mov byte [ebp - 0x4cc], al
call fcn.0041b220
push edi
call fcn.0042c6f0
add esp, 4
cmp eax, esi
mov dword [ebp - 0x4c0], eax
jne 0x40b84d
push str.StartService:_Could_not_open_service_registry_key_n
call fcn.0040ef30
add esp, 4
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043c015
mov esp, ebp
pop ebp
ret 8
call fcn.00402fe0
mov esi, eax
test esi, esi
je 0x40b87a
cmp esi, 0xffffffff
je 0x40b87a
push 0
lea ecx, [ebp - 0x4c8]
push ecx
push 0
push 0
push 0
push 0
push 0x9edb6510
push esi
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
mov eax, dword [ebp - 0x4c0]
lea edx, [ebp - 0x4c4]
push edx
push str.Start
push eax
call fcn.0042c3b0
add esp, 0xc
test al, al
je 0x40b92e
mov ecx, dword [ebp - 0x4c4]
push edi
push ecx
push str.StartService:_read_Start_u_from_service__S_registry_n
call fcn.0040ef30
add esp, 0xc
test bl, bl
je 0x40b92e
mov eax, dword [ebp - 0x4c0]
lea edx, [ebp - 0x4bc]
push edx
push str.upgradetmp.Start
mov ebx, 4
push eax
mov dword [ebp - 0x4bc], ebx
call fcn.0042c3b0
add esp, 0xc
test al, al
je 0x40b92e
mov ecx, dword [ebp - 0x4bc]
push edi
push ecx
push str.StartService:_read_upgradtmp.Start_u_from_service__S_registry_n
call fcn.0040ef30
add esp, 0xc
cmp dword [ebp - 0x4c4], ebx
jne 0x40b91a
mov eax, dword [ebp - 0x4bc]
cmp eax, ebx
je 0x40b91a
push eax
push edi
call fcn.00404ba0
mov edx, dword [ebp - 0x4bc]
mov dword [ebp - 0x4c4], edx
mov eax, dword [ebp - 0x4c0]
push str.upgradetmp.Start
push eax
call fcn.0042a9e0
add esp, 8
test esi, esi
je 0x40b93e
cmp esi, 0xffffffff
je 0x40b93e
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp byte [0x471576], 0
je 0x40b955
push edi
push str._donotstartservices_is_set._Service__S_will_not_be_started_n
call fcn.0040ef30
add esp, 8
mov edx, dword [ebp - 0x4c0]
lea ecx, [ebp - 0x4b6]
push ecx
push str.DeleteFlag
push edx
mov byte [ebp - 0x4b6], 0
call fcn.0042c400
add esp, 0xc
cmp byte [ebp - 0x4b6], 0
je 0x40b99a
push edi
push str.StartService:_DeleteFlag_is_set._Service__S_will_not_be_started_n
call fcn.0040ef30
add esp, 8
mov byte [ebp - 0x4b5], 1
jmp 0x40bc06
push 0xa0000000
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
test eax, eax
mov dword [ebp - 0x4d4], eax
jne 0x40b9cc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.StartService:_Unable_to_open_SCM___d__n
call fcn.0040ef30
add esp, 8
jmp 0x40bc06
push 0x1c
push edi
push eax
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov ebx, eax
test ebx, ebx
mov dword [ebp - 0x4d0], ebx
jne 0x40ba02
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x424
je 0x40b98e
push eax
push str.StartService:_Unable_to_open_service_via_SCM___d__n
call fcn.0040ef30
add esp, 8
jmp 0x40bc06
cmp byte [0x471576], 0
jne 0x40bb83
cmp dword [ebp - 0x4c4], 4
je 0x40ba4b
push 0
push 0
push ebx
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x40ba4b
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0x420
je 0x40ba4b
call esi
push eax
push str.Start_service_failed__x_n
call fcn.0040ef30
add esp, 8
jmp 0x40bb83
cmp byte [0x471576], 0
mov byte [ebp - 0x4b5], 1
jne 0x40bb83
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x4f4]
push eax
push ebx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x40bad2
mov ecx, dword [ebp - 0x4f0]
mov eax, ecx
sub eax, 1
je 0x40babd
sub eax, 3
je 0x40bab0
sub eax, 3
je 0x40baa3
push ecx
push edi
push str.waiting_on__S_service_to_report_RUNNING_or_STOPPED__current_state__x__n
call fcn.0040ef30
add esp, 0xc
push 0x64
call esi
jmp 0x40ba65
push edi
push str._S_service_reports_PAUSED_n
call fcn.0040ef30
jmp 0x40bacf
push edi
push str._S_service_reports_RUNNING_n
call fcn.0040ef30
jmp 0x40bacf
push edi
push str._S_service_reports_STOPPED_n
call fcn.0040ef30
mov byte [ebp - 0x4b5], 0
add esp, 8
cmp byte [0x471576], 0
jne 0x40bb83
cmp dword [ebp - 0x4c4], 4
je 0x40bb83
mov ebx, dword [ebp - 0x4c0]
push 0x12c
lea ecx, [ebp - 0x25c]
push ecx
push 0x12c
lea edx, [ebp - 0x4b4]
push edx
xor esi, esi
push esi
push ebx
call fcn.0042ab70
add esp, 0x18
test al, al
je 0x40bb83
lea ebx, [ebx]
lea eax, [ebp - 0x4b4]
push str.ServicePostStartCommand.
push eax
add esi, 1
call fcn.00429650
add esp, 8
test eax, eax
jne 0x40bb5d
lea ecx, [ebp - 0x25c]
push ecx
push str.Running_post_start_command__S_n
call fcn.0040ef30
add esp, 8
push 1
lea edx, [ebp - 0x25c]
push edx
call fcn.00404ae0
push 0x12c
lea eax, [ebp - 0x25c]
push eax
push 0x12c
lea ecx, [ebp - 0x4b4]
push ecx
push esi
push ebx
call fcn.0042ab70
add esp, 0x18
test al, al
jne 0x40bb20
push 0x200
mov dword [ebp - 0x4bc], 0
call fcn.0043c073
mov esi, eax
push str.Attempting_to_start_dependent_services_n
mov dword [ebp - 0x4c8], esi
call fcn.0040ef30
add esp, 8
test esi, esi
jne 0x40bbbc
push str.alloc_failed_n
call fcn.0040ef30
jmp 0x40bc03
lea edx, [ebp - 0x4bc]
push edx
push 0x200
lea eax, [ebp - 0x4c8]
push eax
push edi
call fcn.00409e70
test al, al
jne 0x40bc7e
push str.StartService:_failed_to_fully_enumerate_dependent_services_n
call fcn.0040ef30
add esp, 4
push str.No_dependent_services_found_n
call fcn.0040ef30
add esp, 4
mov edx, dword [ebp - 0x4c8]
push edx
call fcn.0043c1ba
add esp, 4
mov eax, dword [ebp - 0x4d8]
push eax
call fcn.0042d5c0
add esp, 4
cmp byte [ebp - 0x4cc], 0
je 0x40bc2b
mov ecx, dword [ebp - 0x4cc]
push ecx
push edi
call fcn.0041b220
mov edx, dword [ebp - 0x4c0]
push edx
call fcn.0042a5f0
mov eax, dword [ebp - 0x4d0]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
add esp, 4
test eax, eax
je 0x40bc4d
push eax
call esi
mov eax, dword [ebp - 0x4d4]
test eax, eax
je 0x40bc5a
push eax
call esi
cmp byte [0x471576], 0
mov al, 1
jne 0x40bc6b
mov al, byte [ebp - 0x4b5]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0043c015
mov esp, ebp
pop ebp
ret 8
mov eax, dword [ebp - 0x4bc]
test eax, eax
jbe 0x40bbea
mov esi, dword [ebp - 0x4c8]
push eax
push str.StartService:_found__d_dependent_services_n
xor ebx, ebx
call fcn.0040ef30
add esp, 8
push esi
push str.Attempting_to_start_dependent_service__S_n
call fcn.0040ef30
mov ecx, dword [ebp + 0xc]
add esp, 8
push ecx
push esi
call fcn.0040b7b0
test al, al
jne 0x40bccc
push esi
push str.Could_not_start_dependent_service__S_n
call fcn.0040ef30
add esp, 8
push esi
call fcn.00428150
add ebx, 1
add esp, 4
cmp ebx, dword [ebp - 0x4bc]
lea esi, [esi + eax*2 + 2]
jb 0x40bca2
jmp 0x40bbf7