Function at 0x4099e0
Capabilities:
Check if file exists
Check if process is running under wine
Delete file
Delete registry value
Get common file path
Get file attributes
Query or enumerate registry value
Terminate process

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x44
mov ebx, dword [ebp + 0x10]
mov dword [esp + 0x10], 0x40c120
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.shell32.dll_SHGetFolderPathW]
sub esp, 0x14
test eax, eax
js 0x409b8e
mov dword [esp], str.XDG_CONFIG_HOME
mov esi, dword [sym.imp.ucrtbase.dll__wgetenv]
call esi
test eax, eax
je 0x409db4
mov dword [esp + 4], eax
mov dword [esp], str.__unix_s_menus_applications_merged
call sym._heap_wprintf
mov dword [0x40c340], eax
mov ecx, eax
movzx edx, word [ecx]
mov eax, ecx
test dx, dx
je 0x409a7a
lea esi, [esi]
cmp dx, 0x2f
jne 0x409a6e
mov edx, 0x5c
mov word [eax], dx
movzx edx, word [eax + 2]
add eax, 2
test dx, dx
jne 0x409a60
mov edi, 0x5c
mov eax, ecx
mov word [ecx + 2], di
call sym._create_directories
mov dword [esp], str.XDG_DATA_HOME
call esi
test eax, eax
je 0x409e37
mov dword [esp + 4], eax
mov dword [esp], str.__unix_s
call sym._heap_wprintf
mov dword [0x40c100], eax
mov ecx, eax
movzx edx, word [ecx]
mov eax, ecx
test dx, dx
je 0x409ada
lea esi, [esi]
cmp dx, 0x2f
jne 0x409ace
mov esi, 0x5c
mov word [eax], si
movzx edx, word [eax + 2]
add eax, 2
test dx, dx
jne 0x409ac0
mov edi, 0x5c
mov word [ecx + 2], di
mov dword [esp + 4], ecx
mov dword [esp], str._sdesktop_directories
call sym._heap_wprintf
mov esi, eax
call sym._create_directories
mov eax, dword [sym.imp.ucrtbase.dll_free]
mov dword [esp], esi
mov dword [ebp - 0x24], eax
call eax
mov dword [esp], 0
call dword [sym.imp.ole32.dll_CoInitialize]
sub esp, 4
test eax, eax
js 0x409b81
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 0
lea esi, [esi]
nop
mov esi, dword [sym.imp.ucrtbase.dll_wcscmp]
test ebx, ebx
je 0x409b6e
cmp word [ebx], 0
je 0x409b6e
lea eax, [ebp - 0x18]
call sym._next_token
mov ebx, eax
test eax, eax
je 0x409b6e
mov dword [esp + 4], 0x40e0de
mov dword [esp], eax
call esi
test eax, eax
jne 0x409ba8
mov ebx, dword [ebp - 0x18]
test ebx, ebx
jne 0x409b42
call dword [sym.imp.ole32.dll_CoUninitialize]
mov eax, dword [ebp - 0x28]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 0x10
test byte [section..data], 2
jne 0x409f11
mov dword [ebp - 0x28], 1
mov eax, dword [ebp - 0x28]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 0x10
mov dword [esp + 4], 0x40e0e4
mov dword [esp], ebx
call esi
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x409be0
mov dword [esp + 4], 0x40e128
mov dword [esp], ebx
call esi
test eax, eax
jne 0x409d50
mov dword [ebp - 0x2c], 1
mov ebx, dword [ebp - 0x18]
jmp 0x409b38
lea eax, [ebp - 0x10]
mov dword [esp + 4], str.SoftwareWineMenuFiles
mov dword [esp + 8], eax
mov dword [esp], 0x80000001
call dword [sym.imp.advapi32.dll_RegCreateKeyW]
sub esp, 0xc
test eax, eax
jne 0x409da5
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x20], eax
test eax, eax
je 0x409bd8
mov dword [ebp - 0x14], 0x1000
mov edi, 0x1000
mov dword [ebp - 0x10], 0x1000
jmp 0x409c49
mov eax, dword [ebp - 0x14]
mov dword [esp], esi
shl dword [ebp - 0x10], 1
mov esi, dword [ebp - 0x24]
lea edi, [eax + eax]
mov dword [ebp - 0x14], edi
call esi
mov dword [esp], ebx
call esi
lea eax, [edi + edi]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_malloc]
mov esi, eax
test eax, eax
je 0x409ffb
mov eax, dword [ebp - 0x10]
add eax, eax
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_malloc]
mov ebx, eax
test eax, eax
je 0x409ffb
lea eax, [ebp - 0x10]
mov dword [esp + 0x18], ebx
mov dword [esp + 0x1c], eax
lea eax, [ebp - 0x14]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0x14], 0
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x20]
mov dword [esp + 0x10], 0
mov dword [esp + 8], esi
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegEnumValueW]
sub esp, 0x20
cmp eax, 0xea
je 0x409c30
test eax, eax
je 0x409cf8
cmp eax, 0x103
je 0x409cd2
test byte [section..data], 2
jne 0x409d20
mov dword [esp], esi
mov edi, dword [ebp - 0x24]
call edi
mov dword [esp], ebx
call edi
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegCloseKey]
sub esp, 4
jmp 0x409bd8
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_GetFileAttributesW]
sub esp, 4
cmp eax, 0xffffffff
je 0x409d78
inc dword [ebp - 0x1c]
mov dword [esp], esi
mov edi, dword [ebp - 0x24]
call edi
mov dword [esp], ebx
call edi
jmp 0x409c11
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.error__ld_reading_registry_n
mov dword [esp + 8], str.cleanup_menus
mov dword [esp + 4], 0x40c000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x409cd2
mov dword [esp + 4], 0x40e12e
mov dword [esp], ebx
call esi
test eax, eax
jne 0x409e5c
mov dword [ebp - 0x30], 1
jmp 0x409bd8
test byte [section..data], 8
jne 0x409dd9
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_DeleteFileW]
mov eax, dword [ebp - 0x20]
sub esp, 4
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegDeleteValueW]
sub esp, 8
jmp 0x409d0c
mov edx, dword fs:[0x18]
mov dword [edx + 0x34], eax
jmp 0x409bd8
mov dword [esp], str.WINEHOMEDIR
call esi
mov dword [esp], str._s_.config_menus_applications_merged
mov dword [esp + 4], eax
call sym._heap_wprintf
mov dword [0x40c340], eax
mov ecx, eax
jmp 0x409a52
mov eax, esi
shr eax, 0x10
je 0x409fd9
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x409e0a
mov eax, esi
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.removing_menu_related_file__s_n
mov dword [esp + 8], str.cleanup_menus
mov dword [esp + 4], 0x40c000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x409d81
mov dword [esp], str.WINEHOMEDIR
call esi
mov dword [esp], str._s_.local_share
mov dword [esp + 4], eax
call sym._heap_wprintf
mov dword [0x40c100], eax
mov ecx, eax
jmp 0x409ab2
mov dword [esp + 4], 0x40e134
mov dword [esp], ebx
call esi
test eax, eax
je 0x409fa9
cmp word [ebx], 0x2d
je 0x409f3e
mov ecx, dword [ebp - 0x30]
mov edx, dword [ebp - 0x2c]
mov eax, ebx
test ecx, ecx
je 0x409ff1
call sym._Process_URL
test eax, eax
jne 0x409bd8
mov dword [ebp - 0x28], 1
test byte [section..data], 2
je 0x409bd8
mov eax, ebx
shr eax, 0x10
je 0x40a037
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x409edd
mov eax, ebx
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.failed_to_build_menu_item_for__s_n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x40c000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
mov dword [ebp - 0x28], 1
jmp 0x409bd8
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.could_not_initialize_COM__error_0x_08lX_n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x40c000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x409b8e
test byte [section..data], 2
je 0x409bd8
mov eax, ebx
shr eax, 0x10
je 0x40a04f
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x409f7c
mov eax, ebx
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.unknown_option__s_n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x40c000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x409bd8
lea eax, [ebp - 0x18]
call sym._next_token
mov ebx, eax
test eax, eax
je 0x409bd8
lea eax, [ebp - 0x18]
call sym._next_token
mov edx, eax
test eax, eax
je 0x409bd8
mov eax, ebx
call sym._thumbnail_lnk
jmp 0x409bd8
movzx eax, si
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
jmp 0x409e0a
call sym._Process_Link
jmp 0x409e90
test byte [section..data], 2
jne 0x40a011
mov dword [esp], 1
call dword [sym.imp.kernel32.dll_ExitProcess]
mov dword [esp + 0xc], str.out_of_memory_n
mov dword [esp + 8], str.xmalloc
mov dword [esp + 4], 0x40c000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x40a004
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call sym._wine_dbg_sprintf.constprop.0
jmp 0x409edd
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call sym._wine_dbg_sprintf.constprop.0
jmp 0x409f7c