Function at 0x417cb0
Capabilities:
Get process heap flags
Query or enumerate registry value

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ecx
sub esp, 0x108
call dbg.__main
mov dword [esp + 0xc], global_svcctl_started_event
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_CreateEventW]
sub esp, 0x10
mov dword [ebp - 0xbc], eax
mov dword [esp + 0x20], 0
mov dword [esp + 0x1c], 0x41d0d8
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 3
mov dword [esp + 0x10], 1
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], global_service_current_key_str
mov dword [esp], 0x80000002
call sym._RegCreateKeyExW_36
sub esp, 0x24
test eax, eax
je 0x417d59
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
lea eax, [ebp - 0xac]
mov dword [esp + 4], str.SystemCurrentControlSetControl
mov dword [esp + 8], eax
mov dword [esp], 0x80000002
call sym._RegOpenKeyW_12
sub esp, 0xc
test eax, eax
jne 0x417e72
xor eax, eax
lea edi, [ebp - 0xa4]
lea esi, [pending.next]
mov dword [ebp - 0xa4], pe_nt_image_headers32
lea ebx, [ebp - 0xa8]
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], ebx
mov dword [esp + 8], eax
mov dword [esp + 4], str.ServicesPipeTimeout
mov eax, dword [ebp - 0xac]
mov dword [esp], eax
call sym._RegQueryValueExW_24
sub esp, 0x18
test eax, eax
jne 0x417dda
cmp dword [ebp - 0xa8], 1
je 0x418005
mov dword [ebp - 0xa4], pe_nt_image_headers32
xor ecx, ecx
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], ebx
mov dword [esp + 8], ecx
mov dword [esp + 4], str.WaitToKillServiceTimeout
mov eax, dword [ebp - 0xac]
mov dword [esp], eax
call sym._RegQueryValueExW_24
sub esp, 0x18
test eax, eax
jne 0x417e20
cmp dword [ebp - 0xa8], 1
je 0x418034
mov dword [ebp - 0xa4], 4
lea eax, [ebp - 0xa0]
mov dword [esp + 0x10], eax
xor eax, eax
mov dword [esp + 0x14], edi
mov dword [esp + 0xc], ebx
mov dword [esp + 8], eax
mov dword [esp + 4], str.AutoStartDelay
mov eax, dword [ebp - 0xac]
mov dword [esp], eax
call sym._RegQueryValueExW_24
sub esp, 0x18
test eax, eax
je 0x417fb9
mov eax, dword [ebp - 0xac]
mov dword [esp], eax
call sym._RegCloseKey_4
push eax
xor eax, eax
mov dword [esp + 8], 0x30
mov edi, dword [sym.imp.kernel32.dll_HeapAlloc]
mov dword [esp + 4], eax
mov ebx, dword fs:[0x18]
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call edi
mov dword [0x41d020], eax
sub esp, 0xc
test eax, eax
je 0x417ff9
xor edx, edx
xor esi, esi
mov dword [eax + 4], edx
lea edx, [eax + 8]
mov dword [eax + 0xc], edx
mov dword [eax + 8], edx
lea edx, [eax + 0x10]
add eax, 0x18
mov dword [eax - 4], edx
mov dword [eax - 8], edx
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_InitializeCriticalSection]
push ecx
mov eax, dword [0x41d020]
mov edx, dword [eax + 0x18]
mov dword [edx + 0x18], str._private_tmp_game_porting_toolkit_20240316_16507_xzjwx8_wine_programs_services_services.c:_scmdatabase
mov dword [esp + 0x1c], eax
xor eax, eax
mov dword [esp + 0x18], eax
xor eax, eax
mov dword [esp + 0x20], esi
mov dword [esp + 0x14], 0x2000000
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], eax
mov dword [esp + 8], eax
mov dword [esp + 4], str.SystemCurrentControlSetServices
mov dword [esp], 0x80000002
call sym._RegCreateKeyExW_36
mov esi, eax
sub esp, 0x24
mov eax, dword [0x41d020]
test esi, esi
jne 0x417fd6
call dbg.scmdatabase_load_services
test eax, eax
jne 0x417d4d
call dbg.RPC_Init
mov dword [ebp - 0xc8], eax
test eax, eax
je 0x418096
mov ebx, dword [0x41d020]
xor edi, edi
mov eax, dword [ebx]
mov dword [esp], eax
call sym._RegCloseKey_4
xor ecx, ecx
push edx
mov eax, dword [ebx + 0x18]
mov dword [eax + 0x18], ecx
lea eax, [ebx + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_DeleteCriticalSection]
push esi
mov eax, dword fs:[0x18]
mov dword [esp + 8], ebx
mov dword [esp + 4], edi
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
mov eax, dword [0x41d0dc]
sub esp, 0xc
test eax, eax
je 0x417fa1
mov dword [esp], eax
call sym._DestroyEnvironmentBlock_4
push eax
test byte [global___dbch.0], 8
jne 0x418063
mov eax, dword [ebp - 0xc8]
jmp 0x417d4d
cmp dword [ebp - 0xa8], 4
jne 0x417e63
mov eax, dword [ebp - 0xa0]
mov dword [0x419064], eax
jmp 0x417e63
mov dword [esp + 8], eax
xor eax, eax
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
mov eax, esi
sub esp, 0xc
jmp 0x417d4d
mov esi, 0x46a
mov eax, esi
jmp 0x417d4d
xor eax, eax
mov dword [esp + 8], 0xa
mov dword [esp + 4], eax
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll_wcstol]
mov dword [ebp - 0xa0], eax
test eax, eax
je 0x417dda
mov dword [0x41906c], eax
jmp 0x417dda
xor edx, edx
mov dword [esp + 8], 0xa
mov dword [esp + 4], edx
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll_wcstol]
mov dword [ebp - 0xa0], eax
test eax, eax
je 0x417e20
mov dword [0x419068], eax
jmp 0x417e20
mov eax, dword [ebp - 0xc8]
mov dword [esp + 0xc], str.services.exe_exited_with_code__ld_n
mov dword [esp + 8], global___FUNCTION__.22
mov dword [esp + 0x10], eax
mov dword [esp + 4], global___dbch.0
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
jmp 0x417fae
mov eax, dword [0x41d020]
mov dword [ebp - 0xe0], eax
xor eax, eax
mov dword [esp + 8], pe_nt_image_headers32
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call edi
mov dword [ebp - 0xc0], eax
sub esp, 0xc
test eax, eax
je 0x418607
xor ecx, ecx
xor esi, esi
mov dword [esp + 0xc], 4
mov dword [esp + 8], ecx
mov dword [esp + 4], str.ROOT
mov dword [esp], esi
call sym._SetupDiGetClassDevsW_16
mov dword [ebp - 0xd8], eax
sub esp, 0x10
add eax, 1
je 0x418628
mov ebx, dword [ebp - 0xe0]
xor esi, esi
lea eax, [ebx + 0x18]
mov dword [ebp - 0xe4], eax
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_EnterCriticalSection]
mov dword [ebp - 0xd4], eax
call eax
mov eax, ebx
mov ecx, 0x20
add eax, 0x10
push edx
mov ebx, dword [ebx + 0x10]
mov dword [ebp - 0xc4], eax
mov eax, dword fs:[0x18]
mov dword [ebp - 0xdc], eax
mov dword [ebp - 0xe8], edi
mov edi, ecx
mov eax, dword [ebp - 0xc4]
cmp ebx, eax
je 0x4181e6
cmp dword [ebx + 0x38], 2
jbe 0x418170
mov eax, dword [ebp - 0xd8]
cmp eax, 0xffffffff
je 0x4181e2
mov edx, ebx
call dbg.is_root_pnp_service
test eax, eax
je 0x4181e2
lea edx, [esi + 1]
cmp edx, edi
jb 0x4181cb
lea eax, [edi + edi]
shl edi, 3
mov dword [ebp - 0xcc], edx
mov dword [ebp - 0xd0], eax
mov dword [esp + 0xc], edi
mov eax, dword [ebp - 0xc0]
mov dword [esp + 8], eax
xor eax, eax
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xdc]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapReAlloc]
mov edx, dword [ebp - 0xcc]
sub esp, 0x10
test eax, eax
je 0x4181e6
mov dword [ebp - 0xc0], eax
mov edi, dword [ebp - 0xd0]
lock add dword [ebx + 0xc], 1
mov eax, dword [ebp - 0xc0]
mov dword [eax + esi*4], ebx
mov ebx, dword [ebx]
mov esi, edx
jmp 0x418146
mov edx, esi
jmp 0x4181d9
mov eax, dword [ebp - 0xe4]
mov edi, dword [ebp - 0xe8]
xor ebx, ebx
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_LeaveCriticalSection]
mov dword [ebp - 0xd0], eax
call eax
push eax
mov dword [esp + 0xc], dbg.compare_tags
mov dword [esp + 8], 4
mov dword [esp + 4], esi
mov eax, dword [ebp - 0xc0]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_qsort]
mov dword [esp + 4], 0xffffffff
mov ecx, dword [ebp - 0xe0]
mov dword [esp], ecx
call sym._scmdatabase_lock_startup
xor eax, eax
mov dword [ebp - 0xdc], edi
mov edi, dword [ebp - 0xc0]
mov dword [ebp - 0xc4], eax
mov dword [ebp - 0xcc], esi
jmp 0x418278
test byte [global___dbch.0], 8
jne 0x4182b6
mov eax, dword [ebp - 0xc4]
mov dword [edi + eax*4], esi
add eax, 1
mov dword [ebp - 0xc4], eax
add ebx, 1
cmp dword [ebp - 0xcc], ebx
je 0x4182eb
mov esi, dword [edi + ebx*4]
cmp dword [esi + 0x7c], 0
jne 0x41825a
xor eax, eax
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 4], eax
call dbg.service_start
test eax, eax
je 0x4182ac
test byte [global___dbch.0], 1
jne 0x4185c4
mov dword [esp], esi
call dbg.release_service
jmp 0x418275
mov eax, dword [esi + 0x10]
call sym._wine_dbgstr_wn.constprop.0_1
mov dword [esp + 0xc], str.delayed_starting__s_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.scmdatabase_autostart_services
mov dword [esp + 4], global___dbch.0
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
jmp 0x418263
mov edi, dword [ebp - 0xdc]
mov ecx, dword [ebp - 0xe0]
xor ebx, ebx
mov eax, 1
lock cmpxchg dword [ecx + 4], ebx
cmp dword [ebp - 0xc4], 0
je 0x4185ae
call dword [sym.imp.kernel32.dll_CreateThreadpoolCleanupGroup]
mov dword [0x41d0d4], eax
test eax, eax
je 0x418574
xor esi, esi
mov eax, dword fs:[0x18]
mov dword [ebp - 0xdc], eax
mov dword [esp + 8], 8
mov dword [esp + 4], esi
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call edi
mov dword [ebp - 0xcc], eax
sub esp, 0xc
test eax, eax
je 0x4185ae
mov eax, dword [ebp - 0xcc]
mov ecx, dword [ebp - 0xc4]
lea edx, [pending.prev]
lea esi, [pending.next]
mov edi, edx
mov dword [eax], ecx
mov ecx, dword [ebp - 0xc0]
mov dword [eax + 4], ecx
mov eax, ebx
mov ecx, 7
rep stosd dword es:[edi], eax
mov eax, dword [0x41d0d4]
mov dword [pending.next], 1
mov dword [ebp - 0x8c], dbg.delayed_autostart_cancel_callback
mov dword [ebp - 0x90], eax
mov eax, 0xffffd8f0
mul dword [0x419064]
sub edx, dword [0x419064]
mov dword [ebp - 0x9c], edx
mov ecx, eax
mov dword [ebp - 0xa0], ecx
mov dword [esp + 8], esi
mov eax, dword [ebp - 0xcc]
mov dword [esp], dbg.delayed_autostart_callback
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_CreateThreadpoolTimer]
sub esp, 0xc
test eax, eax
je 0x41867c
xor ebx, ebx
lea edx, [ebp - 0xa0]
mov dword [esp], eax
mov dword [esp + 0xc], ebx
mov dword [esp + 8], ebx
mov dword [esp + 4], edx
call dword [sym.imp.kernel32.dll_SetThreadpoolTimer]
sub esp, 0x10
mov eax, dword [ebp - 0xd8]
mov dword [esp], eax
call sym._SetupDiDestroyDeviceInfoList_4
push ecx
mov eax, dword [ebp - 0xbc]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_SetEvent]
push eax
mov dword [esp + 4], 0xffffffff
mov eax, dword [section..bss]
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_WaitForSingleObject]
mov dword [ebp - 0xc0], eax
call eax
push eax
push eax
mov edi, dword [0x41d020]
mov dword [pending.next], esi
lea ebx, [edi + 0x18]
mov dword [pending.prev], esi
mov dword [ebp - 0xcc], ebx
mov dword [esp], ebx
mov eax, dword [ebp - 0xd4]
call eax
lea eax, [edi + 8]
push edx
mov edx, dword [edi + 8]
cmp eax, edx
je 0x418665
mov ecx, dword [pending.prev]
mov dword [ebp - 0xc4], eax
mov dword [ebp - 0xbc], esi
mov dword [ecx], edx
mov ecx, dword [pending.prev]
mov dword [edx + 4], ecx
mov edx, dword [edi + 0xc]
mov dword [pending.prev], edx
mov dword [edx], esi
mov dword [edi + 0xc], eax
mov dword [edi + 8], eax
jmp 0x418516
test esi, esi
je 0x418526
lock add dword [esi + 0xc], 1
mov dword [esp], esi
call dbg.process_terminate
mov dword [esp], ebx
mov eax, dword [ebp - 0xd0]
call eax
push eax
mov dword [esp + 4], 0xffffffff
mov eax, dword [esi + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0xc0]
call eax
push eax
push eax
mov dword [esp], ebx
mov eax, dword [ebp - 0xd4]
call eax
push eax
mov ecx, dword [esi]
mov eax, dword [esi + 4]
mov dword [ecx + 4], eax
mov ecx, dword [esi]
mov dword [eax], ecx
mov eax, dword [ebp - 0xc4]
mov dword [esi], eax
mov eax, dword [edi + 0xc]
mov dword [esi + 4], eax
mov dword [eax], esi
mov dword [edi + 0xc], esi
mov dword [esp], esi
call dbg.release_process
mov esi, dword [pending.next]
mov eax, dword [ebp - 0xbc]
cmp esi, eax
jne 0x4184ae
mov eax, dword [ebp - 0xcc]
mov dword [esp], eax
mov eax, dword [ebp - 0xd0]
call eax
push ebx
mov eax, dword [0x41d0d4]
test eax, eax
je 0x41856a
xor edx, edx
mov dword [esp], eax
mov dword [esp + 8], edx
mov dword [esp + 4], 1
call dword [sym.imp.kernel32.dll_CloseThreadpoolCleanupGroupMembers]
mov eax, dword [0x41d0d4]
sub esp, 0xc
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseThreadpoolCleanupGroup]
push ecx
call dbg.RPC_Stop
jmp 0x417f47
test byte [global___dbch.0], 2
je 0x4185ae
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp + 0xc], str.CreateThreadpoolCleanupGroup_failed_with_error__lu_n
mov dword [esp + 8], str.schedule_delayed_autostart
mov dword [esp + 0x10], eax
mov dword [esp + 4], global___dbch.0
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0_1
lea esi, [pending.next]
mov eax, dword [ebp - 0xc0]
call sym._heap_free
jmp 0x41840b
mov dword [ebp - 0xe4], eax
mov eax, dword [esi + 0x10]
call sym._wine_dbgstr_wn.constprop.0_1
mov ecx, dword [ebp - 0xe4]
mov dword [esp + 0xc], str.Auto_start_service__s_failed_to_start:__ld_n
mov dword [esp + 0x10], eax
xor eax, eax
mov dword [esp + 0x14], ecx
mov dword [esp + 8], str.scmdatabase_autostart_services
mov dword [esp + 4], global___dbch.0
mov dword [esp], eax
call sym._wine_dbg_log.constprop.0_1
jmp 0x4182ac
mov eax, dword [sym.imp.kernel32.dll_EnterCriticalSection]
lea esi, [pending.next]
mov dword [ebp - 0xd4], eax
mov eax, dword [sym.imp.kernel32.dll_LeaveCriticalSection]
mov dword [ebp - 0xd0], eax
jmp 0x41841a
test byte [global___dbch.0], 2
je 0x4180fd
mov eax, dword [ebx + 0x34]
mov dword [esp + 0xc], str.Failed_to_enumerate_devices__error__lx._n
mov dword [esp + 8], str.scmdatabase_autostart_services
mov dword [esp + 0x10], eax
mov dword [esp + 4], global___dbch.0
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0_1
jmp 0x4180fd
mov dword [ebp - 0xc4], eax
mov ebx, dword [ebp - 0xcc]
mov dword [ebp - 0xbc], esi
jmp 0x418516
test byte [global___dbch.0], 2
jne 0x418695
mov eax, dword [ebp - 0xcc]
call sym._heap_free
jmp 0x4185b4
mov eax, dword [ebp - 0xdc]
mov eax, dword [eax + 0x34]
mov dword [esp + 0xc], str.CreateThreadpoolWait_failed:__lu_n
mov dword [esp + 8], str.schedule_delayed_autostart
mov dword [esp + 0x10], eax
mov dword [esp + 4], global___dbch.0
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0_1
jmp 0x418685