Function at 0x403110
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 [section..data], 8
jne 0x403610
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 [0x41920c]
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 0x4034b5
mov dword [esp + 4], str.__DOCTYPE_Menu_PUBLIC_____freedesktop__DTD_Menu_1.0__EN__n
mov dword [esp], eax
call fcn.00401190
mov dword [esp + 4], str._http:__www.freedesktop.org_standards_menu_spec_menu_1.0.dtd___n
mov dword [esp], ebx
call fcn.00401190
mov dword [esp + 4], str._Menu__n
mov dword [esp], ebx
call fcn.00401190
mov dword [esp + 4], str.___Name_Applications__Name__n
mov dword [esp], ebx
call fcn.00401190
mov dword [esp + 4], esi
mov dword [esp], str.wine_s.desktop
call fcn.00401ae0
mov dword [ebp - 0x22c], eax
mov edi, eax
movzx eax, word [eax]
test ax, ax
je 0x403798
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 0x403229
movzx eax, word [esi]
lea ecx, [esi + 2]
test ax, ax
je 0x40332a
mov esi, ecx
cmp ax, 0x5c
jne 0x403218
mov eax, dword [ebp - 0x230]
test eax, eax
je 0x4034c0
xor edx, edx
mov word [esi - 2], dx
mov dword [esp + 4], str.___Menu__n
mov dword [esp], ebx
call fcn.00401190
mov edi, dword [ebp - 0x22c]
mov eax, edi
call fcn.00401d30
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 fcn.00401190
mov eax, edi
call fcn.00401d30
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 fcn.00401190
mov eax, 0x40d31a
mov edi, dword [ebp - 0x22c]
mov dword [esp + 8], eax
mov dword [esp + 0xc], edi
mov eax, dword [0x419208]
mov dword [esp], str._sdesktop_directories_s_s.directory
mov dword [esp + 4], eax
call fcn.00401ae0
mov dword [esp], eax
mov edi, eax
call dword [sym.imp.kernel32.dll_GetFileAttributesW]
sub esp, 4
cmp eax, 0xffffffff
je 0x403548
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 0x403227
xor ecx, ecx
mov edi, dword [ebp - 0x230]
mov word [esi], cx
mov dword [esp + 4], str._____Include__n
mov dword [esp], ebx
call fcn.00401190
mov eax, dword [ebp - 0x22c]
call fcn.00401d30
mov dword [esp + 4], str._______Filename__s__Filename__n
mov dword [esp + 8], eax
mov dword [esp], ebx
call fcn.00401190
mov dword [esp + 4], str.______Include__n
mov dword [esp], ebx
call fcn.00401190
test edi, edi
je 0x403397
xor esi, esi
lea esi, [esi]
mov dword [esp + 4], str.____Menu__n
add esi, 1
mov dword [esp], ebx
call fcn.00401190
cmp edi, esi
jne 0x403380
mov dword [esp + 4], str.__Menu__n
mov dword [esp], ebx
call fcn.00401190
mov eax, dword [ebp - 0x22c]
mov dword [esp + 8], eax
mov eax, dword [0x41920c]
mov dword [esp], str._s_s
mov dword [esp + 4], eax
call fcn.00401ae0
cmp word [eax], 0
mov esi, eax
je 0x4037f8
lea esi, [esi]
add eax, 2
cmp word [eax], 0
jne 0x4033d8
sub eax, esi
sar eax, 1
mov edx, str..desktop
lea esi, [esi]
add edx, 2
cmp word [edx], 0
jne 0x4033f0
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 0x403410
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 0x403530
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 fcn.00401190
mov edi, dword [ebp - 0x22c]
mov eax, edi
call fcn.00401d30
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 fcn.00401190
mov eax, edi
call fcn.00401d30
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 fcn.00401190
mov eax, 0x40d30e
jmp 0x4032a4
mov edx, dword [ebp - 0x244]
mov eax, esi
call fcn.00401a20
jmp 0x403468
test byte [section..data], 8
jne 0x4036d0
mov dword [esp + 4], 0x40d33c
mov dword [esp], edi
mov eax, dword [ebp - 0x240]
call eax
test eax, eax
je 0x4032de
mov dword [esp + 4], str._Desktop_Entry__n
mov dword [ebp - 0x248], eax
mov dword [esp], eax
call fcn.00401190
mov dword [esp + 4], str.TypeDirectory_n
mov eax, dword [ebp - 0x248]
mov dword [esp], eax
call fcn.00401190
mov dword [esp + 4], 0x40d47e
mov ecx, dword [ebp - 0x238]
mov dword [esp], ecx
call dword [sym.imp.ucrtbase.dll_wcscmp]
test eax, eax
je 0x403680
mov eax, dword [ebp - 0x238]
call fcn.00401690
mov dword [esp + 4], str.Name_s_n
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x248]
mov dword [esp], eax
call fcn.00401190
mov dword [esp + 4], str.Iconfolder_n
mov eax, dword [ebp - 0x248]
mov dword [esp], eax
call fcn.00401190
mov eax, dword [ebp - 0x248]
mov dword [esp], eax
mov eax, dword [ebp - 0x23c]
call eax
jmp 0x4032de
test edx, edx
je 0x4037ff
mov eax, edx
shr eax, 0x10
je 0x4036b8
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 0x403649
mov eax, esi
call fcn.00401250
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.__s__n
mov dword [esp + 8], str.write_menu_file
mov dword [esp + 4], 0x40c000
mov dword [esp], 3
call fcn.00401540
jmp 0x403131
mov dword [esp + 4], str.NameWine_n
mov eax, dword [ebp - 0x248]
mov dword [esp], eax
call fcn.00401190
mov dword [esp + 4], str.Iconwine_n
mov eax, dword [ebp - 0x248]
mov dword [esp], eax
call fcn.00401190
jmp 0x4035f6
movzx eax, dx
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.00401430
jmp 0x403649
test edi, edi
je 0x40384f
mov eax, edi
shr eax, 0x10
je 0x40382b
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 0x403709
mov eax, edi
call fcn.00401250
mov edx, eax
mov eax, dword [ebp - 0x238]
test eax, eax
je 0x403845
shr eax, 0x10
mov dword [ebp - 0x248], edx
je 0x403809
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 0x403762
mov eax, dword [ebp - 0x238]
call fcn.00401250
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], 0x40c000
mov dword [esp], 3
call fcn.00401540
jmp 0x403555
mov dword [esp + 4], str._____Include__n
mov dword [esp], ebx
call fcn.00401190
mov eax, dword [ebp - 0x22c]
call fcn.00401d30
mov dword [esp + 4], str._______Filename__s__Filename__n
mov dword [esp + 8], eax
mov dword [esp], ebx
call fcn.00401190
mov dword [esp + 4], str.______Include__n
mov dword [esp], ebx
call fcn.00401190
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 0x403397
xor eax, eax
jmp 0x4033e5
mov eax, str._null_
jmp 0x403649
movzx eax, word [ebp - 0x238]
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.00401430
mov edx, dword [ebp - 0x248]
jmp 0x403762
movzx eax, di
mov dword [esp], str._04x
mov dword [esp + 4], eax
call fcn.00401430
mov edx, eax
jmp 0x403709
mov eax, str._null_
jmp 0x403762
mov edx, str._null_
jmp 0x403709