Function at 0x406a30
Capabilities:
Get process heap flags
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
push eax
mov eax, 0x2088
call fcn.0040b668
sub esp, eax
mov edi, edx
lea edx, [ebp - 0x2044]
mov eax, dword [esp + eax]
mov dword [ebp - 0x205c], ecx
lea ecx, [ebp - 0x204c]
mov dword [ebp - 0x2048], 0
mov ebx, eax
mov eax, edi
mov dword [ebp - 0x2044], 0xffffffff
mov dword [ebp - 0x2040], 0
call sym._get_link_location.constprop.0
test eax, eax
je 0x406e80
mov eax, dword [ebp - 0x2044]
mov dword [ebp - 0x206c], eax
cmp eax, 0x19
ja 0x406e48
movzx ecx, byte [ebp - 0x206c]
mov edx, 0xfdbef7ff
movzx eax, byte [global___dbch]
sar edx, cl
and edx, 1
mov dword [ebp - 0x2064], edx
jne 0x406e4f
mov esi, dword [ebp - 0x204c]
mov dword [ebp - 0x2068], esi
test al, 8
jne 0x4071d0
xor eax, eax
lea esi, [ebp - 0x1818]
mov word [ebp - 0x1818], ax
mov eax, dword [ebx]
mov dword [esp + 8], 0x104
mov dword [esp + 4], esi
mov dword [esp], ebx
call dword [eax + 0x20]
lea eax, [ebp - 0x1e30]
sub esp, 0xc
mov dword [esp + 4], eax
mov eax, dword [sym.imp.kernel32.dll_ExpandEnvironmentStringsW]
mov dword [esp + 8], 0x104
mov dword [esp], esi
mov dword [ebp - 0x2060], eax
call eax
sub esp, 0xc
test byte [0x40c000], 8
jne 0x407160
xor eax, eax
mov word [ebp - 0x1818], ax
mov eax, dword [ebx]
mov dword [esp + 8], 0x400
mov dword [esp + 4], esi
mov dword [esp], ebx
call dword [eax + 0x18]
lea eax, [ebp - 0x1018]
sub esp, 0xc
mov dword [esp + 8], 0x400
mov dword [esp + 4], eax
mov dword [esp], esi
mov eax, dword [ebp - 0x2060]
call eax
sub esp, 0xc
test byte [0x40c000], 8
jne 0x407080
lea ecx, [ebp - 0x818]
mov edx, esi
mov eax, ebx
call sym._get_cmdline.constprop.0.isra.0
lea eax, [ebp - 0x2038]
mov dword [esp + 8], 0x104
mov dword [esp + 4], eax
mov dword [esp], esi
mov eax, dword [ebp - 0x2060]
call eax
sub esp, 0xc
test byte [0x40c000], 8
jne 0x406fa0
xor eax, eax
lea edx, [ebp - 0x2048]
mov word [ebp - 0x1818], ax
mov eax, dword [ebx]
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0x104
mov dword [esp + 4], esi
mov dword [esp], ebx
call dword [eax + 0x40]
lea eax, [ebp - 0x1c28]
sub esp, 0x10
mov dword [esp + 8], 0x104
mov dword [esp + 4], eax
mov dword [esp], esi
mov eax, dword [ebp - 0x2060]
call eax
sub esp, 0xc
test byte [0x40c000], 8
jne 0x4070f0
xor ecx, ecx
cmp word [ebp - 0x2038], 0
mov word [ebp - 0x1a20], cx
jne 0x406c70
mov eax, dword [ebx]
lea edx, [ebp - 0x203c]
mov dword [ebp - 0x203c], 0
mov dword [esp + 4], edx
mov dword [esp], ebx
call dword [eax + 0x10]
mov eax, dword [ebp - 0x203c]
sub esp, 8
test eax, eax
je 0x406c70
lea esi, [ebp - 0x2038]
mov dword [esp], eax
mov dword [esp + 4], esi
call sym._SHGetPathFromIDListW_8
sub esp, 8
test eax, eax
je 0x406c70
test byte [0x40c000], 8
jne 0x4073a0
mov eax, dword [ebp - 0x205c]
mov edx, dword [ebp - 0x2048]
mov ecx, 0
cmp word [ebp - 0x1c28], 0
mov dword [esp], eax
je 0x406ef0
lea eax, [ebp - 0x1c28]
call dbg.extract_icon
mov ebx, eax
test ebx, ebx
je 0x406f05
cmp word [ebp - 0x2038], 0
jne 0x407260
mov dword [esp + 0xc], str.winemenubuilder_semaphore
mov dword [esp + 8], 1
mov dword [esp + 4], 1
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_CreateSemaphoreA]
mov dword [ebp - 0x2040], eax
sub esp, 0x10
lea eax, [ebp - 0x2040]
mov dword [esp + 0x10], 0x1cff
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov dword [esp], 1
call sym._MsgWaitForMultipleObjects_20
sub esp, 0x14
test eax, eax
jne 0x407240
mov eax, dword [ebp - 0x206c]
cmp eax, 0x10
je 0x4072b0
cmp eax, 0x19
je 0x4072c3
lea eax, [ebp - 0x1a20]
mov dword [esp + 0xc], ebx
mov ecx, edi
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x1e30]
mov dword [esp + 8], eax
lea eax, [ebp - 0x1018]
mov dword [esp + 4], eax
mov eax, edi
mov dword [esp], 0
mov edx, dword [ebp - 0x2068]
call dbg.write_menu_entry
test eax, eax
mov dword [esp + 8], 0
sete al
mov dword [esp + 4], 1
mov esi, eax
sete al
movzx eax, al
mov edi, eax
mov eax, dword [ebp - 0x2040]
xor edi, 1
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_ReleaseSemaphore]
mov dword [ebp - 0x2064], edi
sub esp, 0xc
mov eax, dword [ebp - 0x2040]
test eax, eax
je 0x406dbc
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
mov dword [esp + 8], ebx
mov ebx, dword [sym.imp.kernel32.dll_HeapFree]
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 ebx
mov eax, dword [ebp - 0x2068]
sub esp, 0xc
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x205c]
sub esp, 0xc
test eax, eax
jne 0x406e6a
mov eax, esi
test al, al
je 0x406e6a
test byte [0x40c000], 2
je 0x406e6a
mov dword [esp + 0xc], str.failed_to_build_the_menu_n
mov dword [esp + 8], global___func__.6
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x406e6a
movzx eax, byte [global___dbch]
test al, 4
jne 0x407358
lea esi, [esi]
nop
mov dword [ebp - 0x2064], 1
mov eax, dword [ebp - 0x2064]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
test byte [0x40c000], 4
je 0x406e60
mov eax, edi
shr eax, 0x10
je 0x407388
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x406eba
mov eax, edi
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Unknown_link_location__s._Ignoring._n
mov dword [esp + 8], global___func__.6
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x406e60
lea eax, [ebp - 0x2038]
call dbg.extract_icon
mov ebx, eax
test ebx, ebx
jne 0x406ca7
mov edx, dword [ebp - 0x205c]
movzx eax, byte [global___dbch]
test edx, edx
jne 0x407500
test al, 2
je 0x406ca7
cmp word [ebp - 0x1c28], 0
lea eax, [ebp - 0x2038]
lea esi, [ebp - 0x1c28]
cmove esi, eax
mov eax, esi
shr eax, 0x10
je 0x407600
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 0x406f6a
mov eax, esi
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.failed_to_extract_icon_from__s_n
mov dword [esp + 8], global___func__.6
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x406ca7
lea eax, [ebp - 0x2038]
shr eax, 0x10
je 0x4074a0
lea eax, [ebp - 0x2038]
mov dword [esp + 4], 0xffffffff
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 0x406fdf
lea eax, [ebp - 0x2038]
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.path_______:__s_n
mov dword [esp + 8], global___func__.6
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
test byte [0x40c000], 8
je 0x406bb7
lea eax, [ebp - 0x818]
shr eax, 0x10
je 0x407470
lea eax, [ebp - 0x818]
mov dword [esp + 4], 0xffffffff
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 0x407053
lea eax, [ebp - 0x818]
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.args_______:__s_n
mov dword [esp + 8], global___func__.6
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x406bb7
lea eax, [ebp - 0x1018]
shr eax, 0x10
je 0x407440
lea eax, [ebp - 0x1018]
mov dword [esp + 4], 0xffffffff
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 0x4070bf
lea eax, [ebp - 0x1018]
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.description:__s_n
mov dword [esp + 8], global___func__.6
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x406b7b
lea eax, [ebp - 0x1c28]
shr eax, 0x10
je 0x407410
lea eax, [ebp - 0x1c28]
mov dword [esp + 4], 0xffffffff
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 0x40712f
lea eax, [ebp - 0x1c28]
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.icon_file__:__s_n
mov dword [esp + 8], global___func__.6
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x406c0e
lea eax, [ebp - 0x1e30]
shr eax, 0x10
je 0x4074d0
lea eax, [ebp - 0x1e30]
mov dword [esp + 4], 0xffffffff
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 0x40719f
lea eax, [ebp - 0x1e30]
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.workdir____:__s_n
mov dword [esp + 8], global___func__.6
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x406b2e
mov eax, esi
test esi, esi
je 0x4075c0
shr eax, 0x10
je 0x4075a0
mov dword [esp + 4], 0xffffffff
mov esi, dword [ebp - 0x2068]
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 0x40720f
mov eax, esi
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Link_______:__s_n
mov dword [esp + 8], global___func__.6
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x406ad6
test byte [0x40c000], 2
jne 0x407570
mov esi, 1
jmp 0x406da6
lea eax, [ebp - 0x2038]
mov dword [esp], eax
call sym._PathFindFileNameW_4
sub esp, 4
mov ecx, eax
test eax, eax
je 0x406cb5
xor eax, eax
lea esi, [ebp - 0x1a20]
lea esi, [esi]
nop
movzx edx, word [ecx + eax]
mov word [esi + eax], dx
add eax, 2
test dx, dx
jne 0x407288
mov dword [esp], esi
call sym._CharLowerW_4
sub esp, 4
jmp 0x406cb5
cmp dword [ebp - 0x206c], 0x19
je 0x4072c3
cmp word [ebp - 0x2038], 0
jne 0x407308
lea eax, [ebp - 0x1a20]
mov dword [esp + 0x10], ebx
xor edx, edx
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x1e30]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x1018]
mov dword [esp + 8], eax
mov eax, edi
mov dword [esp + 4], 0
mov dword [esp], edi
mov ecx, dword [ebp - 0x2068]
call dbg.write_desktop_entry
jmp 0x406d6c
lea eax, [ebp - 0x1a20]
mov dword [esp + 0x10], ebx
xor edx, edx
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x1e30]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x1018]
mov dword [esp + 8], eax
lea eax, [ebp - 0x818]
mov dword [esp + 4], eax
lea eax, [ebp - 0x2038]
mov dword [esp], eax
mov ecx, dword [ebp - 0x2068]
xor eax, eax
call dbg.write_desktop_entry
jmp 0x406d6c
mov dword [esp + 0xc], str.Not_under_desktop_or_start_menu._Ignoring._n
mov dword [esp + 8], global___func__.6
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x406e60
movzx eax, di
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
jmp 0x406eba
mov eax, esi
shr eax, 0x10
je 0x407618
lea eax, [ebp - 0x2038]
mov dword [esp + 4], 0xffffffff
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 0x4073db
lea eax, [ebp - 0x2038]
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.pidl_path__:__s_n
mov dword [esp + 8], global___func__.6
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x406c70
lea eax, [ebp - 0x1c28]
mov dword [ebp - 0x2060], eax
movzx eax, word [ebp - 0x2060]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
jmp 0x40712f
lea eax, [ebp - 0x1018]
mov dword [ebp - 0x2070], eax
movzx eax, word [ebp - 0x2070]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
jmp 0x4070bf
lea eax, [ebp - 0x818]
mov dword [ebp - 0x2070], eax
movzx eax, word [ebp - 0x2070]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
jmp 0x407053
lea eax, [ebp - 0x2038]
mov dword [ebp - 0x2070], eax
movzx eax, word [ebp - 0x2070]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
jmp 0x406fdf
lea eax, [ebp - 0x1e30]
mov dword [ebp - 0x2070], eax
movzx eax, word [ebp - 0x2070]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
jmp 0x40719f
test al, 4
jne 0x4075d0
mov eax, dword [ebp - 0x2040]
mov esi, 1
test eax, eax
jne 0x406db0
mov dword [esp + 8], 0
mov ebx, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [esp + 4], 0
mov esi, dword fs:[0x18]
mov eax, dword [esi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x2068]
sub esp, 0xc
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [esi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ebx
sub esp, 0xc
jmp 0x406e6a
mov dword [esp + 0xc], str.failed_wait_for_semaphore_n
mov dword [esp + 8], global___func__.6
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x40724d
movzx eax, word [ebp - 0x2068]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
jmp 0x40720f
mov eax, str._null_
jmp 0x40720f
mov dword [esp + 0xc], str.Unable_to_extract_icon__deferring._n
mov dword [esp + 8], global___func__.6
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x407508
movzx esi, si
mov dword [esp], str._04x
mov dword [esp + 4], esi
call sym._wine_dbg_sprintf.constprop.0
jmp 0x406f6a
mov dword [ebp - 0x2060], esi
movzx eax, word [ebp - 0x2060]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
jmp 0x4073db