Function at 0x407f30
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.0040cd08
sub esp, eax
mov eax, dword [esp + eax]
mov dword [ebp - 0x2064], edx
mov dword [ebp - 0x205c], ecx
mov ebx, eax
lea ecx, [ebp - 0x204c]
mov eax, edx
mov dword [ebp - 0x2048], 0
lea edx, [ebp - 0x2044]
mov dword [ebp - 0x2044], 0xffffffff
mov dword [ebp - 0x2040], 0
call sym._get_link_location.constprop.0
test eax, eax
je 0x408390
mov eax, dword [ebp - 0x2044]
mov dword [ebp - 0x206c], eax
cmp eax, 0x19
ja 0x408360
movzx ecx, byte [ebp - 0x206c]
mov edx, 0xfdbef7ff
movzx eax, byte [global___dbch]
sar edx, cl
and edx, 1
mov dword [ebp - 0x2060], edx
jne 0x408367
mov edi, dword [ebp - 0x204c]
mov dword [ebp - 0x2068], edi
test al, 8
jne 0x408520
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]
mov edi, dword [sym.imp.kernel32.dll_ExpandEnvironmentStringsW]
sub esp, 0xc
mov dword [esp + 8], 0x104
mov dword [esp + 4], eax
mov dword [esp], esi
call edi
sub esp, 0xc
test byte [0x40d014], 8
jne 0x4084b0
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
call edi
sub esp, 0xc
test byte [0x40d014], 8
jne 0x4086e0
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
call edi
sub esp, 0xc
test byte [0x40d014], 8
jne 0x408600
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
call edi
sub esp, 0xc
test byte [0x40d014], 8
jne 0x408590
xor esi, esi
cmp word [ebp - 0x2038], 0
mov word [ebp - 0x1a20], si
jne 0x408160
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 0x408160
lea esi, [ebp - 0x2038]
mov dword [esp], eax
mov dword [esp + 4], esi
call sym._SHGetPathFromIDListW_8
sub esp, 8
test eax, eax
je 0x408160
test byte [0x40d014], 8
jne 0x408850
lea esi, [esi]
mov eax, dword [ebp - 0x205c]
mov edx, dword [ebp - 0x2048]
mov ecx, 0
cmp word [ebp - 0x1c28], 0
mov dword [esp], eax
je 0x408408
lea eax, [ebp - 0x1c28]
call dbg.extract_icon
mov esi, eax
test esi, esi
je 0x40841d
cmp word [ebp - 0x2038], 0
jne 0x408770
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], 0x4ff
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 0x408750
mov edi, dword [ebp - 0x206c]
cmp edi, 0x19
sete al
cmp edi, 0x10
sete dl
or eax, edx
mov edx, dword [section..data]
test edx, edx
jne 0x4088c0
test al, al
lea eax, [ebp - 0x1a20]
je 0x4087c0
cmp dword [ebp - 0x206c], 0x19
je 0x408253
cmp word [ebp - 0x2038], 0
jne 0x408a98
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x1e30]
xor edx, edx
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x1018]
mov dword [esp + 0x10], esi
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x2064]
mov dword [esp], eax
mov ecx, dword [ebp - 0x2068]
call dbg.write_desktop_entry
test eax, eax
mov dword [esp + 8], 0
sete al
mov dword [esp + 4], 1
sete bl
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 - 0x2060], edi
sub esp, 0xc
mov eax, dword [ebp - 0x2040]
test eax, eax
je 0x4082db
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
mov dword [esp + 8], esi
mov esi, 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 esi
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 esi
mov eax, dword [ebp - 0x205c]
sub esp, 0xc
test eax, eax
jne 0x40837a
test bl, bl
je 0x40837a
test byte [0x40d014], 2
je 0x40837a
mov dword [esp + 0xc], str.failed_to_build_the_menu_n
mov dword [esp + 8], global___FUNCTION__.4
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0_1
jmp 0x40837a
movzx eax, byte [global___dbch]
test al, 4
jne 0x408800
nop
mov dword [ebp - 0x2060], 1
mov eax, dword [ebp - 0x2060]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
test byte [0x40d014], 4
je 0x408370
mov eax, dword [ebp - 0x2064]
shr eax, 0x10
je 0x408830
mov dword [esp + 4], 0xffffffff
mov ebx, dword [ebp - 0x2064]
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 0x4083d4
mov eax, ebx
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Unknown_link_location__s._Ignoring._n
mov dword [esp + 8], global___FUNCTION__.4
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0_1
jmp 0x408370
lea eax, [ebp - 0x2038]
call dbg.extract_icon
mov esi, eax
test esi, esi
jne 0x408197
mov ecx, dword [ebp - 0x205c]
movzx eax, byte [global___dbch]
test ecx, ecx
jne 0x4089e0
test al, 2
je 0x408197
cmp word [ebp - 0x1c28], 0
lea eax, [ebp - 0x1c28]
lea edi, [ebp - 0x2038]
cmovne edi, eax
mov eax, edi
shr eax, 0x10
je 0x408b20
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 0x408482
mov eax, edi
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.failed_to_extract_icon_from__s_n
mov dword [esp + 8], global___FUNCTION__.4
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0_1
jmp 0x408197
lea eax, [ebp - 0x1e30]
shr eax, 0x10
je 0x408940
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 0x4084ef
lea eax, [ebp - 0x1e30]
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.workdir____:__s_n
mov dword [esp + 8], global___FUNCTION__.4
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
jmp 0x40802d
mov eax, edi
test edi, edi
je 0x408ae0
shr eax, 0x10
je 0x408a80
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 0x40855f
mov eax, esi
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.Link_______:__s_n
mov dword [esp + 8], global___FUNCTION__.4
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
jmp 0x407fda
lea eax, [ebp - 0x1c28]
shr eax, 0x10
je 0x4089c0
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 0x4085cf
lea eax, [ebp - 0x1c28]
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.icon_file__:__s_n
mov dword [esp + 8], global___FUNCTION__.4
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
jmp 0x4080fb
lea eax, [ebp - 0x2038]
shr eax, 0x10
je 0x4089a0
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 0x40863f
lea eax, [ebp - 0x2038]
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.path_______:__s_n
mov dword [esp + 8], global___FUNCTION__.4
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
test byte [0x40d014], 8
je 0x4080aa
lea eax, [ebp - 0x818]
shr eax, 0x10
je 0x408980
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 0x4086b3
lea eax, [ebp - 0x818]
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.args_______:__s_n
mov dword [esp + 8], global___FUNCTION__.4
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
jmp 0x4080aa
lea eax, [ebp - 0x1018]
shr eax, 0x10
je 0x408960
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 0x40871f
lea eax, [ebp - 0x1018]
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.description:__s_n
mov dword [esp + 8], global___FUNCTION__.4
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
jmp 0x408074
test byte [0x40d014], 2
jne 0x408a50
mov ebx, 1
jmp 0x4082c5
lea eax, [ebp - 0x2038]
mov dword [esp], eax
call sym._PathFindFileNameW_4
sub esp, 4
mov ecx, eax
test eax, eax
je 0x4081a5
xor eax, eax
lea edi, [ebp - 0x1a20]
lea esi, [esi]
nop
movzx edx, word [ecx + eax]
mov word [edi + eax], dx
add eax, 2
test dx, dx
jne 0x408798
mov dword [esp], edi
call sym._CharLowerW_4
sub esp, 4
jmp 0x4081a5
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x1e30]
mov dword [esp + 8], eax
lea eax, [ebp - 0x1018]
mov dword [esp + 0xc], esi
mov dword [esp + 4], eax
mov dword [esp], 0
mov eax, dword [ebp - 0x2064]
mov edx, dword [ebp - 0x2068]
mov ecx, eax
call dbg.write_menu_entry
jmp 0x40828d
mov dword [esp + 0xc], str.Not_under_desktop_or_start_menu._Ignoring._n
mov dword [esp + 8], global___FUNCTION__.4
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0_1
jmp 0x408370
mov eax, dword [ebp - 0x2064]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x4083d4
mov eax, esi
shr eax, 0x10
je 0x408b35
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 0x40888b
lea eax, [ebp - 0x2038]
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.pidl_path__:__s_n
mov dword [esp + 8], global___FUNCTION__.4
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
jmp 0x408160
mov dword [esp + 0x1c], ebx
lea ebx, [ebp - 0x1018]
movzx eax, al
mov dword [esp + 0x18], ebx
lea ebx, [ebp - 0x818]
mov dword [esp + 0x10], ebx
lea ebx, [ebp - 0x2038]
mov dword [esp + 0xc], ebx
mov dword [esp + 0x14], esi
mov dword [esp + 8], edi
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x2064]
mov dword [esp], eax
call dbg.cx_process_menu
mov dword [esp + 8], 0
mov ebx, eax
mov dword [esp + 4], 1
mov eax, dword [ebp - 0x2040]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_ReleaseSemaphore]
sub esp, 0xc
test ebx, ebx
sete al
setne bl
movzx eax, al
mov dword [ebp - 0x2060], eax
jmp 0x4082c5
lea eax, [ebp - 0x1e30]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x4084ef
lea eax, [ebp - 0x1018]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x40871f
lea eax, [ebp - 0x818]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x4086b3
lea eax, [ebp - 0x2038]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x40863f
lea eax, [ebp - 0x1c28]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x4085cf
test al, 4
jne 0x408af0
mov eax, dword [ebp - 0x2040]
mov ebx, 1
test eax, eax
jne 0x4082cf
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 0x40837a
mov dword [esp + 0xc], str.failed_wait_for_semaphore_n
mov dword [esp + 8], global___FUNCTION__.4
mov dword [esp + 4], global___dbch
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0_1
jmp 0x40875d
mov dword [esp + 4], edi
mov dword [esp], str._04x
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x40855f
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x1e30]
xor edx, edx
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
xor eax, eax
mov dword [esp + 0x10], esi
mov ecx, dword [ebp - 0x2068]
call dbg.write_desktop_entry
jmp 0x40828d
mov eax, str._null_
jmp 0x40855f
mov dword [esp + 0xc], str.Unable_to_extract_icon__deferring._n
mov dword [esp + 8], global___FUNCTION__.4
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0_1
jmp 0x4089e8
mov dword [esp + 4], edi
mov dword [esp], str._04x
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x408482
mov dword [esp + 4], esi
mov dword [esp], str._04x
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x40888b