Function at 0x403790
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push esi
sub esp, 0x34
mov dword [esp + 4], dbg._ServiceCtrlHandler@4
mov dword [esp], str.MSIServer
call dword [sym.imp.advapi32.dll_RegisterServiceCtrlHandlerA]
sub esp, 8
mov dword [0x408050], eax
test eax, eax
je 0x403917
mov dword [ebp - 0x20], 0x10
mov dword [ebp - 0x1c], 2
xorps xmm0, xmm0
movups xmmword [ebp - 0x18], xmm0
mov dword [ebp - 8], 0
lea esi, [ebp - 0x20]
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_SetServiceStatus]
sub esp, 8
test eax, eax
jne 0x40382a
mov dword [esp], str.Failed_to_set_service_status_n
call dbg.report_error
test byte [0x408010], 8
je 0x403819
mov dword [esp + 0xc], str.Killing_service_n
mov dword [esp + 8], str.KillService
call dbg.wine_dbg_log
mov eax, dword [0x408054]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_SetEvent]
sub esp, 4
movaps xmm0, xmmword [0x4059b0]
movups xmmword [esp], xmm0
call dword [sym.imp.kernel32.dll_CreateEventW]
sub esp, 0x10
mov dword [0x408054], eax
test eax, eax
je 0x403928
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], dbg._ServiceExecutionThread@4
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_CreateThread]
sub esp, 0x18
mov dword [0x408058], eax
test eax, eax
je 0x403931
mov dword [ebp - 0x20], 0x10
mov dword [ebp - 0x1c], 4
mov dword [ebp - 0x18], 7
xorps xmm0, xmm0
movups xmmword [ebp - 0x14], xmm0
mov eax, dword [0x408050]
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_SetServiceStatus]
sub esp, 8
test eax, eax
jne 0x4038fc
mov dword [esp], str.Failed_to_set_service_status_n
call dbg.report_error
test byte [0x408010], 8
je 0x4038eb
mov dword [esp + 0xc], str.Killing_service_n
mov dword [esp + 8], str.KillService
call dbg.wine_dbg_log
mov eax, dword [0x408054]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_SetEvent]
sub esp, 4
mov eax, dword [0x408058]
mov dword [esp], eax
mov dword [esp + 4], 0xffffffff
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
sub esp, 8
jmp 0x40396c
mov dword [esp], str.Failed_to_register_service_ctrl_handler_n
call dbg.report_error
jmp 0x4039dc
mov dword [esp], str.Failed_to_create_event_n
jmp 0x403938
mov dword [esp], str.Failed_to_create_thread_n
call dbg.report_error
test byte [0x408010], 8
je 0x40395b
mov dword [esp + 0xc], str.Killing_service_n
mov dword [esp + 8], str.KillService
call dbg.wine_dbg_log
mov eax, dword [0x408054]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_SetEvent]
sub esp, 4
mov dword [ebp - 0x20], 0x10
mov dword [ebp - 0x1c], 1
xorps xmm0, xmm0
movups xmmword [ebp - 0x18], xmm0
mov dword [ebp - 8], 0
mov eax, dword [0x408050]
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_SetServiceStatus]
sub esp, 8
test eax, eax
jne 0x4039dc
mov dword [esp], str.Failed_to_set_service_status_n
call dbg.report_error
test byte [0x408010], 8
je 0x4039cb
mov dword [esp + 0xc], str.Killing_service_n
mov dword [esp + 8], str.KillService
call dbg.wine_dbg_log
mov eax, dword [0x408054]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_SetEvent]
sub esp, 4
add esp, 0x34
pop esi
pop ebp
ret 8