Function at 0x40a080
Capabilities:
Check for peb beingdebugged flag
Check if file exists
Check if process is running under wine
Delete file
Delete registry value
Get common file path
Get file attributes
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, 0x58
mov esi, dword [ecx + 8]
mov dword [esp + 0x10], 0x419000
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 0x40a258
mov dword [esp], str.XDG_CONFIG_HOME
mov ebx, dword [sym.imp.ucrtbase.dll__wgetenv]
call ebx
test eax, eax
je 0x40a510
mov dword [esp + 4], eax
mov dword [esp], str.__unix_s_menus_applications_merged
call fcn.004018f0
mov dword [0x41920c], eax
mov ecx, eax
movzx edx, word [ecx]
mov eax, ecx
test dx, dx
je 0x40a12a
lea esi, [esi]
nop
cmp dx, 0x2f
jne 0x40a11e
mov edx, 0x5c
mov word [eax], dx
movzx edx, word [eax + 2]
add eax, 2
test dx, dx
jne 0x40a110
mov edi, 0x5c
mov eax, ecx
mov word [ecx + 2], di
call section..text
mov dword [esp], str.XDG_DATA_HOME
call ebx
test eax, eax
je 0x40a535
mov dword [esp + 4], eax
mov dword [esp], str.__unix_s
call fcn.004018f0
mov dword [0x419208], eax
mov ecx, eax
movzx edx, word [ecx]
mov eax, ecx
test dx, dx
je 0x40a18a
lea esi, [esi]
cmp dx, 0x2f
jne 0x40a17e
mov ebx, 0x5c
mov word [eax], bx
movzx edx, word [eax + 2]
add eax, 2
test dx, dx
jne 0x40a170
mov edi, 0x5c
mov word [ecx + 2], di
mov dword [esp + 4], ecx
mov dword [esp], str._sdesktop_directories
call fcn.004018f0
mov ebx, eax
call section..text
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [ebp - 0x34], eax
call eax
sub esp, 0xc
mov dword [esp], 0
call dword [sym.imp.ole32.dll_CoInitialize]
sub esp, 4
test eax, eax
js 0x40a248
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x40], 0
nop
mov ebx, dword [sym.imp.ucrtbase.dll_wcscmp]
test esi, esi
je 0x40a240
cmp word [esi], 0
je 0x40a240
lea eax, [ebp - 0x24]
call fcn.004010b0
mov esi, eax
test eax, eax
je 0x40a240
mov dword [esp + 4], 0x40e0de
mov dword [esp], eax
call ebx
test eax, eax
jne 0x40a270
mov esi, dword [ebp - 0x24]
test esi, esi
jne 0x40a20a
lea esi, [esi]
lea esi, [esi]
call dword [sym.imp.ole32.dll_CoUninitialize]
jmp 0x40a25f
test byte [section..data], 2
jne 0x40a676
lea esi, [esi]
mov dword [ebp - 0x38], 1
mov eax, dword [ebp - 0x38]
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret 0x10
mov dword [esp + 4], 0x40e0e4
mov dword [esp], esi
call ebx
mov dword [ebp - 0x2c], eax
test eax, eax
je 0x40a2b0
mov dword [esp + 4], 0x40e128
mov dword [esp], esi
call ebx
test eax, eax
jne 0x40a4a8
mov dword [ebp - 0x40], 1
mov esi, dword [ebp - 0x24]
jmp 0x40a200
lea eax, [ebp - 0x1c]
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 0x40a501
mov eax, dword [ebp - 0x1c]
mov edi, dword fs:[0x18]
mov dword [ebp - 0x30], eax
test eax, eax
je 0x40a2a0
mov dword [ebp - 0x20], 0x1000
mov eax, 0x1000
mov dword [ebp - 0x1c], 0x1000
jmp 0x40a340
mov dword [esp + 8], esi
mov esi, dword [ebp - 0x34]
mov dword [esp + 4], 0
shl dword [ebp - 0x1c], 1
mov eax, dword [edi + 0x30]
shl dword [ebp - 0x20], 1
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call esi
sub esp, 0xc
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call esi
mov eax, dword [ebp - 0x20]
sub esp, 0xc
add eax, eax
call fcn.00401530
mov esi, eax
mov eax, dword [ebp - 0x1c]
add eax, eax
call fcn.00401530
mov dword [esp + 0x14], 0
mov ebx, eax
lea eax, [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp + 0x1c], eax
lea eax, [ebp - 0x20]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp + 0x18], ebx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x30]
mov dword [esp + 8], esi
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegEnumValueW]
sub esp, 0x20
cmp eax, 0xea
je 0x40a300
test eax, eax
je 0x40a410
cmp eax, 0x103
je 0x40a3b4
test byte [section..data], 2
jne 0x40a478
mov dword [esp + 8], esi
mov esi, dword [ebp - 0x34]
mov dword [esp + 4], 0
mov edi, dword fs:[0x18]
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call esi
sub esp, 0xc
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call esi
mov eax, dword [ebp - 0x30]
sub esp, 0xc
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegCloseKey]
sub esp, 4
jmp 0x40a2a0
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_GetFileAttributesW]
sub esp, 4
cmp eax, 0xffffffff
je 0x40a4d0
add dword [ebp - 0x2c], 1
mov dword [esp + 8], esi
mov esi, dword [ebp - 0x34]
mov edx, dword fs:[0x18]
mov dword [esp + 4], 0
mov eax, dword [edx + 0x30]
mov dword [ebp - 0x3c], edx
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call esi
mov edx, dword [ebp - 0x3c]
sub esp, 0xc
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov eax, dword [edx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call esi
sub esp, 0xc
jmp 0x40a2e8
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 fcn.004014e0
jmp 0x40a3b4
mov dword [esp + 4], 0x40e12e
mov dword [esp], esi
call ebx
test eax, eax
jne 0x40a55a
mov dword [ebp - 0x44], 1
jmp 0x40a2a0
test byte [section..data], 8
jne 0x40a610
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_DeleteFileW]
mov eax, dword [ebp - 0x30]
sub esp, 4
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegDeleteValueW]
sub esp, 8
jmp 0x40a429
mov edx, dword fs:[0x18]
mov dword [edx + 0x34], eax
jmp 0x40a2a0
mov dword [esp], str.WINEHOMEDIR
call ebx
mov dword [esp], str._s_.config_menus_applications_merged
mov dword [esp + 4], eax
call fcn.004018f0
mov dword [0x41920c], eax
mov ecx, eax
jmp 0x40a0fd
mov dword [esp], str.WINEHOMEDIR
call ebx
mov dword [esp], str._s_.local_share
mov dword [esp + 4], eax
call fcn.004018f0
mov dword [0x419208], eax
mov ecx, eax
jmp 0x40a162
mov dword [esp + 4], 0x40e134
mov dword [esp], esi
call ebx
test eax, eax
je 0x40a70e
cmp word [esi], 0x2d
je 0x40a6a3
mov ecx, dword [ebp - 0x44]
mov edx, dword [ebp - 0x40]
mov eax, esi
test ecx, ecx
je 0x40a756
call fcn.00409c10
test eax, eax
jne 0x40a2a0
mov dword [ebp - 0x38], 1
test byte [section..data], 2
je 0x40a2a0
mov eax, esi
shr eax, 0x10
je 0x40a76a
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 0x40a5db
mov eax, esi
call fcn.00401240
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 fcn.004014e0
mov dword [ebp - 0x38], 1
jmp 0x40a2a0
test esi, esi
je 0x40a760
mov eax, esi
shr eax, 0x10
je 0x40a73e
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 0x40a649
mov eax, esi
call fcn.00401240
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 fcn.004014e0
jmp 0x40a4dd
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 fcn.004014e0
jmp 0x40a258
test byte [section..data], 2
je 0x40a2a0
mov eax, esi
shr eax, 0x10
je 0x40a782
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 0x40a6e1
mov eax, esi
call fcn.00401240
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 fcn.004014e0
jmp 0x40a2a0
lea eax, [ebp - 0x24]
call fcn.004010b0
mov ebx, eax
test eax, eax
je 0x40a2a0
lea eax, [ebp - 0x24]
call fcn.004010b0
mov edx, eax
test eax, eax
je 0x40a2a0
mov eax, ebx
call fcn.004058d0
jmp 0x40a2a0
movzx eax, si
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.00401420
jmp 0x40a649
call fcn.00408640
jmp 0x40a58e
mov eax, str._null_
jmp 0x40a649
movzx esi, si
mov dword [esp], str._04x
mov dword [esp + 4], esi
call fcn.00401420
jmp 0x40a5db
movzx esi, si
mov dword [esp], str._04x
mov dword [esp + 4], esi
call fcn.00401420
jmp 0x40a6e1