Function at 0x406580
Capabilities:
Get process heap flags

Disassembly:
push edi
lea edi, [esp + 8]
and esp, 0xfffffff8
push dword [edi - 4]
push ebp
mov ebp, esp
push edi
push esi
mov esi, edx
push ebx
mov ebx, edi
mov edi, ecx
sub esp, 0x88
mov dword [ebp - 0x34], eax
mov eax, dword [ebx]
mov dword [ebp - 0x3c], eax
mov eax, dword [ebx + 4]
mov dword [ebp - 0x38], eax
mov eax, dword [ebx + 8]
mov dword [ebp - 0x24], eax
mov eax, dword [ebx + 0xc]
mov dword [ebp - 0x28], eax
mov eax, dword [ebx + 0x10]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebx + 0x14]
mov dword [ebp - 0x30], eax
mov dword [esp], str.WINECONFIGDIR
call dword [sym.imp.ucrtbase.dll__wgetenv]
mov dword [ebp - 0x44], eax
test byte [0x40d014], 8
jne 0x4067e8
mov dword [esp], edi
xor edi, edi
call dword [sym.imp.shlwapi.dll_PathFindFileNameW]
sub esp, 4
mov dword [ebp - 0x40], eax
test esi, esi
je 0x406b80
mov dword [esp + 4], 0x40fc02
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll__wfopen]
mov ebx, eax
xor eax, eax
test ebx, ebx
je 0x40677d
mov dword [esp + 4], str._Desktop_Entry__n
mov dword [esp], ebx
call fcn.004028a0
mov eax, dword [ebp - 0x40]
mov dword [esp], eax
call fcn.004062f0
mov dword [esp + 4], str.Name_s_n
mov dword [esp + 8], eax
mov dword [esp], ebx
call fcn.004028a0
mov dword [esp + 4], str.Exec
mov dword [esp], ebx
call fcn.004028a0
mov eax, dword [ebp - 0x44]
test eax, eax
je 0x4066a2
mov dword [esp], eax
call sub.kernel32.dll_wine_get_unix_file_name
mov dword [esp + 8], eax
mov dword [ebp - 0x40], eax
mov dword [esp + 4], str.env_WINEPREFIX__s_
mov dword [esp], ebx
call fcn.004028a0
mov edx, dword [ebp - 0x40]
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov dword [esp + 8], edx
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 eax, dword [ebp - 0x3c]
call fcn.004063e0
mov dword [esp + 4], str.wine__s
mov dword [esp + 8], eax
mov dword [esp], ebx
call fcn.004028a0
mov eax, dword [ebp - 0x38]
test eax, eax
je 0x4066de
call fcn.004063e0
mov dword [esp + 4], 0x40fc45
mov dword [esp + 8], eax
mov dword [esp], ebx
call fcn.004028a0
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 fcn.004028a0
mov dword [esp + 4], str.StartupNotifytrue_n
mov dword [esp], ebx
call fcn.004028a0
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x406720
cmp word [eax], 0
jne 0x406a90
mov eax, dword [ebp - 0x28]
test eax, eax
je 0x406731
cmp word [eax], 0
jne 0x406ac0
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x406742
cmp word [eax], 0
jne 0x406af8
mov eax, dword [ebp - 0x30]
test eax, eax
je 0x406753
cmp word [eax], 0
jne 0x406b28
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_fclose]
test edi, edi
jne 0x406790
mov ecx, dword [ebp - 0x34]
mov eax, 1
test ecx, ecx
je 0x40677d
mov edx, ecx
mov eax, esi
call fcn.00402f80
test eax, eax
sete al
movzx eax, al
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
lea esp, [edi - 8]
pop edi
ret
mov eax, 0x40fca6
mov edi, str.chmod
movd xmm1, eax
movd xmm0, edi
punpckldq xmm0, xmm1
movq qword [ebp - 0x20], xmm0
mov dword [esp], esi
call sub.kernel32.dll_wine_get_unix_file_name
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x20]
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.ntdll.dll___wine_unix_spawnvp]
mov ecx, dword [ebp - 0x34]
mov eax, 1
sub esp, 8
test ecx, ecx
jne 0x40676c
jmp 0x40677d
mov eax, dword [ebp - 0x30]
test eax, eax
je 0x406cf0
shr eax, 0x10
test eax, eax
je 0x406b60
mov dword [esp + 4], 0xffffffff
mov ebx, dword [ebp - 0x30]
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov dword [ebp - 0x58], str._invalid_
sub esp, 8
test eax, eax
jne 0x40682a
mov eax, ebx
call fcn.00402980
mov dword [ebp - 0x58], eax
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x406ce0
shr eax, 0x10
test eax, eax
je 0x406c80
mov dword [esp + 4], 0xffffffff
mov ebx, dword [ebp - 0x2c]
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov dword [ebp - 0x54], str._invalid_
sub esp, 8
test eax, eax
jne 0x40686c
mov eax, ebx
call fcn.00402980
mov dword [ebp - 0x54], eax
mov eax, dword [ebp - 0x28]
test eax, eax
je 0x406cb0
shr eax, 0x10
test eax, eax
je 0x406c60
mov dword [esp + 4], 0xffffffff
mov ebx, dword [ebp - 0x28]
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov dword [ebp - 0x50], str._invalid_
sub esp, 8
test eax, eax
jne 0x4068ae
mov eax, ebx
call fcn.00402980
mov dword [ebp - 0x50], eax
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x406ca0
shr eax, 0x10
test eax, eax
je 0x406c40
mov dword [esp + 4], 0xffffffff
mov ebx, dword [ebp - 0x24]
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov dword [ebp - 0x4c], str._invalid_
sub esp, 8
test eax, eax
jne 0x4068f0
mov eax, ebx
call fcn.00402980
mov dword [ebp - 0x4c], eax
mov eax, dword [ebp - 0x38]
test eax, eax
je 0x406cd0
shr eax, 0x10
test eax, eax
je 0x406c20
mov dword [esp + 4], 0xffffffff
mov ebx, dword [ebp - 0x38]
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov dword [ebp - 0x40], str._invalid_
sub esp, 8
test eax, eax
jne 0x406932
mov eax, ebx
call fcn.00402980
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x3c]
shr eax, 0x10
test eax, eax
je 0x406c00
mov dword [esp + 4], 0xffffffff
mov ebx, dword [ebp - 0x3c]
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov dword [ebp - 0x5c], str._invalid_
sub esp, 8
test eax, eax
jne 0x40696c
mov eax, ebx
call fcn.00402980
mov dword [ebp - 0x5c], eax
test edi, edi
je 0x406cc0
mov eax, edi
shr eax, 0x10
test eax, eax
je 0x406be0
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov dword [ebp - 0x48], str._invalid_
sub esp, 8
test eax, eax
jne 0x4069aa
mov eax, edi
call fcn.00402980
mov dword [ebp - 0x48], eax
test esi, esi
je 0x406d10
mov eax, esi
shr eax, 0x10
test eax, eax
je 0x406bc0
mov dword [esp + 4], 0xffffffff
mov ebx, str._invalid_
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
sub esp, 8
test eax, eax
jne 0x4069e5
mov eax, esi
call fcn.00402980
mov ebx, eax
mov eax, dword [ebp - 0x34]
test eax, eax
je 0x406d00
shr eax, 0x10
test eax, eax
je 0x406ba8
mov dword [esp + 4], 0xffffffff
mov eax, dword [ebp - 0x34]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x406a25
mov eax, dword [ebp - 0x34]
call fcn.00402980
mov edx, dword [ebp - 0x58]
mov dword [esp + 0x30], edx
mov ecx, dword [ebp - 0x54]
mov dword [esp + 0x2c], ecx
mov edx, dword [ebp - 0x50]
mov dword [esp + 0x28], edx
mov ecx, dword [ebp - 0x4c]
mov dword [esp + 0x24], ecx
mov edx, dword [ebp - 0x40]
mov dword [esp + 0x20], edx
mov ecx, dword [ebp - 0x5c]
mov dword [esp + 0x1c], ecx
mov edx, dword [ebp - 0x48]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.__s__s__s__s__s__s__s__s__s__n
mov dword [esp + 0x18], edx
mov dword [esp + 8], str.write_desktop_entry
mov dword [esp + 4], 0x40d014
mov dword [esp], 3
call fcn.00402c50
jmp 0x4065e0
mov dword [esp], eax
call fcn.004062f0
mov dword [esp + 4], str.Comment_s_n
mov dword [esp + 8], eax
mov dword [esp], ebx
call fcn.004028a0
mov eax, dword [ebp - 0x28]
test eax, eax
jne 0x406727
jmp 0x406731
mov dword [esp], eax
call sub.kernel32.dll_wine_get_unix_file_name
test eax, eax
je 0x406731
mov dword [esp + 8], eax
mov dword [esp + 4], str.Path_s_n
mov dword [esp], ebx
call fcn.004028a0
mov eax, dword [ebp - 0x2c]
test eax, eax
jne 0x406738
jmp 0x406742
mov dword [esp], eax
call fcn.004062f0
mov dword [esp + 4], str.Icon_s_n
mov dword [esp + 8], eax
mov dword [esp], ebx
call fcn.004028a0
mov eax, dword [ebp - 0x30]
test eax, eax
jne 0x406749
jmp 0x406753
mov dword [esp], eax
call fcn.004062f0
mov dword [esp + 4], str.StartupWMClass_s_n
mov dword [esp + 8], eax
mov dword [esp], ebx
call fcn.004028a0
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_fclose]
test edi, edi
je 0x406760
jmp 0x406790
mov eax, dword [ebp - 0x30]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.00402b40
mov dword [ebp - 0x58], eax
jmp 0x40682a
mov dword [esp + 8], eax
mov edi, 1
mov dword [esp + 4], 0x41b020
mov dword [esp], str._s_s.desktop
call fcn.00403040
mov esi, eax
jmp 0x4065f9
mov eax, dword [ebp - 0x34]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.00402b40
jmp 0x406a25
mov dword [esp + 4], esi
mov dword [esp], str._04x
call fcn.00402b40
mov ebx, eax
jmp 0x4069e5
mov dword [esp + 4], edi
mov dword [esp], str._04x
call fcn.00402b40
mov dword [ebp - 0x48], eax
jmp 0x4069aa
mov eax, dword [ebp - 0x3c]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.00402b40
mov dword [ebp - 0x5c], eax
jmp 0x40696c
mov eax, dword [ebp - 0x38]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.00402b40
mov dword [ebp - 0x40], eax
jmp 0x406932
mov eax, dword [ebp - 0x24]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.00402b40
mov dword [ebp - 0x4c], eax
jmp 0x4068f0
mov eax, dword [ebp - 0x28]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.00402b40
mov dword [ebp - 0x50], eax
jmp 0x4068ae
mov eax, dword [ebp - 0x2c]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.00402b40
mov dword [ebp - 0x54], eax
jmp 0x40686c
mov dword [ebp - 0x4c], str._null_
jmp 0x4068f0
mov dword [ebp - 0x50], str._null_
jmp 0x4068ae
mov dword [ebp - 0x48], str._null_
jmp 0x4069aa
mov dword [ebp - 0x40], str._null_
jmp 0x406932
mov dword [ebp - 0x54], str._null_
jmp 0x40686c
mov dword [ebp - 0x58], str._null_
jmp 0x40682a
mov eax, str._null_
jmp 0x406a25
mov ebx, str._null_
jmp 0x4069e5