Function at 0x404170
Capabilities:
Check if file exists
Delete file
Get common file path
Get file attributes
Move file

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
mov ebx, edx
sub esp, 0x378
mov dword [ebp - 0x360], eax
lea eax, [ebp - 0x214]
mov dword [ebp - 0x354], eax
test byte [0x40d000], 8
jne 0x404630
mov esi, dword [ebp - 0x354]
mov eax, dword [0x41b20c]
mov dword [esp + 8], 0
mov dword [esp + 4], 0x40f86e
mov dword [esp + 0xc], esi
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetTempFileNameW]
mov eax, dword [sym.imp.ucrtbase.dll__wfopen]
sub esp, 0x10
mov dword [esp], esi
xor esi, esi
mov dword [esp + 4], 0x40f626
mov dword [ebp - 0x35c], eax
call eax
mov edi, eax
test eax, eax
je 0x4044d0
mov dword [esp + 4], str.__DOCTYPE_Menu_PUBLIC_____freedesktop__DTD_Menu_1.0__EN__n
mov dword [esp], eax
call dbg.fprintf
mov dword [esp + 4], str._http:__www.freedesktop.org_standards_menu_spec_menu_1.0.dtd___n
mov dword [esp], edi
call dbg.fprintf
mov dword [esp + 4], str._Menu__n
mov dword [esp], edi
call dbg.fprintf
mov dword [esp + 4], str.___Name_Applications__Name__n
mov dword [esp], edi
call dbg.fprintf
mov dword [esp + 4], ebx
mov dword [esp], str.wine_s.desktop
call dbg.heap_wprintf
mov ecx, eax
mov dword [ebp - 0x344], eax
movzx eax, word [eax]
test ax, ax
je 0x404ac0
lea ebx, [ecx + 2]
mov dword [ebp - 0x350], ecx
mov ecx, dword [sym.imp.ucrtbase.dll_fclose]
mov dword [ebp - 0x348], esi
mov dword [ebp - 0x358], ecx
mov ecx, dword [sym.imp.ucrtbase.dll_free]
mov dword [ebp - 0x34c], ecx
jmp 0x404292
mov edx, ebx
add ebx, 2
movzx eax, word [ebx - 2]
test ax, ax
je 0x40437a
cmp ax, 0x5c
jne 0x404280
mov ecx, dword [ebp - 0x348]
test ecx, ecx
je 0x4044e0
xor edx, edx
mov word [ebx - 2], dx
mov dword [esp + 4], str.___Menu__n
mov dword [esp], edi
call dbg.fprintf
mov esi, dword [ebp - 0x344]
mov eax, esi
call dbg.wchars_to_xml_text
mov dword [esp + 8], 0x40fa46
mov dword [esp + 0xc], eax
mov dword [esp + 4], str._____Name__s_s__Name__n
mov dword [esp], edi
call dbg.fprintf
mov eax, esi
call dbg.wchars_to_xml_text
mov dword [esp + 8], 0x40fa46
mov dword [esp + 0xc], eax
mov dword [esp + 4], str._____Directory__s_s.directory__Directory__n
mov dword [esp], edi
call dbg.fprintf
mov eax, 0x40f854
mov esi, dword [ebp - 0x344]
mov dword [esp + 8], eax
mov eax, dword [0x41b208]
mov dword [esp], str._sdesktop_directories_s_s.directory
mov dword [esp + 0xc], esi
mov dword [esp + 4], eax
call dbg.heap_wprintf
mov esi, eax
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetFileAttributesW]
sub esp, 4
cmp eax, 0xffffffff
je 0x404562
mov dword [esp], esi
mov esi, 0x2d
mov eax, dword [ebp - 0x34c]
call eax
mov dword [ebp - 0x350], ebx
mov edx, ebx
add ebx, 2
mov word [ebx - 4], si
movzx eax, word [ebx - 2]
add dword [ebp - 0x348], 1
test ax, ax
jne 0x404292
xor ecx, ecx
mov esi, dword [ebp - 0x348]
mov word [edx], cx
mov dword [esp + 4], str._____Include__n
mov dword [esp], edi
call dbg.fprintf
mov eax, dword [ebp - 0x344]
call dbg.wchars_to_xml_text
mov dword [esp + 4], str._______Filename__s__Filename__n
mov dword [esp + 8], eax
mov dword [esp], edi
call dbg.fprintf
mov dword [esp + 4], str.______Include__n
mov dword [esp], edi
call dbg.fprintf
test esi, esi
je 0x4043e7
xor ebx, ebx
lea esi, [esi]
mov dword [esp + 4], str.____Menu__n
add ebx, 1
mov dword [esp], edi
call dbg.fprintf
cmp esi, ebx
jne 0x4043d0
mov dword [esp + 4], str.__Menu__n
mov dword [esp], edi
call dbg.fprintf
mov eax, dword [ebp - 0x344]
mov dword [esp], str._s_s
mov dword [esp + 8], eax
mov eax, dword [0x41b20c]
mov dword [esp + 4], eax
call dbg.heap_wprintf
cmp word [eax], 0
mov ebx, eax
je 0x404b20
add eax, 2
cmp word [eax], 0
jne 0x404422
sub eax, ebx
sar eax, 1
mov ecx, 0x64
mov edx, str..desktop
jmp 0x404444
movzx ecx, word [edx + 2]
add edx, 2
test cx, cx
jne 0x404440
sub edx, str..desktop
sar edx, 1
sub eax, edx
mov edx, 0x2e
lea ecx, [ebx + eax*2]
xor eax, eax
jmp 0x404469
movzx edx, word [eax + str..menu]
mov word [ecx + eax], dx
add eax, 2
test dx, dx
jne 0x404462
mov dword [esp], edi
mov eax, dword [ebp - 0x358]
call eax
mov eax, dword [ebp - 0x354]
mov dword [esp + 8], 1
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_MoveFileExW]
sub esp, 0xc
mov esi, eax
test eax, eax
jne 0x404550
mov eax, dword [ebp - 0x354]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_DeleteFileW]
sub esp, 4
mov eax, dword [ebp - 0x344]
mov edi, dword [ebp - 0x34c]
mov dword [esp], eax
call edi
mov dword [esp], ebx
call edi
lea esp, [ebp - 0xc]
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
xor eax, eax
mov word [ebx - 2], ax
mov dword [esp + 4], str.___Menu__n
mov dword [esp], edi
call dbg.fprintf
mov esi, dword [ebp - 0x344]
mov eax, esi
call dbg.wchars_to_xml_text
mov dword [esp + 8], str.wine_
mov dword [esp + 0xc], eax
mov dword [esp + 4], str._____Name__s_s__Name__n
mov dword [esp], edi
call dbg.fprintf
mov eax, esi
call dbg.wchars_to_xml_text
mov dword [esp + 8], str.wine_
mov dword [esp + 0xc], eax
mov dword [esp + 4], str._____Directory__s_s.directory__Directory__n
mov dword [esp], edi
call dbg.fprintf
mov eax, 0x40f848
jmp 0x40430d
mov edx, dword [ebp - 0x360]
mov eax, ebx
call sym._register_menus_entry
jmp 0x4044ba
test byte [0x40d000], 8
jne 0x404830
mov dword [esp + 4], 0x40f626
mov eax, dword [ebp - 0x35c]
mov dword [esp], esi
call eax
test eax, eax
je 0x404347
mov dword [esp + 4], str._Desktop_Entry__n
mov dword [esp], eax
mov dword [ebp - 0x364], eax
call dbg.fprintf
mov eax, dword [ebp - 0x364]
mov dword [esp + 4], str.TypeDirectory_n
mov dword [esp], eax
call dbg.fprintf
mov ecx, dword [ebp - 0x350]
mov dword [esp + 4], str.wine
mov dword [esp], ecx
call dword [sym.imp.ucrtbase.dll_wcscmp]
test eax, eax
je 0x4046f0
mov eax, dword [ebp - 0x350]
call dbg.wchars_to_utf8_chars
mov dword [esp + 4], str.Name_s_n
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x364]
mov dword [esp], eax
call dbg.fprintf
mov eax, dword [ebp - 0x364]
mov dword [esp + 4], str.Iconfolder_n
mov dword [esp], eax
call dbg.fprintf
mov eax, dword [ebp - 0x364]
mov dword [esp], eax
mov eax, dword [ebp - 0x358]
call eax
jmp 0x404347
test edx, edx
je 0x404b27
mov eax, edx
shr eax, 0x10
je 0x404721
mov dword [esp + 4], 0xffffffff
mov dword [esp], edx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edi, eax
sub esp, 8
mov eax, str._invalid_
test edi, edi
jne 0x404734
cmp word [ebx], 0
je 0x40467a
lea esi, [esi]
add edi, 1
cmp word [ebx + edi*2], 0
jne 0x404670
mov eax, 0x224c
mov dword [ebp - 0x344], ebx
mov ecx, ebx
lea edx, [ebp - 0x212]
mov word [ebp - 0x214], ax
lea esi, [edi - 1]
test edi, edi
jle 0x404a70
lea eax, [ebp - 0xf2]
cmp edx, eax
ja 0x404a70
add ecx, 2
movzx eax, word [ecx - 2]
cmp ax, 0xd
je 0x4047a0
ja 0x404761
cmp ax, 9
je 0x404784
cmp ax, 0xa
jne 0x4047b3
mov eax, 0x6e5c
add edx, 2
mov edi, esi
mov word [edx - 2], ax
jmp 0x404694
mov eax, dword [ebp - 0x364]
mov dword [esp + 4], str.NameWine_n
mov dword [esp], eax
call dbg.fprintf
mov eax, dword [ebp - 0x364]
mov dword [esp + 4], str.Iconwine_n
mov dword [esp], eax
call dbg.fprintf
jmp 0x404610
movzx eax, dx
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.16
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.__s__n
mov dword [esp + 8], global___func__.9
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.18
jmp 0x40419d
cmp ax, 0x22
je 0x404813
cmp ax, 0x5c
jne 0x4047b3
mov edi, 0x5c5c
add edx, 2
mov word [edx - 2], di
mov edi, esi
jmp 0x404694
mov eax, 0x745c
add edx, 2
mov edi, esi
mov word [edx - 2], ax
jmp 0x404694
mov eax, 0x725c
add edx, 2
mov edi, esi
mov word [edx - 2], ax
jmp 0x404694
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x404ab0
mov edi, eax
mov byte [edx], 0x5c
add edx, 5
shr di, 0xc
movzx edi, di
movzx ebx, byte [edi + str.0123456789abcdef]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [edx - 4], bl
movzx ebx, byte [edi + str.0123456789abcdef]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + str.0123456789abcdef]
and edi, 0xf
mov byte [edx - 3], bl
movzx ebx, byte [edi + str.0123456789abcdef]
mov byte [edx - 1], al
mov edi, esi
mov byte [edx - 2], bl
jmp 0x404694
mov eax, 0x225c
add edx, 2
mov edi, esi
mov word [edx - 2], ax
jmp 0x404694
test esi, esi
je 0x404d18
mov eax, esi
shr eax, 0x10
je 0x404ce2
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov dword [ebp - 0x364], str._invalid_
sub esp, 8
test eax, eax
jne 0x404932
cmp word [esi], 0
je 0x40487a
nop
add eax, 1
cmp word [esi + eax*2], 0
jne 0x404870
mov dword [ebp - 0x364], edi
mov edx, 0x224c
lea ecx, [ebp - 0x33e]
mov dword [ebp - 0x368], esi
mov dword [ebp - 0x36c], ebx
mov word [ebp - 0x340], dx
mov edx, esi
lea esi, [eax - 1]
test eax, eax
jle 0x4048ec
lea eax, [ebp - 0x21e]
cmp ecx, eax
ja 0x4048ec
add edx, 2
movzx eax, word [edx - 2]
cmp ax, 0xd
je 0x404c83
ja 0x404b54
cmp ax, 9
je 0x404ca0
cmp ax, 0xa
jne 0x404c23
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
mov eax, esi
jmp 0x4048a0
mov eax, esi
mov edi, dword [ebp - 0x364]
mov esi, dword [ebp - 0x368]
mov byte [ecx], 0x22
mov ebx, dword [ebp - 0x36c]
test eax, eax
jle 0x404d27
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
mov byte [eax], 0
lea eax, [ebp - 0x340]
mov dword [esp], eax
call dbg.__wine_dbg_strdup
mov dword [ebp - 0x364], eax
mov eax, dword [ebp - 0x350]
shr eax, 0x10
je 0x404cc6
mov eax, dword [ebp - 0x350]
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 0x404a36
mov eax, dword [ebp - 0x350]
cmp word [eax], 0
je 0x40498a
lea esi, [esi]
lea esi, [esi]
add edx, 1
cmp word [eax + edx*2], 0
jne 0x404980
mov eax, 0x224c
mov dword [ebp - 0x368], edi
lea ecx, [ebp - 0x33e]
mov word [ebp - 0x340], ax
mov eax, dword [ebp - 0x350]
mov dword [ebp - 0x36c], esi
mov esi, eax
lea eax, [ebp - 0x21e]
lea edi, [edx - 1]
cmp ecx, eax
ja 0x4049fc
test edx, edx
jle 0x4049fc
add esi, 2
movzx eax, word [esi - 2]
cmp ax, 0xd
je 0x404be0
ja 0x404b31
cmp ax, 9
je 0x404bf3
cmp ax, 0xa
jne 0x404b80
mov eax, 0x6e5c
add ecx, 2
mov edx, edi
mov word [ecx - 2], ax
jmp 0x4049b0
mov eax, edi
mov esi, dword [ebp - 0x36c]
mov edi, dword [ebp - 0x368]
mov byte [ecx], 0x22
test eax, eax
jle 0x404d2f
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
mov byte [eax], 0
lea eax, [ebp - 0x340]
mov dword [esp], eax
call dbg.__wine_dbg_strdup
mov ecx, dword [ebp - 0x364]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.__s__s__n
mov dword [esp + 0x14], ecx
mov dword [esp + 8], str.write_directory_entry
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.18
jmp 0x40456f
mov ebx, dword [ebp - 0x344]
mov byte [edx], 0x22
lea eax, [edx + 1]
test esi, esi
jle 0x404a90
mov esi, 0x2e2e
mov byte [edx + 3], 0x2e
lea eax, [edx + 4]
mov word [edx + 1], si
mov byte [eax], 0
lea eax, [ebp - 0x214]
mov dword [esp], eax
mov dword [ebp - 0x354], eax
call dbg.__wine_dbg_strdup
jmp 0x404734
mov byte [edx], al
mov edi, esi
add edx, 1
jmp 0x404694
mov dword [esp + 4], str._____Include__n
mov dword [esp], edi
call dbg.fprintf
mov eax, dword [ebp - 0x344]
call dbg.wchars_to_xml_text
mov dword [esp + 4], str._______Filename__s__Filename__n
mov dword [esp + 8], eax
mov dword [esp], edi
call dbg.fprintf
mov dword [esp + 4], str.______Include__n
mov dword [esp], edi
call dbg.fprintf
mov eax, dword [sym.imp.ucrtbase.dll_fclose]
mov dword [ebp - 0x358], eax
mov eax, dword [sym.imp.ucrtbase.dll_free]
mov dword [ebp - 0x34c], eax
jmp 0x4043e7
xor eax, eax
jmp 0x40442f
mov eax, str._null_
jmp 0x404734
cmp ax, 0x22
je 0x404cb3
cmp ax, 0x5c
jne 0x404b80
mov eax, 0x5c5c
add ecx, 2
mov edx, edi
mov word [ecx - 2], ax
jmp 0x4049b0
cmp ax, 0x22
je 0x404c10
cmp ax, 0x5c
jne 0x404c23
mov ebx, 0x5c5c
add ecx, 2
mov eax, esi
mov word [ecx - 2], bx
jmp 0x4048a0
lea edx, [eax - 0x20]
cmp dx, 0x5e
jbe 0x404d0c
mov edx, eax
mov byte [ecx], 0x5c
add ecx, 5
shr dx, 0xc
movzx edx, dx
movzx edx, byte [edx + str.0123456789abcdef]
mov byte [ecx - 4], dl
mov edx, eax
shr dx, 8
and edx, 0xf
movzx edx, byte [edx + str.0123456789abcdef]
mov byte [ecx - 3], dl
mov edx, eax
and eax, 0xf
shr dx, 4
movzx eax, byte [eax + str.0123456789abcdef]
and edx, 0xf
movzx edx, byte [edx + str.0123456789abcdef]
mov byte [ecx - 1], al
mov byte [ecx - 2], dl
mov edx, edi
jmp 0x4049b0
mov eax, 0x725c
add ecx, 2
mov edx, edi
mov word [ecx - 2], ax
jmp 0x4049b0
mov eax, 0x745c
add ecx, 2
mov edx, edi
mov word [ecx - 2], ax
jmp 0x4049b0
mov edi, 0x225c
add ecx, 2
mov eax, esi
mov word [ecx - 2], di
jmp 0x4048a0
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x404d00
mov edi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr di, 0xc
movzx edi, di
movzx ebx, byte [edi + str.0123456789abcdef]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [edi + str.0123456789abcdef]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + str.0123456789abcdef]
and edi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [edi + str.0123456789abcdef]
mov byte [ecx - 1], al
mov eax, esi
mov byte [ecx - 2], bl
jmp 0x4048a0
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
mov eax, esi
jmp 0x4048a0
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
mov eax, esi
jmp 0x4048a0
mov eax, 0x225c
add ecx, 2
mov edx, edi
mov word [ecx - 2], ax
jmp 0x4049b0
movzx eax, word [ebp - 0x350]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.16
jmp 0x404a36
movzx eax, si
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.16
mov dword [ebp - 0x364], eax
jmp 0x404932
mov byte [ecx], al
add ecx, 1
mov eax, esi
jmp 0x4048a0
mov byte [ecx], al
mov edx, edi
add ecx, 1
jmp 0x4049b0
mov dword [ebp - 0x364], str._null_
jmp 0x404932
lea eax, [ecx + 1]
jmp 0x40491b
lea eax, [ecx + 1]
jmp 0x404a25