Function at 0x402f50
Capabilities:
Check for peb beingdebugged flag
Check if file exists
Delete file
Get common file path
Get file attributes
Get process heap flags
Move file

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
mov esi, edx
push ebx
sub esp, 0x25c
mov dword [ebp - 0x244], eax
test byte [0x40c000], 8
jne 0x403450
lea eax, [ebp - 0x220]
mov dword [esp + 8], 0
xor edi, edi
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x40d334
mov eax, dword [0x41720c]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetTempFileNameW]
lea eax, [ebp - 0x220]
sub esp, 0x10
mov dword [esp], eax
mov eax, dword [sym.imp.ucrtbase.dll__wfopen]
mov dword [esp + 4], 0x40d33c
mov dword [ebp - 0x240], eax
call eax
mov ebx, eax
test eax, eax
je 0x4032f5
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], ebx
call dbg.fprintf
mov dword [esp + 4], str._Menu__n
mov dword [esp], ebx
call dbg.fprintf
mov dword [esp + 4], str.___Name_Applications__Name__n
mov dword [esp], ebx
call dbg.fprintf
mov dword [esp + 4], esi
mov dword [esp], str.wine_s.desktop
call dbg.heap_wprintf
mov dword [ebp - 0x22c], eax
mov edi, eax
movzx eax, word [eax]
test ax, ax
je 0x4035d8
mov ecx, dword [sym.imp.ucrtbase.dll_fclose]
mov dword [ebp - 0x238], edi
lea esi, [edi + 2]
xor edi, edi
mov dword [ebp - 0x230], edi
mov dword [ebp - 0x23c], ecx
mov ecx, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [ebp - 0x234], ecx
jmp 0x403069
movzx eax, word [esi]
lea ecx, [esi + 2]
test ax, ax
je 0x40316a
mov esi, ecx
cmp ax, 0x5c
jne 0x403058
mov eax, dword [ebp - 0x230]
test eax, eax
je 0x403300
xor edx, edx
mov word [esi - 2], dx
mov dword [esp + 4], str.___Menu__n
mov dword [esp], ebx
call dbg.fprintf
mov edi, dword [ebp - 0x22c]
mov eax, edi
call dbg.wchars_to_xml_text
mov dword [esp + 8], 0x40d52a
mov dword [esp + 0xc], eax
mov dword [esp + 4], str._____Name__s_s__Name__n
mov dword [esp], ebx
call dbg.fprintf
mov eax, edi
call dbg.wchars_to_xml_text
mov dword [esp + 8], 0x40d52a
mov dword [esp + 0xc], eax
mov dword [esp + 4], str._____Directory__s_s.directory__Directory__n
mov dword [esp], ebx
call dbg.fprintf
mov eax, 0x40d31a
mov edi, dword [ebp - 0x22c]
mov dword [esp + 8], eax
mov dword [esp + 0xc], edi
mov eax, dword [0x417208]
mov dword [esp], str._sdesktop_directories_s_s.directory
mov dword [esp + 4], eax
call dbg.heap_wprintf
mov dword [esp], eax
mov edi, eax
call dword [sym.imp.kernel32.dll_GetFileAttributesW]
sub esp, 4
cmp eax, 0xffffffff
je 0x403388
mov dword [esp + 8], edi
mov edi, 0x2d
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 - 0x234]
call eax
lea ecx, [esi + 2]
mov word [esi - 2], di
movzx eax, word [ecx - 2]
add dword [ebp - 0x230], 1
sub esp, 0xc
mov dword [ebp - 0x238], esi
test ax, ax
jne 0x403067
xor ecx, ecx
mov edi, dword [ebp - 0x230]
mov word [esi], cx
mov dword [esp + 4], str._____Include__n
mov dword [esp], ebx
call dbg.fprintf
mov eax, dword [ebp - 0x22c]
call dbg.wchars_to_xml_text
mov dword [esp + 4], str._______Filename__s__Filename__n
mov dword [esp + 8], eax
mov dword [esp], ebx
call dbg.fprintf
mov dword [esp + 4], str.______Include__n
mov dword [esp], ebx
call dbg.fprintf
test edi, edi
je 0x4031d7
xor esi, esi
lea esi, [esi]
mov dword [esp + 4], str.____Menu__n
add esi, 1
mov dword [esp], ebx
call dbg.fprintf
cmp edi, esi
jne 0x4031c0
mov dword [esp + 4], str.__Menu__n
mov dword [esp], ebx
call dbg.fprintf
mov eax, dword [ebp - 0x22c]
mov dword [esp + 8], eax
mov eax, dword [0x41720c]
mov dword [esp], str._s_s
mov dword [esp + 4], eax
call dbg.heap_wprintf
cmp word [eax], 0
mov esi, eax
je 0x403638
lea esi, [esi]
add eax, 2
cmp word [eax], 0
jne 0x403218
sub eax, esi
sar eax, 1
mov edx, str..desktop
lea esi, [esi]
add edx, 2
cmp word [edx], 0
jne 0x403230
sub edx, str..desktop
sar edx, 1
sub eax, edx
lea ecx, [esi + eax*2]
xor eax, eax
lea esi, [esi]
nop
movzx edx, word [eax + str..menu]
mov word [ecx + eax], dx
add eax, 2
test dx, dx
jne 0x403250
mov dword [esp], ebx
mov eax, dword [ebp - 0x23c]
call eax
lea eax, [ebp - 0x220]
mov dword [esp + 8], 1
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_MoveFileExW]
sub esp, 0xc
mov edi, eax
test eax, eax
jne 0x403370
lea eax, [ebp - 0x220]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_DeleteFileW]
sub esp, 4
mov eax, dword [ebp - 0x22c]
mov dword [esp + 4], 0
mov ebx, dword fs:[0x18]
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x234]
call eax
sub esp, 0xc
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x234]
call eax
sub esp, 0xc
lea esp, [ebp - 0xc]
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
xor eax, eax
mov word [esi - 2], ax
mov dword [esp + 4], str.___Menu__n
mov dword [esp], ebx
call dbg.fprintf
mov edi, dword [ebp - 0x22c]
mov eax, edi
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], ebx
call dbg.fprintf
mov eax, edi
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], ebx
call dbg.fprintf
mov eax, 0x40d30e
jmp 0x4030e4
mov edx, dword [ebp - 0x244]
mov eax, esi
call sym._register_menus_entry
jmp 0x4032a8
test byte [0x40c000], 8
jne 0x403510
mov dword [esp + 4], 0x40d33c
mov dword [esp], edi
mov eax, dword [ebp - 0x240]
call eax
test eax, eax
je 0x40311e
mov dword [esp + 4], str._Desktop_Entry__n
mov dword [ebp - 0x248], eax
mov dword [esp], eax
call dbg.fprintf
mov dword [esp + 4], str.TypeDirectory_n
mov eax, dword [ebp - 0x248]
mov dword [esp], eax
call dbg.fprintf
mov dword [esp + 4], str.wine
mov ecx, dword [ebp - 0x238]
mov dword [esp], ecx
call dword [sym.imp.ucrtbase.dll_wcscmp]
test eax, eax
je 0x4034c0
mov eax, dword [ebp - 0x238]
call dbg.wchars_to_utf8_chars
mov dword [esp + 4], str.Name_s_n
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x248]
mov dword [esp], eax
call dbg.fprintf
mov dword [esp + 4], str.Iconfolder_n
mov eax, dword [ebp - 0x248]
mov dword [esp], eax
call dbg.fprintf
mov eax, dword [ebp - 0x248]
mov dword [esp], eax
mov eax, dword [ebp - 0x23c]
call eax
jmp 0x40311e
test edx, edx
je 0x40363f
mov eax, edx
shr eax, 0x10
je 0x4034f8
mov dword [esp], edx
mov dword [esp + 4], 0xffffffff
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x403489
mov eax, esi
call sym._wine_dbgstr_wn.part.0.constprop.0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.__s__n
mov dword [esp + 8], global___func__.7
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x402f71
mov dword [esp + 4], str.NameWine_n
mov eax, dword [ebp - 0x248]
mov dword [esp], eax
call dbg.fprintf
mov dword [esp + 4], str.Iconwine_n
mov eax, dword [ebp - 0x248]
mov dword [esp], eax
call dbg.fprintf
jmp 0x403436
movzx eax, dx
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
jmp 0x403489
test edi, edi
je 0x40368f
mov eax, edi
shr eax, 0x10
je 0x40366b
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, str._invalid_
sub esp, 8
test eax, eax
jne 0x403549
mov eax, edi
call sym._wine_dbgstr_wn.part.0.constprop.0
mov edx, eax
mov eax, dword [ebp - 0x238]
test eax, eax
je 0x403685
shr eax, 0x10
mov dword [ebp - 0x248], edx
je 0x403649
mov dword [esp + 4], 0xffffffff
mov eax, dword [ebp - 0x238]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, dword [ebp - 0x248]
mov ecx, eax
sub esp, 8
mov eax, str._invalid_
test ecx, ecx
jne 0x4035a2
mov eax, dword [ebp - 0x238]
call sym._wine_dbgstr_wn.part.0.constprop.0
mov edx, dword [ebp - 0x248]
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.__s__s__n
mov dword [esp + 8], str.write_directory_entry
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x403395
mov dword [esp + 4], str._____Include__n
mov dword [esp], ebx
call dbg.fprintf
mov eax, dword [ebp - 0x22c]
call dbg.wchars_to_xml_text
mov dword [esp + 4], str._______Filename__s__Filename__n
mov dword [esp + 8], eax
mov dword [esp], ebx
call dbg.fprintf
mov dword [esp + 4], str.______Include__n
mov dword [esp], ebx
call dbg.fprintf
mov eax, dword [sym.imp.ucrtbase.dll_fclose]
mov dword [ebp - 0x23c], eax
mov eax, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [ebp - 0x234], eax
jmp 0x4031d7
xor eax, eax
jmp 0x403225
mov eax, str._null_
jmp 0x403489
movzx eax, word [ebp - 0x238]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
mov edx, dword [ebp - 0x248]
jmp 0x4035a2
movzx eax, di
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
mov edx, eax
jmp 0x403549
mov eax, str._null_
jmp 0x4035a2
mov edx, str._null_
jmp 0x403549