Function at 0x40a7b0
Capabilities:
Check if process is running under wine
Get process heap flags
Set registry value

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
mov ebx, ecx
sub esp, 0x7c
mov dword [ebp - 0x2c], eax
test byte [section..data], 8
jne 0x40aa30
mov dword [esp], ebx
call dword [sym.imp.shlwapi.dll_PathFindFileNameW]
sub esp, 4
mov edi, eax
mov dword [esp + 4], str.c:proton_shortcuts
mov dword [esp], 0x40d430
call sym._heap_wprintf
mov ebx, eax
call sym._create_directories
mov dword [esp + 4], ebx
mov dword [esp + 8], edi
mov dword [esp], str._s_s.desktop
call sym._heap_wprintf
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov esi, eax
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
sub esp, 0xc
mov dword [esp + 4], 0x40d452
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wfopen]
mov ebx, eax
xor eax, eax
test ebx, ebx
je 0x40aa1f
mov dword [esp + 4], str._Desktop_Entry__n
mov dword [esp], ebx
call sym._fprintf
mov eax, edi
call sym._wchars_to_utf8_chars
mov dword [esp + 4], str.Name_s_n
mov dword [esp + 8], eax
mov dword [esp], ebx
call sym._fprintf
mov dword [esp + 4], str.Exec
mov dword [esp], ebx
call sym._fprintf
mov eax, dword [ebp + 8]
call sym._escape
mov dword [esp + 4], 0x40d478
mov dword [esp + 8], eax
mov dword [esp], ebx
call sym._fprintf
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x40a8c5
mov eax, dword [ebp + 0xc]
call sym._escape
mov dword [esp + 4], 0x40d47b
mov dword [esp + 8], eax
mov dword [esp], ebx
call sym._fprintf
mov dword [esp + 4], ebx
mov dword [esp], 0xa
call dword [sym.imp.ucrtbase.dll_fputc]
mov dword [esp + 4], str.TypeApplication_n
mov dword [esp], ebx
call sym._fprintf
mov dword [esp + 4], str.StartupNotifytrue_n
mov dword [esp], ebx
call sym._fprintf
mov edi, dword [ebp + 0x10]
test edi, edi
je 0x40a90a
mov eax, dword [ebp + 0x10]
cmp word [eax], 0
jne 0x40acd8
mov ecx, dword [ebp + 0x14]
test ecx, ecx
je 0x40a91e
mov eax, dword [ebp + 0x14]
cmp word [eax], 0
jne 0x40ad08
mov edx, dword [ebp + 0x18]
test edx, edx
je 0x40a932
mov eax, dword [ebp + 0x18]
cmp word [eax], 0
jne 0x40ad40
mov eax, dword [ebp + 0x1c]
test eax, eax
je 0x40a946
mov eax, dword [ebp + 0x1c]
cmp word [eax], 0
jne 0x40ad70
mov dword [esp], ebx
lea ebx, [ebp - 0x28]
call dword [sym.imp.ucrtbase.dll_fclose]
mov dword [esp], esi
mov dword [ebp - 0x28], str.chmod
mov dword [ebp - 0x24], 0x40d4dc
call sym._wine_get_unix_file_name
mov dword [esp + 4], 0
mov dword [esp], ebx
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], 0
call sym.___wine_unix_spawnvp_8
mov edi, dword [ebp - 0x2c]
mov eax, 1
sub esp, 8
test edi, edi
je 0x40aa1f
mov dword [esp + 8], ebx
mov dword [esp + 4], str.SoftwareWineMenuFiles
mov dword [esp], 0x80000001
call dword [sym.imp.advapi32.dll_RegCreateKeyW]
sub esp, 0xc
test eax, eax
jne 0x40adb0
mov ebx, dword [ebp - 0x28]
test ebx, ebx
je 0x40adba
cmp word [edi], 0
mov eax, edi
je 0x40af4a
add eax, 2
cmp word [eax], 0
jne 0x40a9d0
sub eax, dword [ebp - 0x2c]
add eax, 2
mov dword [esp + 0x14], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], esi
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 1
mov dword [esp + 8], 0
mov dword [esp], ebx
call dword [sym.imp.advapi32.dll_RegSetValueExW]
sub esp, 0x18
mov esi, eax
mov dword [esp], ebx
call dword [sym.imp.advapi32.dll_RegCloseKey]
sub esp, 4
xor eax, eax
test esi, esi
sete al
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov esi, edx
mov edx, dword [ebp + 0x1c]
test edx, edx
je 0x40af30
mov eax, dword [ebp + 0x1c]
shr eax, 0x10
je 0x40ad90
mov eax, dword [ebp + 0x1c]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov dword [ebp - 0x44], str._invalid_
sub esp, 8
test eax, eax
jne 0x40aa76
mov eax, dword [ebp + 0x1c]
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [ebp - 0x44], eax
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x40aee0
mov eax, dword [ebp + 0x18]
shr eax, 0x10
je 0x40aeb0
mov eax, dword [ebp + 0x18]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov dword [ebp - 0x40], str._invalid_
sub esp, 8
test eax, eax
jne 0x40aaba
mov eax, dword [ebp + 0x18]
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [ebp - 0x40], eax
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x40aed0
mov eax, dword [ebp + 0x14]
shr eax, 0x10
je 0x40ae90
mov eax, dword [ebp + 0x14]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov dword [ebp - 0x3c], str._invalid_
sub esp, 8
test eax, eax
jne 0x40aafe
mov eax, dword [ebp + 0x14]
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x40af00
mov eax, dword [ebp + 0x10]
shr eax, 0x10
je 0x40ae70
mov eax, dword [ebp + 0x10]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov dword [ebp - 0x38], str._invalid_
sub esp, 8
test eax, eax
jne 0x40ab42
mov eax, dword [ebp + 0x10]
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [ebp - 0x38], eax
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x40aef0
mov eax, dword [ebp + 0xc]
shr eax, 0x10
je 0x40ae50
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov dword [ebp - 0x34], str._invalid_
sub esp, 8
test eax, eax
jne 0x40ab86
mov eax, dword [ebp + 0xc]
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [ebp - 0x34], eax
mov eax, dword [ebp + 8]
shr eax, 0x10
je 0x40ae30
mov eax, dword [ebp + 8]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov dword [ebp - 0x48], str._invalid_
sub esp, 8
test eax, eax
jne 0x40abbf
mov eax, dword [ebp + 8]
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [ebp - 0x48], eax
test ebx, ebx
je 0x40af20
mov eax, ebx
shr eax, 0x10
je 0x40ae10
mov dword [esp + 4], 0xffffffff
mov edi, str._invalid_
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
sub esp, 8
test eax, eax
jne 0x40abf8
mov eax, ebx
call sym._wine_dbgstr_wn.part.0.constprop.0
mov edi, eax
test esi, esi
je 0x40af10
mov eax, esi
shr eax, 0x10
je 0x40adf0
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov dword [ebp - 0x30], str._invalid_
sub esp, 8
test eax, eax
jne 0x40ac34
mov eax, esi
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x40af40
shr eax, 0x10
je 0x40add0
mov esi, dword [ebp - 0x2c]
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 0x40ac71
mov eax, esi
call sym._wine_dbgstr_wn.part.0.constprop.0
mov ecx, dword [ebp - 0x44]
mov edx, dword [ebp - 0x3c]
mov dword [esp + 0x18], edi
mov dword [esp + 0x10], eax
mov dword [esp + 0x30], ecx
mov ecx, dword [ebp - 0x40]
mov dword [esp + 0x28], edx
mov edx, dword [ebp - 0x34]
mov dword [esp + 0x2c], ecx
mov ecx, dword [ebp - 0x38]
mov dword [esp + 0x20], edx
mov edx, dword [ebp - 0x30]
mov dword [esp + 0x24], ecx
mov ecx, dword [ebp - 0x48]
mov dword [esp + 0x14], edx
mov dword [esp + 0x1c], ecx
mov dword [esp + 0xc], str.__s__s__s__s__s__s__s__s__s__n
mov dword [esp + 8], str.write_desktop_entry
mov dword [esp + 4], 0x40c000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x40a7cb
call sym._wchars_to_utf8_chars
mov dword [esp + 4], str.Comment_s_n
mov dword [esp + 8], eax
mov dword [esp], ebx
call sym._fprintf
mov ecx, dword [ebp + 0x14]
test ecx, ecx
jne 0x40a911
jmp 0x40a91e
mov dword [esp], eax
call sym._wine_get_unix_file_name
test eax, eax
je 0x40a91e
mov dword [esp + 8], eax
mov dword [esp + 4], str.Path_s_n
mov dword [esp], ebx
call sym._fprintf
mov edx, dword [ebp + 0x18]
test edx, edx
jne 0x40a925
jmp 0x40a932
call sym._wchars_to_utf8_chars
mov dword [esp + 4], str.Icon_s_n
mov dword [esp + 8], eax
mov dword [esp], ebx
call sym._fprintf
mov eax, dword [ebp + 0x1c]
test eax, eax
jne 0x40a939
jmp 0x40a946
call sym._wchars_to_utf8_chars
mov dword [esp + 4], str.StartupWMClass_s_n
mov dword [esp + 8], eax
mov dword [esp], ebx
call sym._fprintf
jmp 0x40a946
movzx eax, word [ebp + 0x1c]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
mov dword [ebp - 0x44], eax
jmp 0x40aa76
mov edx, dword fs:[0x18]
mov dword [edx + 0x34], eax
mov eax, dword fs:[0x18]
mov esi, dword [eax + 0x34]
jmp 0x40aa18
movzx eax, word [ebp - 0x2c]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
jmp 0x40ac71
movzx edx, si
mov dword [esp], str._04x
mov dword [esp + 4], edx
call sym._wine_dbg_sprintf.constprop.0
mov dword [ebp - 0x30], eax
jmp 0x40ac34
movzx eax, bx
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
mov edi, eax
jmp 0x40abf8
movzx eax, word [ebp + 8]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
mov dword [ebp - 0x48], eax
jmp 0x40abbf
movzx eax, word [ebp + 0xc]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
mov dword [ebp - 0x34], eax
jmp 0x40ab86
movzx eax, word [ebp + 0x10]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
mov dword [ebp - 0x38], eax
jmp 0x40ab42
movzx eax, word [ebp + 0x14]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
mov dword [ebp - 0x3c], eax
jmp 0x40aafe
movzx eax, word [ebp + 0x18]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
mov dword [ebp - 0x40], eax
jmp 0x40aaba
mov dword [ebp - 0x3c], str._null_
jmp 0x40aafe
mov dword [ebp - 0x40], str._null_
jmp 0x40aaba
mov dword [ebp - 0x34], str._null_
jmp 0x40ab86
mov dword [ebp - 0x38], str._null_
jmp 0x40ab42
mov dword [ebp - 0x30], str._null_
jmp 0x40ac34
mov edi, str._null_
jmp 0x40abf8
mov dword [ebp - 0x44], str._null_
jmp 0x40aa76
mov eax, str._null_
jmp 0x40ac71
mov eax, 2
jmp 0x40a9df