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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0xe4c
mov dword [ebp - 0xe40], edx
mov dword [ebp - 0xe3c], 0
mov dword [ebp - 0xe38], 0
mov dword [ebp - 0xe30], 0
mov dword [ebp - 0xe2c], 0
mov dword [esp], eax
call fcn.004062f0
mov dword [esp], eax
mov edi, eax
call sub.kernel32.dll_wine_get_dos_file_name
mov ebx, eax
test eax, eax
je 0x4072b7
lea eax, [ebp - 0xe3c]
mov dword [esp + 0xc], 0x416a08
mov dword [esp + 0x10], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov dword [esp], 0x416518
call dword [sym.imp.ole32.dll_CoCreateInstance]
sub esp, 0x14
test eax, eax
js 0x4071b8
mov eax, dword [ebp - 0xe3c]
lea ecx, [ebp - 0xe38]
mov edx, dword [eax]
mov dword [esp + 8], ecx
mov dword [esp + 4], 0x417fd8
mov dword [esp], eax
call dword [edx]
sub esp, 0xc
test eax, eax
js 0x407260
mov eax, dword [ebp - 0xe38]
mov edx, dword [eax]
mov dword [esp + 8], 0
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [edx + 0x14]
sub esp, 0xc
test eax, eax
js 0x4071a0
mov eax, dword [ebp - 0xe3c]
lea esi, [ebp - 0xe24]
lea ecx, [ebp - 0x80c]
mov edx, esi
call fcn.004043c0
lea eax, [ebp - 0xc1c]
mov dword [esp], esi
mov dword [esp + 4], eax
mov eax, dword [sym.imp.kernel32.dll_ExpandEnvironmentStringsW]
mov dword [esp + 8], 0x104
mov dword [ebp - 0xe44], eax
call eax
lea ecx, [ebp - 0xe34]
xor eax, eax
mov word [ebp - 0xe24], ax
mov eax, dword [ebp - 0xe3c]
sub esp, 0xc
mov edx, dword [eax]
mov dword [esp + 0xc], ecx
mov dword [esp + 4], esi
mov dword [esp + 8], 0x104
mov dword [esp], eax
call dword [edx + 0x40]
lea ecx, [ebp - 0xa14]
sub esp, 0x10
mov dword [esp], esi
lea esi, [ebp - 0xe28]
mov dword [esp + 8], 0x104
mov dword [esp + 4], ecx
mov eax, dword [ebp - 0xe44]
call eax
sub esp, 0xc
cmp word [ebp - 0xc1c], 0
jne 0x4070d0
mov dword [ebp - 0xe28], 0
mov eax, dword [ebp - 0xe3c]
mov edx, dword [eax]
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [edx + 0x10]
mov eax, dword [ebp - 0xe28]
sub esp, 8
test eax, eax
je 0x4070d0
lea ecx, [ebp - 0xc1c]
mov dword [esp], eax
mov dword [esp + 4], ecx
call dword [sym.imp.shell32.dll_SHGetPathFromIDListW]
sub esp, 8
test eax, eax
je 0x4070d0
test byte [0x40d014], 8
je 0x4070d0
lea eax, [ebp - 0xc1c]
shr eax, 0x10
test eax, eax
je 0x40729c
lea eax, [ebp - 0xc1c]
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 0x4070a2
lea eax, [ebp - 0xc1c]
call fcn.00402980
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.pidl_path__:__s_n
mov dword [esp + 8], str.thumbnail_lnk
mov dword [esp + 4], 0x40d014
mov dword [esp], 3
call fcn.00402c50
lea esi, [esi]
cmp word [ebp - 0xa14], 0
lea eax, [ebp - 0xe2c]
mov ecx, 0
mov edx, dword [ebp - 0xe34]
mov dword [esp + 4], eax
lea eax, [ebp - 0xe30]
mov dword [esp + 8], esi
mov dword [esp], eax
jne 0x4071f0
lea eax, [ebp - 0xc1c]
call fcn.004058b0
mov esi, dword [ebp - 0xe2c]
test eax, eax
jns 0x407209
lea esi, [esi]
mov dword [esp], edi
mov edi, dword [sym.imp.ucrtbase.dll_free]
call edi
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
call dword [sym.imp.kernel32.dll_HeapFree]
mov eax, dword [ebp - 0xe3c]
sub esp, 0xc
test eax, eax
je 0x407164
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
mov eax, dword [ebp - 0xe38]
test eax, eax
je 0x407179
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
mov eax, dword [ebp - 0xe30]
test eax, eax
je 0x40718e
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
mov dword [esp], esi
call edi
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
test byte [0x40d014], 2
jne 0x407230
xor esi, esi
jmp 0x407120
test byte [0x40d014], 2
je 0x4071ad
mov dword [esp + 0x10], eax
xor esi, esi
mov dword [esp + 0xc], str.could_not_create_IShellLinkW__error_0x_08lX_n
mov dword [esp + 8], str.thumbnail_lnk
mov dword [esp + 4], 0x40d014
mov dword [esp], 1
call fcn.00402c50
jmp 0x407120
lea eax, [ebp - 0xa14]
call fcn.004058b0
mov esi, dword [ebp - 0xe2c]
test eax, eax
js 0x407120
mov eax, dword [ebp - 0xe40]
mov edx, esi
mov dword [esp], eax
mov ecx, dword [ebp - 0xe28]
mov eax, dword [ebp - 0xe30]
call fcn.00404e70
jmp 0x407120
mov dword [esp + 0x10], eax
xor esi, esi
mov dword [esp + 0xc], str.could_not_read_.lnk__error_0x_08lX_n
mov dword [esp + 8], str.thumbnail_lnk
mov dword [esp + 4], 0x40d014
mov dword [esp], 1
call fcn.00402c50
jmp 0x407120
test byte [0x40d014], 2
je 0x4071ad
mov dword [esp + 0x10], eax
xor esi, esi
mov dword [esp + 0xc], str.could_not_query_IPersistFile__error_0x_08lX_n
mov dword [esp + 8], str.thumbnail_lnk
mov dword [esp + 4], 0x40d014
mov dword [esp], 1
call fcn.00402c50
jmp 0x407120
lea eax, [ebp - 0xc1c]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.00402b40
jmp 0x4070a2
test byte [0x40d014], 2
je 0x4071ad
mov dword [esp + 0x10], edi
xor esi, esi
mov dword [esp + 0xc], str.could_not_convert__s_to_DOS_path_n
mov dword [esp + 8], str.thumbnail_lnk
mov dword [esp + 4], 0x40d014
mov dword [esp], 1
call fcn.00402c50
jmp 0x407120