Function at 0x140002b70
Capabilities:
Check for peb beingdebugged flag
Check if file exists
Delete file
Get common file path
Get file attributes
Move file

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x398
mov qword [rsp + 0x3e0], rcx
mov r14, rdx
lea r13, [rsp + 0x180]
test byte [0x140010000], 8
jne 0x140002ff0
mov rcx, qword [0x140020210]
mov r9, r13
xor r8d, r8d
xor r15d, r15d
lea rdx, [0x140011350]
call qword [sym.imp.kernel32.dll_GetTempFileNameW]
mov rax, qword [sym.imp.ucrtbase.dll__wfopen]
lea rdx, [0x140011358]
mov rcx, r13
mov qword [rsp + 0x38], rax
call rax
mov r12, rax
test rax, rax
je 0x140002eb5
lea rdx, str.__DOCTYPE_Menu_PUBLIC_____freedesktop__DTD_Menu_1.0__EN__n
mov rcx, rax
call dbg.fprintf
lea rdx, str._http:__www.freedesktop.org_standards_menu_spec_menu_1.0.dtd___n
mov rcx, r12
call dbg.fprintf
lea rdx, str._Menu__n
mov rcx, r12
call dbg.fprintf
lea rdx, str.___Name_Applications__Name__n
mov rcx, r12
call dbg.fprintf
mov rdx, r14
lea rcx, str.wine_s.desktop
call dbg.heap_wprintf
mov rdi, rax
movzx eax, word [rax]
test ax, ax
je 0x1400034c8
mov rcx, qword [sym.imp.ucrtbase.dll_fclose]
lea rbx, [rdi + 2]
mov r15, rdi
xor esi, esi
mov qword [rsp + 0x40], r13
mov r14, qword [sym.imp.kernel32.dll_HeapFree]
mov qword [rsp + 0x30], rcx
jmp 0x140002c7b
mov rdx, rbx
movzx eax, word [rbx]
add rbx, 2
test ax, ax
je 0x140002d50
cmp ax, 0x5c
jne 0x140002c68
test esi, esi
je 0x140002ed0
xor r13d, r13d
lea rdx, str.___Menu__n
mov rcx, r12
mov word [rbx - 2], r13w
call dbg.fprintf
mov rcx, rdi
call dbg.wchars_to_xml_text
lea r8, [0x140011542]
lea rdx, str._____Name__s_s__Name__n
mov rcx, r12
mov r9, rax
call dbg.fprintf
mov rcx, rdi
call dbg.wchars_to_xml_text
lea r8, [0x140011542]
lea rdx, str._____Directory__s_s.directory__Directory__n
mov rcx, r12
mov r9, rax
call dbg.fprintf
lea r8, [0x14001131e]
mov rdx, qword [0x140020208]
lea rcx, str._sdesktop_directories_s_s.directory
mov r9, rdi
call dbg.heap_wprintf
mov rbp, rax
mov rcx, rax
call qword [sym.imp.kernel32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x140002f50
mov rax, qword gs:[0x30]
mov rax, qword [rax + 0x60]
xor edx, edx
mov r8, rbp
mov r15, rbx
add esi, 1
mov rcx, qword [rax + 0x30]
call r14
mov eax, 0x2d
mov rdx, rbx
add rbx, 2
mov word [rbx - 4], ax
movzx eax, word [rbx - 2]
test ax, ax
jne 0x140002c7b
xor r15d, r15d
mov rcx, r12
mov r13, qword [rsp + 0x40]
mov word [rdx], r15w
lea rdx, str._____Include__n
call dbg.fprintf
mov rcx, rdi
call dbg.wchars_to_xml_text
lea rdx, str._______Filename__s__Filename__n
mov rcx, r12
mov r8, rax
call dbg.fprintf
lea rdx, str.______Include__n
mov rcx, r12
call dbg.fprintf
test esi, esi
je 0x140002dba
xor ebp, ebp
lea rbx, str.____Menu__n
nop dword [rax]
mov rdx, rbx
mov rcx, r12
add ebp, 1
call dbg.fprintf
cmp esi, ebp
jne 0x140002da8
lea rdx, str.__Menu__n
mov rcx, r12
call dbg.fprintf
mov rdx, qword [0x140020210]
mov r8, rdi
lea rcx, str._s_s
call dbg.heap_wprintf
cmp word [rax], 0
mov rbx, rax
je 0x140003520
nop dword [rax]
add rax, 2
cmp word [rax], 0
jne 0x140002df0
sub rax, rbx
sar rax, 1
cdqe
lea r8, str..desktop
mov ecx, 0x64
mov rdx, r8
jmp 0x140002e1c
movzx ecx, word [rdx + 2]
add rdx, 2
test cx, cx
jne 0x140002e18
sub rdx, r8
mov ecx, 0x2e
sar rdx, 1
movsxd rdx, edx
sub rax, rdx
lea rdx, str..menu
lea rax, [rbx + rax*2]
jmp 0x140002e4b
movzx ecx, word [rdx]
add rax, 2
add rdx, 2
mov word [rax - 2], cx
test cx, cx
jne 0x140002e48
mov rcx, r12
mov rax, qword [rsp + 0x30]
call rax
mov r8d, 1
mov rdx, rbx
mov rcx, r13
call qword [sym.imp.kernel32.dll_MoveFileExW]
mov r15d, eax
test eax, eax
jne 0x140002f38
mov rcx, r13
call qword [sym.imp.kernel32.dll_DeleteFileW]
mov rsi, qword gs:[0x30]
mov rax, qword [rsi + 0x60]
mov r8, rdi
xor edx, edx
mov rcx, qword [rax + 0x30]
call r14
mov rax, qword [rsi + 0x60]
mov r8, rbx
xor edx, edx
mov rcx, qword [rax + 0x30]
call r14
mov eax, r15d
add rsp, 0x398
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
xor ebp, ebp
lea rdx, str.___Menu__n
mov rcx, r12
mov word [rbx - 2], bp
call dbg.fprintf
mov rcx, rdi
call dbg.wchars_to_xml_text
lea r8, str.wine_
lea rdx, str._____Name__s_s__Name__n
mov rcx, r12
mov r9, rax
call dbg.fprintf
mov rcx, rdi
call dbg.wchars_to_xml_text
lea r8, str.wine_
lea rdx, str._____Directory__s_s.directory__Directory__n
mov rcx, r12
mov r9, rax
call dbg.fprintf
lea r8, [0x140011320]
jmp 0x140002ce9
mov rdx, qword [rsp + 0x3e0]
mov rcx, rbx
call dbg.register_menus_entry
jmp 0x140002e8c
test byte [0x140010000], 8
jne 0x140003248
mov rax, qword [rsp + 0x38]
lea rdx, [0x140011358]
mov rcx, rbp
call rax
mov r13, rax
test rax, rax
je 0x140002d14
lea rdx, str._Desktop_Entry__n
mov rcx, rax
call dbg.fprintf
lea rdx, str.TypeDirectory_n
mov rcx, r13
call dbg.fprintf
lea rdx, [0x14001149e]
mov rcx, r15
call qword [sym.imp.ucrtbase.dll_wcscmp]
test eax, eax
je 0x140003158
mov rcx, r15
call dbg.wchars_to_utf8_chars
lea rdx, str.Name_s_n
mov rcx, r13
mov r8, rax
call dbg.fprintf
lea rdx, str.Iconfolder_n
mov rcx, r13
call dbg.fprintf
mov rax, qword [rsp + 0x30]
mov rcx, r13
call rax
jmp 0x140002d14
lea rax, str._null_
test rdx, rdx
je 0x140003128
mov rax, rdx
shr rax, 0x10
je 0x140003180
mov rdx, 0xffffffffffffffff
mov rcx, r14
call qword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov r8d, eax
lea rax, str._invalid_
test r8d, r8d
jne 0x140003128
movzx eax, word [r14]
test ax, ax
je 0x14000369c
xor edx, edx
nop
mov ecx, edx
add rdx, 1
cmp word [r14 + rdx*2], 0
jne 0x140003040
mov edx, 0x224c
mov r8, r14
lea r11, str.0123456789abcdefwrite_freedesktop_mime_type_entry
mov word [rsp + 0x180], dx
lea r10, [rsp + 0x2a2]
lea rdx, [rsp + 0x182]
jmp 0x1400030bc
cmp ax, 9
je 0x1400031b0
cmp ax, 0xa
jne 0x1400031d1
mov ebp, 0x6e5c
add rdx, 2
mov word [rdx - 2], bp
nop dword [rax]
lea r9d, [rcx - 1]
test ecx, ecx
jle 0x1400030f8
cmp rdx, r10
ja 0x1400030f8
movzx eax, word [r8]
mov ecx, r9d
add r8, 2
cmp ax, 0xd
je 0x140003198
jbe 0x140003080
cmp ax, 0x22
je 0x140003230
cmp ax, 0x5c
jne 0x1400031c2
mov r9d, 0x5c5c
add rdx, 2
mov word [rdx - 2], r9w
jmp 0x1400030a8
mov byte [rdx], 0x22
test r9d, r9d
jle 0x1400036b9
mov ecx, 0x2e2e
mov byte [rdx + 3], 0x2e
lea rax, [rdx + 4]
mov word [rdx + 1], cx
mov byte [rax], 0
lea r13, [rsp + 0x180]
mov rcx, r13
call dbg.__wine_dbg_strdup
mov qword [rsp + 0x20], rax
lea r9, str.__s__n
lea r8, global___func__.8
mov ecx, 3
lea rdx, [0x140010000]
call sym.wine_dbg_log.constprop.0
jmp 0x140002ba3
mov rcx, r13
lea rdx, str.NameWine_n
call dbg.fprintf
lea rdx, str.Iconwine_n
mov rcx, r13
call dbg.fprintf
jmp 0x140002fd9
movzx edx, dx
lea rcx, str._04x
call sym.wine_dbg_sprintf.constprop.0
jmp 0x140003128
mov edi, 0x725c
add rdx, 2
mov word [rdx - 2], di
jmp 0x1400030a8
mov esi, 0x745c
add rdx, 2
mov word [rdx - 2], si
jmp 0x1400030a8
lea r9d, [rax - 0x20]
cmp r9w, 0x5e
jbe 0x1400034b8
mov r9d, eax
mov byte [rdx], 0x5c
add rdx, 5
shr r9w, 0xc
and r9d, 0xf
movzx r9d, byte [r11 + r9]
mov byte [rdx - 4], r9b
mov r9d, eax
shr r9w, 8
and r9d, 0xf
movzx r9d, byte [r11 + r9]
mov byte [rdx - 3], r9b
mov r9d, eax
and eax, 0xf
shr r9w, 4
movzx eax, byte [r11 + rax]
and r9d, 0xf
movzx r9d, byte [r11 + r9]
mov byte [rdx - 1], al
mov byte [rdx - 2], r9b
jmp 0x1400030a8
mov ebx, 0x225c
add rdx, 2
mov word [rdx - 2], bx
jmp 0x1400030a8
lea r8, str._null_
test rbp, rbp
je 0x140003363
mov rax, rbp
shr rax, 0x10
je 0x1400036e1
mov rdx, 0xffffffffffffffff
mov rcx, rbp
call qword [sym.imp.kernel32.dll_IsBadStringPtrW]
lea r8, str._invalid_
test eax, eax
jne 0x140003363
cmp word [rbp], 0
je 0x14000370e
xor eax, eax
nop dword [rax]
mov ecx, eax
add rax, 1
cmp word [rbp + rax*2], 0
jne 0x140003298
mov r8d, 0x224c
lea rdx, [rsp + 0x52]
lea r9, [rsp + 0x172]
mov word [rsp + 0x50], r8w
mov r8, rbp
jmp 0x1400032fe
cmp ax, 9
je 0x140003548
cmp ax, 0xa
jne 0x14000356b
mov eax, 0x6e5c
add rdx, 2
mov word [rdx - 2], ax
nop dword [rax]
lea eax, [rcx - 1]
cmp rdx, r9
ja 0x140003337
test ecx, ecx
jle 0x140003337
mov ecx, eax
movzx eax, word [r8]
add r8, 2
cmp ax, 0xd
je 0x1400035e8
jbe 0x1400032c8
cmp ax, 0x22
je 0x1400035d0
cmp ax, 0x5c
jne 0x14000355c
mov r10d, 0x5c5c
add rdx, 2
mov word [rdx - 2], r10w
jmp 0x1400032f0
mov byte [rdx], 0x22
test eax, eax
jle 0x140003722
mov ecx, 0x2e2e
mov byte [rdx + 3], 0x2e
lea rax, [rdx + 4]
mov word [rdx + 1], cx
mov byte [rax], 0
lea rcx, [rsp + 0x50]
call dbg.__wine_dbg_strdup
mov r8, rax
mov rax, r15
shr rax, 0x10
je 0x1400036c2
mov qword [rsp + 0x48], r8
mov rdx, 0xffffffffffffffff
mov rcx, r15
call qword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov r8, qword [rsp + 0x48]
mov r9d, eax
lea rax, str._invalid_
test r9d, r9d
jne 0x140003484
cmp word [r15], 0
je 0x14000372b
xor eax, eax
nop word [rax + rax]
mov r10d, eax
add rax, 1
cmp word [r15 + rax*2], 0
jne 0x1400033b0
mov r11d, 0x224c
mov rcx, r15
lea rdx, [rsp + 0x52]
mov word [rsp + 0x50], r11w
lea r9, [rsp + 0x172]
jmp 0x140003419
cmp ax, 9
je 0x140003600
cmp ax, 0xa
jne 0x140003621
mov eax, 0x6e5c
add rdx, 2
mov word [rdx - 2], ax
nop dword [rax]
lea eax, [r10 - 1]
cmp rdx, r9
ja 0x140003451
test r10d, r10d
jle 0x140003451
mov r10d, eax
movzx eax, word [rcx]
add rcx, 2
cmp ax, 0xd
je 0x140003530
jbe 0x1400033e0
cmp ax, 0x22
je 0x140003688
cmp ax, 0x5c
jne 0x140003612
mov r11d, 0x5c5c
add rdx, 2
mov word [rdx - 2], r11w
jmp 0x140003408
mov byte [rdx], 0x22
test eax, eax
jle 0x140003741
mov ecx, 0x2e2e
mov byte [rdx + 3], 0x2e
lea rax, [rdx + 4]
mov word [rdx + 1], cx
mov byte [rax], 0
lea rcx, [rsp + 0x50]
mov qword [rsp + 0x48], r8
call dbg.__wine_dbg_strdup
mov r8, qword [rsp + 0x48]
mov qword [rsp + 0x28], r8
lea r9, str.__s__s__n
lea r8, str.write_directory_entry
mov ecx, 3
mov qword [rsp + 0x20], rax
lea rdx, [0x140010000]
call sym.wine_dbg_log.constprop.0
jmp 0x140002f5d
mov byte [rdx], al
add rdx, 1
jmp 0x1400030a8
lea rdx, str._____Include__n
mov rcx, r12
call dbg.fprintf
mov rcx, rdi
call dbg.wchars_to_xml_text
lea rdx, str._______Filename__s__Filename__n
mov rcx, r12
mov r8, rax
call dbg.fprintf
lea rdx, str.______Include__n
mov rcx, r12
call dbg.fprintf
mov rax, qword [sym.imp.ucrtbase.dll_fclose]
mov r14, qword [sym.imp.kernel32.dll_HeapFree]
mov qword [rsp + 0x30], rax
jmp 0x140002dba
xor eax, eax
jmp 0x140002e02
mov eax, 0x725c
add rdx, 2
mov word [rdx - 2], ax
jmp 0x140003408
mov r13d, 0x745c
add rdx, 2
mov word [rdx - 2], r13w
jmp 0x1400032f0
lea r10d, [rax - 0x20]
cmp r10w, 0x5e
jbe 0x1400036f8
mov r10d, eax
lea r11, str.0123456789abcdefwrite_freedesktop_mime_type_entry
mov byte [rdx], 0x5c
add rdx, 5
shr r10w, 0xc
and r10d, 0xf
movzx r10d, byte [r11 + r10]
mov byte [rdx - 4], r10b
mov r10d, eax
shr r10w, 8
and r10d, 0xf
movzx r10d, byte [r11 + r10]
mov byte [rdx - 3], r10b
mov r10d, eax
and eax, 0xf
shr r10w, 4
movzx eax, byte [r11 + rax]
and r10d, 0xf
movzx r10d, byte [r11 + r10]
mov byte [rdx - 1], al
mov byte [rdx - 2], r10b
jmp 0x1400032f0
mov r11d, 0x225c
add rdx, 2
mov word [rdx - 2], r11w
jmp 0x1400032f0
mov eax, 0x725c
add rdx, 2
mov word [rdx - 2], ax
jmp 0x1400032f0
mov eax, 0x745c
add rdx, 2
mov word [rdx - 2], ax
jmp 0x140003408
lea r11d, [rax - 0x20]
cmp r11w, 0x5e
jbe 0x140003703
mov r11d, eax
lea r13, str.0123456789abcdefwrite_freedesktop_mime_type_entry
mov byte [rdx], 0x5c
add rdx, 5
shr r11w, 0xc
and r11d, 0xf
movzx r11d, byte [r13 + r11]
mov byte [rdx - 4], r11b
mov r11d, eax
shr r11w, 8
and r11d, 0xf
movzx r11d, byte [r13 + r11]
mov byte [rdx - 3], r11b
mov r11d, eax
and eax, 0xf
shr r11w, 4
movzx eax, byte [r13 + rax]
and r11d, 0xf
movzx r11d, byte [r13 + r11]
mov byte [rdx - 1], al
mov byte [rdx - 2], r11b
jmp 0x140003408
mov r13d, 0x225c
add rdx, 2
mov word [rdx - 2], r13w
jmp 0x140003408
mov eax, 0x224c
mov byte [rsp + 0x182], 0x22
lea rdx, [rsp + 0x182]
mov word [rsp + 0x180], ax
lea rax, [rdx + 1]
jmp 0x140003115
movzx edx, r15w
lea rcx, str._04x
mov qword [rsp + 0x48], r8
call sym.wine_dbg_sprintf.constprop.0
mov r8, qword [rsp + 0x48]
jmp 0x140003484
movzx edx, bp
lea rcx, str._04x
call sym.wine_dbg_sprintf.constprop.0
mov r8, rax
jmp 0x140003363
mov byte [rdx], al
add rdx, 1
jmp 0x1400032f0
mov byte [rdx], al
add rdx, 1
jmp 0x140003408
mov ecx, 0x224c
mov byte [rsp + 0x52], 0x22
lea rdx, [rsp + 0x52]
mov word [rsp + 0x50], cx
lea rax, [rdx + 1]
jmp 0x140003353
mov r9d, 0x224c
mov byte [rsp + 0x52], 0x22
lea rdx, [rsp + 0x52]
mov word [rsp + 0x50], r9w
lea rax, [rdx + 1]
jmp 0x14000346d