Function at 0x406040
Capabilities:
Access peb ldr_data
Delete file
Encode data using xor
Get common file path
Get process heap flags
Get process heap force flags

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
mov ebx, eax
sub esp, 0x47c
mov dword [ebp - 0x43c], edx
mov dword [ebp - 0x440], ecx
mov dword [ebp - 0x434], 0
mov dword [ebp - 0x430], 0
test byte [section..data], 8
jne 0x40660f
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]
dec eax
sub esp, 0x10
cmp eax, 0x103
ja 0x4066f5
lea eax, [ebp - 0x42c]
mov ecx, dword [ebp - 0x440]
mov edx, dword [ebp - 0x43c]
mov dword [esp + 8], eax
lea eax, [ebp - 0x430]
mov dword [esp + 4], eax
lea eax, [ebp - 0x434]
mov dword [esp], eax
lea eax, [ebp - 0x428]
call sym._open_icon
mov ebx, eax
test eax, eax
js 0x406343
mov eax, dword [ebp - 0x42c]
movzx edx, word [ebp - 0x428]
mov dword [ebp - 0x444], eax
mov eax, dword [ebp - 0x430]
mov dword [ebp - 0x440], eax
mov eax, dword [ebp - 0x434]
mov dword [ebp - 0x448], eax
test dx, dx
je 0x406b55
lea edi, [ebp - 0x426]
xor eax, eax
lea esi, [esi]
nop
mov ecx, 0x10
lea esi, [esi]
mov esi, eax
shr ax, 1
xor esi, edx
mov ebx, eax
xor bx, 0xa001
and esi, 1
cmovne eax, ebx
shr dx, 1
dec ecx
jne 0x406138
movzx edx, word [edi]
add edi, 2
test dx, dx
jne 0x406130
movzx ebx, ax
lea eax, [ebp - 0x428]
mov edi, dword [sym.imp.ucrtbase.dll_wcsrchr]
mov dword [esp + 4], 0x5c
mov dword [esp], eax
call edi
mov dword [esp + 4], 0x2e
test eax, eax
lea esi, [eax + 2]
lea eax, [ebp - 0x428]
cmove esi, eax
mov dword [esp], esi
call edi
mov edx, eax
sub eax, esi
sar eax, 1
test edx, edx
je 0x4069cb
mov edi, dword [ebp - 0x43c]
mov dword [esp + 0xc], esi
mov dword [esp + 8], eax
mov dword [esp + 0x10], edi
mov dword [esp + 4], ebx
mov dword [esp], str._04X__.s._d
call sym._heap_wprintf
mov dword [esp + 4], str.c:proton_shortcutsicons
mov dword [esp], 0x40d430
mov dword [ebp - 0x44c], eax
call sym._heap_wprintf
mov dword [ebp - 0x45c], eax
call sym._create_directories
mov esi, dword [ebp - 0x444]
test esi, esi
jle 0x406aed
lea eax, [ebp - 0x220]
mov edi, dword [ebp - 0x440]
xor ebx, ebx
mov dword [ebp - 0x458], 0
mov dword [ebp - 0x460], eax
mov eax, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [ebp - 0x444], eax
mov eax, dword fs:[0x18]
mov dword [ebp - 0x454], eax
lea esi, [esi]
mov dword [ebp - 0x220], ebx
test byte [section..data], 8
jne 0x406598
test ebx, ebx
je 0x4063e8
movzx ecx, byte [edi]
mov eax, dword [ebp - 0x440]
xor edx, edx
mov byte [ebp - 0x43c], cl
jmp 0x40626c
inc edx
add eax, 0x10
cmp edx, ebx
je 0x4063e8
movzx ecx, byte [ebp - 0x43c]
cmp byte [eax], cl
jne 0x406260
movzx ecx, byte [edi + 1]
cmp byte [eax + 1], cl
jne 0x406260
inc ebx
add edi, 0x10
cmp esi, ebx
jg 0x406230
mov edi, dword [ebp - 0x460]
mov esi, dword [ebp - 0x45c]
mov dword [esp + 8], 0
mov dword [esp + 4], 0x40dcc8
mov dword [esp + 0xc], edi
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_GetTempFileNameW]
sub esp, 0x10
mov dword [esp], edi
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 [ebp - 0x444]
call eax
mov eax, dword [ebp - 0x458]
sub esp, 0xc
test eax, eax
js 0x406735
mov eax, dword [ebp - 0x434]
test eax, eax
je 0x406309
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
mov edx, dword [ebp - 0x430]
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
mov eax, dword [ebp - 0x444]
call eax
sub esp, 0xc
mov eax, dword [ebp - 0x44c]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ebp - 0x44c], 0
mov eax, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [ebp - 0x444], eax
test byte [section..data], 4
jne 0x406775
mov eax, dword [ebp - 0x434]
test eax, eax
jne 0x406b5c
mov edx, dword [ebp - 0x430]
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
mov eax, dword [ebp - 0x444]
call eax
mov edi, dword [ebp - 0x44c]
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 - 0x444]
call eax
mov dword [ebp - 0x44c], 0
mov eax, dword [ebp - 0x44c]
sub esp, 0xc
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
inc ebx
mov ecx, dword [ebp - 0x220]
mov eax, edi
mov edx, ebx
cmp esi, ebx
jle 0x40645c
mov dword [ebp - 0x43c], ecx
mov dword [ebp - 0x450], ebx
jmp 0x406410
inc edx
add eax, 0x10
cmp esi, edx
je 0x406450
movzx ebx, byte [edi]
cmp byte [eax + 0x10], bl
jne 0x406408
movzx ebx, byte [edi + 1]
cmp byte [eax + 0x11], bl
jne 0x406408
mov ebx, dword [ebp - 0x43c]
mov ecx, dword [ebp - 0x440]
shl ebx, 4
movzx ecx, word [ecx + ebx + 6]
cmp word [eax + 0x16], cx
jb 0x406408
mov dword [ebp - 0x220], edx
add eax, 0x10
mov dword [ebp - 0x43c], edx
inc edx
cmp esi, edx
jne 0x406410
nop
mov ecx, dword [ebp - 0x43c]
mov ebx, dword [ebp - 0x450]
test byte [section..data], 8
jne 0x4065dc
shl ecx, 4
add ecx, dword [ebp - 0x440]
mov edx, 0x100
movzx eax, byte [ecx]
test al, al
cmove eax, edx
movzx edx, byte [ecx + 1]
mov ecx, 0x100
mov dword [esp], str._s_dx_d_apps
test dl, dl
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x45c]
cmove edx, ecx
mov dword [esp + 4], eax
mov dword [esp + 0xc], edx
call sym._heap_wprintf
mov dword [ebp - 0x43c], eax
call sym._create_directories
mov ecx, dword [ebp - 0x44c]
mov eax, dword [ebp - 0x43c]
mov dword [esp], str._s_s.png
mov dword [esp + 8], ecx
mov dword [esp + 4], eax
call sym._heap_wprintf
mov edx, dword [ebp - 0x448]
mov dword [ebp - 0x450], 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 - 0x458], eax
sub esp, 0x14
test eax, eax
js 0x406534
mov ecx, dword [ebp - 0x450]
mov edx, dword [ebp - 0x460]
mov eax, dword [ebp - 0x448]
call sym._convert_to_native_icon.constprop.0
mov dword [ebp - 0x458], eax
mov eax, dword [ebp - 0x43c]
mov dword [esp + 4], 0
mov ecx, dword [ebp - 0x444]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x454]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ecx
mov edx, dword [ebp - 0x450]
mov eax, dword [ebp - 0x454]
sub esp, 0xc
mov ecx, dword [ebp - 0x444]
mov dword [esp + 8], edx
mov dword [esp + 4], 0
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ecx
sub esp, 0xc
jmp 0x406281
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], ebx
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], 0x40c000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x406243
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], str.Selected:__d_n
mov dword [esp + 8], str.platform_write_icon
mov dword [esp + 4], 0x40c000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
mov ecx, dword [ebp - 0x220]
jmp 0x406469
test eax, eax
je 0x406a31
shr eax, 0x10
je 0x406866
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, eax
sub esp, 8
mov eax, str._invalid_
test ecx, ecx
jne 0x406879
movzx eax, word [ebx]
test ax, ax
je 0x406acc
nop
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [ebx + edx*2 + 2], 0
jne 0x406650
mov ecx, 0x224c
lea edi, [ebp - 0xfe]
mov dword [ebp - 0x448], ebx
mov esi, ebx
mov word [ebp - 0x220], cx
lea ecx, [ebp - 0x21e]
mov dword [ebp - 0x444], edi
jmp 0x4066c4
cmp ax, 9
je 0x40694b
cmp ax, 0xa
jne 0x406969
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea esi, [esi]
lea edi, [edx - 1]
cmp ecx, dword [ebp - 0x444]
ja 0x4069f2
test edx, edx
jle 0x4069f2
movzx eax, word [esi]
mov edx, edi
add esi, 2
cmp ax, 0xd
je 0x40693a
jbe 0x406685
cmp ax, 0x22
je 0x4069ba
cmp ax, 0x5c
jne 0x40695c
mov ebx, 0x5c5c
add ecx, 2
mov word [ecx - 2], bx
jmp 0x4066a8
mov dword [ebp - 0x44c], 0
test byte [section..data], 4
je 0x406335
mov dword [esp + 0xc], str.GetFullPathName_failed_n
mov dword [esp + 8], str.extract_icon
mov dword [esp + 4], 0x40c000
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x406335
test byte [section..data], 4
je 0x406365
mov eax, dword [ebp - 0x458]
mov dword [esp + 0xc], str.writing_icon_failed__error_0x_08lX_n
mov dword [esp + 8], str.extract_icon
mov dword [esp + 0x10], eax
mov dword [esp + 4], 0x40c000
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
jmp 0x406365
lea eax, [ebp - 0x428]
shr eax, 0x10
je 0x406b6c
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 0x4068ea
movzx eax, word [ebp - 0x428]
test ax, ax
je 0x406b9c
mov ecx, edx
lea edx, [edx + 1]
cmp word [ebp + ecx*2 - 0x426], 0
jne 0x4067bd
mov edi, 0x224c
lea esi, [ebp - 0xfe]
mov dword [ebp - 0x444], ebx
lea edx, [ebp - 0x21e]
mov word [ebp - 0x220], di
lea edi, [ebp - 0x428]
mov dword [ebp - 0x440], esi
jmp 0x406835
cmp ax, 9
je 0x406a4c
cmp ax, 0xa
jne 0x406a6a
mov eax, 0x6e5c
add edx, 2
mov word [edx - 2], ax
lea esi, [ecx - 1]
cmp edx, dword [ebp - 0x440]
ja 0x4068b8
test ecx, ecx
jle 0x4068b8
movzx eax, word [edi]
mov ecx, esi
add edi, 2
cmp ax, 0xd
je 0x406a3b
jbe 0x4067f9
cmp ax, 0x22
je 0x406abb
cmp ax, 0x5c
jne 0x406a5d
mov ebx, 0x5c5c
add edx, 2
mov word [edx - 2], bx
jmp 0x406819
movzx eax, bx
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
mov edi, dword [ebp - 0x43c]
mov dword [esp + 0x18], str._null_
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], str.extract_icon
mov dword [esp + 4], 0x40c000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x40607b
mov byte [edx], 0x22
mov ebx, dword [ebp - 0x444]
test esi, esi
jle 0x406bb5
mov ecx, 0x2e2e
mov byte [edx + 3], 0x2e
lea eax, [edx + 4]
mov word [edx + 1], cx
mov byte [eax], 0
lea eax, [ebp - 0x220]
mov dword [esp], eax
call sym.___wine_dbg_strdup
mov edi, dword [ebp - 0x43c]
mov dword [esp + 0x18], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], edi
mov dword [esp + 0xc], str.opening_icon__s_index__d_failed__hr0x_08lX_n
mov dword [esp + 8], str.extract_icon
mov dword [esp + 4], 0x40c000
mov dword [esp], 2
call sym._wine_dbg_log.constprop.0
mov eax, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [ebp - 0x44c], 0
mov dword [ebp - 0x444], eax
jmp 0x406365
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x4066a8
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x4066a8
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x406a29
mov edi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr di, 0xc
movzx edi, di
movzx ebx, byte [edi + str.0123456789abcdefGCC:__GNU__10.3.0]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [edi + str.0123456789abcdefGCC:__GNU__10.3.0]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + str.0123456789abcdefGCC:__GNU__10.3.0]
and edi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [edi + str.0123456789abcdefGCC:__GNU__10.3.0]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x4066a8
mov edi, 0x225c
add ecx, 2
mov word [ecx - 2], di
jmp 0x4066a8
cmp word [esi], 0
je 0x406bbd
mov eax, esi
lea esi, [esi]
nop
add eax, 2
cmp word [eax], 0
jne 0x4069e0
sub eax, esi
sar eax, 1
jmp 0x4061a2
mov byte [ecx], 0x22
mov ebx, dword [ebp - 0x448]
test edi, edi
jle 0x406ae5
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
mov byte [eax], 0
lea eax, [ebp - 0x220]
mov dword [esp], eax
call sym.___wine_dbg_strdup
jmp 0x406879
mov byte [ecx], al
inc ecx
jmp 0x4066a8
mov eax, str._null_
jmp 0x406879
mov eax, 0x725c
add edx, 2
mov word [edx - 2], ax
jmp 0x406819
mov eax, 0x745c
add edx, 2
mov word [edx - 2], ax
jmp 0x406819
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x406b94
mov esi, eax
mov byte [edx], 0x5c
add edx, 5
shr si, 0xc
movzx esi, si
movzx ebx, byte [esi + str.0123456789abcdefGCC:__GNU__10.3.0]
mov esi, eax
shr si, 8
and esi, 0xf
mov byte [edx - 4], bl
movzx ebx, byte [esi + str.0123456789abcdefGCC:__GNU__10.3.0]
mov esi, eax
and eax, 0xf
shr si, 4
movzx eax, byte [eax + str.0123456789abcdefGCC:__GNU__10.3.0]
and esi, 0xf
mov byte [edx - 3], bl
movzx ebx, byte [esi + str.0123456789abcdefGCC:__GNU__10.3.0]
mov byte [edx - 1], al
mov byte [edx - 2], bl
jmp 0x406819
mov esi, 0x225c
add edx, 2
mov word [edx - 2], si
jmp 0x406819
mov eax, 0x224c
mov byte [ebp - 0x21e], 0x22
lea ecx, [ebp - 0x21e]
mov word [ebp - 0x220], ax
lea eax, [ecx + 1]
jmp 0x406a13
mov edi, dword [ebp - 0x45c]
lea ebx, [ebp - 0x220]
mov dword [esp + 8], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 4], 0x40dcc8
mov dword [esp], edi
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], 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 [sym.imp.kernel32.dll_HeapFree]
mov dword [ebp - 0x444], eax
call eax
sub esp, 0xc
jmp 0x4062f4
xor ebx, ebx
jmp 0x406160
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
jmp 0x406373
lea eax, [ebp - 0x428]
mov dword [esp], str._04x
mov dword [ebp - 0x440], eax
movzx eax, word [ebp - 0x440]
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
jmp 0x4068ea
mov byte [edx], al
inc edx
jmp 0x406819
mov esi, 0x224c
mov byte [ebp - 0x21e], 0x22
lea edx, [ebp - 0x21e]
mov word [ebp - 0x220], si
lea eax, [edx + 1]
jmp 0x4068d9
xor eax, eax
jmp 0x4061a2