Function at 0x4059a0
Capabilities:
Access peb ldr_data
Delete file
Get common file path
Get process heap flags
Get process heap force flags

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
mov esi, ecx
push ebx
mov ebx, eax
sub esp, 0x47c
mov dword [ebp - 0x440], edx
mov dword [ebp - 0x434], 0
mov dword [ebp - 0x430], 0
test byte [0x40d014], 8
jne 0x405cbc
lea eax, [ebp - 0x428]
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], 0x104
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_GetFullPathNameW]
sub eax, 1
sub esp, 0x10
cmp eax, 0x103
ja 0x405d69
lea eax, [ebp - 0x42c]
mov dword [esp + 8], eax
lea eax, [ebp - 0x430]
mov dword [esp + 4], eax
lea eax, [ebp - 0x434]
mov dword [esp], eax
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x428]
mov edx, dword [ebp - 0x440]
call sym._open_icon.constprop.0
mov ebx, eax
test eax, eax
js 0x405c28
mov eax, dword [ebp - 0x42c]
mov edi, dword [ebp - 0x430]
mov dword [ebp - 0x43c], eax
mov eax, dword [ebp - 0x434]
mov dword [ebp - 0x458], eax
test esi, esi
je 0x4060ab
cmp word [esi], 0
je 0x406159
mov eax, esi
lea esi, [esi]
nop
add eax, 2
cmp word [eax], 0
jne 0x405a80
sub eax, esi
add eax, 2
call sym._xmalloc
mov dword [ebp - 0x45c], eax
mov ecx, eax
xor eax, eax
lea esi, [esi]
movzx edx, word [esi + eax]
mov word [ecx + eax], dx
add eax, 2
test dx, dx
jne 0x405aa0
mov eax, dword [0x417228]
mov dword [esp], str._siconshicolor
mov dword [esp + 4], eax
call dbg.heap_wprintf
mov edx, dword [ebp - 0x43c]
mov dword [ebp - 0x464], eax
test edx, edx
jle 0x406163
mov eax, dword [sym.imp.kernel32.dll_HeapFree]
xor edx, edx
mov ebx, edi
mov dword [ebp - 0x44c], 0
mov esi, edx
mov dword [ebp - 0x460], eax
lea esi, [esi]
mov dword [ebp - 0x454], esi
mov dword [ebp - 0x220], esi
mov dword [ebp - 0x448], edi
test byte [0x40d014], 8
jne 0x406030
test esi, esi
je 0x405e26
mov dword [ebp - 0x440], ebx
movzx ecx, byte [edi]
mov eax, ebx
xor edx, edx
jmp 0x405b3e
add edx, 1
add eax, 0x10
cmp esi, edx
je 0x405e20
cmp byte [eax], cl
jne 0x405b30
movzx ebx, byte [edi + 1]
cmp byte [eax + 1], bl
jne 0x405b30
lea eax, [esi + 1]
mov ebx, dword [ebp - 0x440]
mov dword [ebp - 0x444], eax
mov esi, dword [ebp - 0x444]
add edi, 0x10
cmp dword [ebp - 0x43c], esi
jg 0x405af8
lea eax, [ebp - 0x220]
mov dword [esp + 8], 0
mov edi, ebx
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x40eb7e
mov ebx, dword [ebp - 0x464]
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_GetTempFileNameW]
lea eax, [ebp - 0x220]
sub esp, 0x10
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_DeleteFileW]
sub esp, 4
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
mov eax, dword [ebp - 0x460]
call eax
mov eax, dword [ebp - 0x44c]
sub esp, 0xc
test eax, eax
js 0x4060c7
mov eax, dword [ebp - 0x434]
test eax, eax
je 0x405bf4
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x460]
call eax
sub esp, 0xc
mov eax, dword [ebp - 0x45c]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov edi, dword [ebp - 0x430]
test byte [0x40d014], 4
jne 0x405d85
mov dword [ebp - 0x45c], 0
mov eax, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [ebp - 0x460], eax
mov eax, dword [ebp - 0x434]
test eax, eax
je 0x405c65
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x460]
call eax
mov edi, dword [ebp - 0x45c]
sub esp, 0xc
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x460]
call eax
sub esp, 0xc
jmp 0x405d76
test ecx, ecx
je 0x40614f
mov eax, ecx
shr eax, 0x10
je 0x405dff
mov dword [esp + 4], 0xffffffff
mov edi, str._invalid_
mov dword [esp], ecx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
sub esp, 8
test eax, eax
jne 0x405cf5
mov eax, esi
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov edi, eax
test ebx, ebx
je 0x406145
mov eax, ebx
shr eax, 0x10
je 0x406130
mov dword [esp + 4], 0xffffffff
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 0x405d2e
mov eax, ebx
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov dword [esp + 0x18], edi
mov edi, dword [ebp - 0x440]
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], edi
mov dword [esp + 0xc], str.path__s__index_d_destFilename__s__n
mov dword [esp + 8], global___FUNCTION__.8
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
jmp 0x4059d7
test byte [0x40d014], 4
jne 0x406107
mov dword [ebp - 0x45c], 0
jmp 0x405c1a
lea eax, [ebp - 0x428]
shr eax, 0x10
je 0x4061cb
lea eax, [ebp - 0x428]
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 0x405dc4
lea eax, [ebp - 0x428]
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov dword [esp + 0x18], ebx
mov ebx, dword [ebp - 0x440]
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], ebx
mov dword [esp + 0xc], str.opening_icon__s_index__d_failed__hr0x_08lX_n
mov dword [esp + 8], global___FUNCTION__.8
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0_1
jmp 0x405c3b
mov dword [esp + 4], ecx
mov dword [esp], str._04x
call sym._wine_dbg_sprintf.constprop.0_1
mov edi, eax
jmp 0x405cf5
mov ebx, dword [ebp - 0x440]
lea edx, [esi + 1]
mov dword [ebp - 0x444], edx
cmp dword [ebp - 0x43c], edx
jle 0x405ef3
movzx eax, byte [edi]
mov dword [ebp - 0x450], esi
xor esi, esi
mov byte [ebp - 0x440], al
mov eax, esi
mov byte [ebp - 0x44c], al
jmp 0x405e6b
add edx, 1
cmp dword [ebp - 0x43c], edx
je 0x405ec8
mov eax, edx
movzx ecx, byte [ebp - 0x440]
shl eax, 4
cmp byte [ebx + eax], cl
jne 0x405e60
movzx ecx, byte [edi + 1]
cmp byte [ebx + eax + 1], cl
jne 0x405e60
mov ecx, dword [ebp - 0x450]
mov esi, ecx
shl esi, 4
movzx esi, word [ebx + esi + 6]
cmp word [ebx + eax + 6], si
mov eax, 1
cmovae ecx, edx
mov dword [ebp - 0x450], ecx
movzx ecx, byte [ebp - 0x44c]
cmovae ecx, eax
add edx, 1
mov byte [ebp - 0x44c], cl
cmp dword [ebp - 0x43c], edx
jne 0x405e6b
lea esi, [esi]
movzx eax, byte [ebp - 0x44c]
test al, al
je 0x405ef3
mov eax, dword [ebp - 0x450]
mov edx, eax
mov dword [ebp - 0x220], eax
shl edx, 4
mov dword [ebp - 0x454], eax
lea ecx, [ebx + edx]
mov dword [ebp - 0x448], ecx
test byte [0x40d014], 8
jne 0x406078
mov esi, dword [ebp - 0x448]
mov ecx, 0x100
movzx eax, byte [esi]
movzx esi, byte [esi + 1]
test al, al
mov edx, esi
cmove eax, ecx
movzx edx, dl
mov dword [ebp - 0x440], eax
mov eax, esi
test al, al
cmove edx, ecx
mov dword [esp + 0xc], edx
mov eax, dword [ebp - 0x440]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x464]
mov dword [esp], str._s_dx_d_apps
mov dword [esp + 4], eax
call dbg.heap_wprintf
mov esi, eax
call dbg.create_directories
mov eax, dword [ebp - 0x45c]
mov dword [esp + 4], esi
mov dword [esp], str._s_s.png
mov dword [esp + 8], eax
call dbg.heap_wprintf
mov edx, dword [ebp - 0x458]
mov dword [ebp - 0x440], eax
mov eax, dword [edx]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 4], 0
mov dword [esp + 8], 0
mov dword [esp], edx
call dword [eax + 0x14]
mov dword [ebp - 0x44c], eax
sub esp, 0x14
test eax, eax
js 0x405fce
lea eax, [ebp - 0x220]
mov ecx, dword [ebp - 0x440]
mov edx, eax
mov eax, dword [ebp - 0x458]
call sym._convert_to_native_icon.constprop.0
mov dword [ebp - 0x44c], eax
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov edx, dword fs:[0x18]
mov eax, dword [edx + 0x30]
mov dword [ebp - 0x448], edx
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov esi, dword [ebp - 0x460]
call esi
mov eax, dword [ebp - 0x440]
sub esp, 0xc
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov edx, dword [ebp - 0x448]
mov eax, dword [edx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call esi
sub esp, 0xc
jmp 0x405b5a
movzx eax, word [edi + 6]
mov dword [esp + 0x1c], eax
movzx eax, byte [edi + 1]
mov dword [esp + 0x18], eax
movzx eax, byte [edi]
mov dword [esp + 0x10], esi
mov dword [esp + 0x14], eax
mov dword [esp + 0xc], str.__d_:__d_x__d____d_n
mov dword [esp + 8], str.platform_write_icon
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
jmp 0x405b17
mov eax, dword [ebp - 0x454]
mov dword [esp + 0xc], str.Selected:__d_n
mov dword [esp + 8], str.platform_write_icon
mov dword [esp + 0x10], eax
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
jmp 0x405f00
mov eax, dword [ebp - 0x440]
lea edx, [ebp - 0x428]
call sym._compute_native_identifier.part.0
mov dword [ebp - 0x45c], eax
jmp 0x405ab0
test byte [0x40d014], 4
je 0x405c50
mov eax, dword [ebp - 0x44c]
mov dword [esp + 0xc], str.writing_icon_failed__error_0x_08lX_n
mov dword [esp + 8], global___FUNCTION__.8
mov dword [esp + 0x10], eax
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0_1
jmp 0x405c50
mov dword [esp + 0xc], str.GetFullPathName_failed_n
mov dword [esp + 8], global___FUNCTION__.8
mov dword [esp + 4], global___dbch
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0_1
jmp 0x405d76
mov dword [esp + 4], ebx
mov dword [esp], str._04x
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x405d2e
mov eax, str._null_
jmp 0x405d2e
mov edi, str._null_
jmp 0x405cf5
mov eax, 2
jmp 0x405a8e
lea ebx, [ebp - 0x220]
mov dword [esp + 8], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 4], 0x40eb7e
mov esi, dword [ebp - 0x464]
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_GetTempFileNameW]
sub esp, 0x10
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_DeleteFileW]
sub esp, 4
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [ebp - 0x460], eax
call eax
sub esp, 0xc
jmp 0x405bdf
lea eax, [ebp - 0x428]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x405dc4