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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
push eax
mov eax, 0xf98
call fcn.0040b4b8
sub esp, eax
mov eax, dword [esp + eax]
mov dword [ebp - 0xf7c], edx
mov dword [ebp - 0xf74], 0
mov dword [ebp - 0xf70], 0
mov dword [ebp - 0xf68], 0
mov dword [ebp - 0xf64], 0
call fcn.004015a0
mov dword [esp], eax
mov esi, eax
call sub.kernel32.dll_wine_get_dos_file_name
mov ebx, eax
test eax, eax
je 0x405ee5
lea eax, [ebp - 0xf74]
mov dword [esp + 0xc], 0x413ce8
mov dword [esp + 0x10], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov dword [esp], 0x413818
call dword [sym.imp.ole32.dll_CoCreateInstance]
sub esp, 0x14
test eax, eax
js 0x405d28
mov eax, dword [ebp - 0xf74]
lea ecx, [ebp - 0xf70]
mov edx, dword [eax]
mov dword [esp + 8], ecx
mov dword [esp + 4], 0x4152b8
mov dword [esp], eax
call dword [edx]
sub esp, 0xc
test eax, eax
js 0x405db0
mov eax, dword [ebp - 0xf70]
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 0x405ba0
lea edi, [ebp - 0xe30]
mov eax, dword [ebp - 0xf74]
lea ecx, [ebp - 0x818]
mov edx, edi
call fcn.00403a70
lea eax, [ebp - 0xc28]
mov dword [esp], edi
mov dword [esp + 4], eax
mov eax, dword [sym.imp.kernel32.dll_ExpandEnvironmentStringsW]
mov dword [esp + 8], 0x104
mov dword [ebp - 0xf80], eax
call eax
xor eax, eax
lea ecx, [ebp - 0xf6c]
mov word [ebp - 0xe30], ax
mov eax, dword [ebp - 0xf74]
sub esp, 0xc
mov edx, dword [eax]
mov dword [esp + 0xc], ecx
mov dword [esp + 4], edi
mov dword [esp + 8], 0x104
mov dword [esp], eax
call dword [edx + 0x40]
lea ecx, [ebp - 0xa20]
mov eax, dword [ebp - 0xf80]
sub esp, 0x10
mov dword [esp], edi
lea edi, [ebp - 0xf5c]
mov dword [esp + 8], 0x104
mov dword [esp + 4], ecx
call eax
sub esp, 0xc
cmp word [ebp - 0xc28], 0
jne 0x405cc0
mov eax, dword [ebp - 0xf74]
lea ecx, [ebp - 0xf60]
mov dword [ebp - 0xf60], 0
mov edx, dword [eax]
mov dword [esp + 4], ecx
mov dword [esp], eax
call dword [edx + 0x10]
mov eax, dword [ebp - 0xf60]
sub esp, 8
test eax, eax
je 0x405cc0
lea ecx, [ebp - 0xc28]
mov dword [esp], eax
mov dword [esp + 4], ecx
call dword [sym.imp.shell32.dll_SHGetPathFromIDListW]
sub esp, 8
test eax, eax
je 0x405cc0
test byte [section..data], 8
je 0x405cc0
lea eax, [ebp - 0xc28]
shr eax, 0x10
je 0x405e81
lea eax, [ebp - 0xc28]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
sub esp, 8
test eax, eax
jne 0x405eb3
cmp word [ebp - 0xc28], 0
je 0x405ec3
lea esi, [esi]
mov edx, eax
lea eax, [eax + 1]
cmp word [ebp + edx*2 - 0xc26], 0
jne 0x405af8
mov eax, 0x224c
mov dword [ebp - 0xf80], esi
lea ecx, [ebp - 0xc28]
mov word [ebp - 0xf5c], ax
lea eax, [ebp - 0xf5a]
mov dword [ebp - 0xf84], ebx
mov esi, eax
jmp 0x405b6b
cmp ax, 9
je 0x405e00
cmp ax, 0xa
jne 0x405e1e
mov eax, 0x6e5c
add esi, 2
mov word [esi - 2], ax
lea eax, [edx - 1]
test edx, edx
jle 0x405c5e
lea ebx, [ebp - 0xe3a]
cmp esi, ebx
ja 0x405c5e
mov edx, eax
movzx eax, word [ecx]
add ecx, 2
cmp ax, 0xd
je 0x405dea
jbe 0x405b30
cmp ax, 0x22
je 0x405e70
cmp ax, 0x5c
jne 0x405e11
mov ebx, 0x5c5c
add esi, 2
mov word [esi - 2], bx
jmp 0x405b50
test byte [section..data], 2
jne 0x405d80
lea esi, [esi]
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
sub esp, 0xc
mov dword [esp + 8], ebx
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 - 0xf74]
sub esp, 0xc
test eax, eax
je 0x405c06
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
mov eax, dword [ebp - 0xf70]
test eax, eax
je 0x405c1b
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
mov eax, dword [ebp - 0xf68]
test eax, eax
je 0x405c30
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
mov edx, dword [ebp - 0xf64]
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 esi
sub esp, 0xc
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov ecx, esi
mov ebx, dword [ebp - 0xf84]
mov esi, dword [ebp - 0xf80]
mov byte [ecx], 0x22
test eax, eax
jle 0x405edb
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
lea edi, [ebp - 0xf5c]
mov byte [eax], 0
mov dword [esp], edi
call fcn.0040b160
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], 0x40c000
mov dword [esp], 3
call fcn.004014e0
lea eax, [ebp - 0xf64]
mov dword [esp + 8], edi
mov ecx, 0
cmp word [ebp - 0xa20], 0
mov dword [esp + 4], eax
lea eax, [ebp - 0xf68]
mov edx, dword [ebp - 0xf6c]
mov dword [esp], eax
jne 0x405d68
lea eax, [ebp - 0xc28]
call fcn.00405610
test eax, eax
js 0x405bb0
mov eax, dword [ebp - 0xf7c]
mov ecx, dword [ebp - 0xf5c]
mov edx, dword [ebp - 0xf64]
mov dword [esp], eax
mov eax, dword [ebp - 0xf68]
call fcn.00404770
jmp 0x405bb0
test byte [section..data], 2
je 0x405bb0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.could_not_create_IShellLinkW__error_0x_08lX_n
mov dword [esp + 8], str.thumbnail_lnk
mov dword [esp + 4], 0x40c000
mov dword [esp], 1
call fcn.004014e0
jmp 0x405bb0
lea eax, [ebp - 0xa20]
call fcn.00405610
test eax, eax
js 0x405bb0
jmp 0x405cff
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.could_not_read_.lnk__error_0x_08lX_n
mov dword [esp + 8], str.thumbnail_lnk
mov dword [esp + 4], 0x40c000
mov dword [esp], 1
call fcn.004014e0
jmp 0x405bb0
test byte [section..data], 2
je 0x405bb0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.could_not_query_IPersistFile__error_0x_08lX_n
mov dword [esp + 8], str.thumbnail_lnk
mov dword [esp + 4], 0x40c000
mov dword [esp], 1
call fcn.004014e0
jmp 0x405bb0
mov eax, 0x725c
add esi, 2
mov word [esi - 2], ax
jmp 0x405b50
mov eax, 0x745c
add esi, 2
mov word [esi - 2], ax
jmp 0x405b50
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x405ea9
mov edi, eax
mov byte [esi], 0x5c
add esi, 5
shr di, 0xc
movzx edi, di
movzx ebx, byte [edi + str.0123456789abcdefxmalloc]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [esi - 4], bl
movzx ebx, byte [edi + str.0123456789abcdefxmalloc]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + str.0123456789abcdefxmalloc]
and edi, 0xf
mov byte [esi - 3], bl
movzx ebx, byte [edi + str.0123456789abcdefxmalloc]
mov byte [esi - 1], al
mov byte [esi - 2], bl
jmp 0x405b50
mov edi, 0x225c
add esi, 2
mov word [esi - 2], di
jmp 0x405b50
lea eax, [ebp - 0xc28]
mov dword [esp], str._04x
mov dword [ebp - 0xf80], eax
movzx eax, word [ebp - 0xf80]
mov dword [esp + 4], eax
call fcn.00401420
jmp 0x405c98
mov byte [esi], al
add esi, 1
jmp 0x405b50
mov eax, str._invalid_
lea edi, [ebp - 0xf5c]
jmp 0x405c98
mov word [ebp - 0xf5c], 0x224c
lea eax, [ebp - 0xf5a]
mov byte [ebp - 0xf5a], 0x22
mov ecx, eax
mov eax, ecx
add eax, 1
jmp 0x405c87
test byte [section..data], 2
je 0x405bb0
mov dword [esp + 0x10], 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], 0x40c000
mov dword [esp], 1
call fcn.004014e0
jmp 0x405bb0