Function at 0x407190
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 [0x40d014], 8
jne 0x407690
lea eax, [ebp - 0x220]
mov dword [esp + 8], 0
xor edi, edi
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x40ee1c
mov eax, dword [0x41722c]
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], 0x40ec02
mov dword [ebp - 0x240], eax
call eax
mov ebx, eax
test eax, eax
je 0x407535
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 0x407818
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 0x4072a9
movzx eax, word [esi]
lea ecx, [esi + 2]
test ax, ax
je 0x4073aa
mov esi, ecx
cmp ax, 0x5c
jne 0x407298
mov eax, dword [ebp - 0x230]
test eax, eax
je 0x407540
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], 0x40eff2
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], 0x40eff2
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, 0x40edf6
mov edi, dword [ebp - 0x22c]
mov dword [esp + 8], eax
mov dword [esp + 0xc], edi
mov eax, dword [0x417228]
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 0x4075c8
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 0x4072a7
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
jle 0x407417
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 0x407400
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 [0x41722c]
mov dword [esp], str._s_s
mov dword [esp + 4], eax
call dbg.heap_wprintf
cmp word [eax], 0
mov esi, eax
je 0x407878
lea esi, [esi]
add eax, 2
cmp word [eax], 0
jne 0x407458
sub eax, esi
sar eax, 1
mov edx, str..desktop
lea esi, [esi]
add edx, 2
cmp word [edx], 0
jne 0x407470
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 0x407490
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 0x4075b0
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, 0x40edf8
jmp 0x407324
mov edx, dword [ebp - 0x244]
mov eax, esi
call sym._register_menus_entry
jmp 0x4074e8
test byte [0x40d014], 8
jne 0x407750
mov dword [esp + 4], 0x40ec02
mov dword [esp], edi
mov eax, dword [ebp - 0x240]
call eax
test eax, eax
je 0x40735e
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 0x407700
mov eax, dword [ebp - 0x238]
mov dword [esp], eax
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 0x40735e
test edx, edx
je 0x40787f
mov eax, edx
shr eax, 0x10
je 0x407738
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 0x4076c9
mov eax, esi
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.__s__n
mov dword [esp + 8], global___FUNCTION__.7
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
jmp 0x4071b1
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 0x407679
mov dword [esp + 4], edx
mov dword [esp], str._04x
call sym._wine_dbg_sprintf.constprop.0_1
jmp 0x4076c9
test edi, edi
je 0x4078cb
mov eax, edi
shr eax, 0x10
je 0x4078aa
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 0x407789
mov eax, edi
call sym._wine_dbgstr_wn.part.0.constprop.0_1
mov edx, eax
mov eax, dword [ebp - 0x238]
test eax, eax
je 0x4078c1
shr eax, 0x10
mov dword [ebp - 0x248], edx
je 0x407889
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 0x4077e2
mov eax, dword [ebp - 0x238]
call sym._wine_dbgstr_wn.part.0.constprop.0_1
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], 0x40fd24
mov dword [esp + 4], global___dbch
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0_1
jmp 0x4075d5
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 0x407417
xor eax, eax
jmp 0x407465
mov eax, str._null_
jmp 0x4076c9
mov eax, dword [ebp - 0x238]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0_1
mov edx, dword [ebp - 0x248]
jmp 0x4077e2
mov dword [esp + 4], edi
mov dword [esp], str._04x
call sym._wine_dbg_sprintf.constprop.0_1
mov edx, eax
jmp 0x407789
mov eax, str._null_
jmp 0x4077e2
mov edx, str._null_
jmp 0x407789