Function at 0x407680
Capabilities:
Get common file path
Write file on windows

Disassembly:
push edi
mov ecx, 0x16
xor eax, eax
lea edi, [esp + 8]
and esp, 0xfffffff8
push dword [edi - 4]
push ebp
mov ebp, esp
push edi
lea edi, [ebp - 0x468]
push esi
push ebx
lea ebx, [ebp - 0x210]
sub esp, 0x4b4
rep stosd dword es:[edi], eax
lea esi, [esi]
movzx edx, word [eax + 0x41a690]
mov word [ebx + eax], dx
add eax, 2
test dx, dx
jne 0x4076b0
cmp word [ebp - 0x210], 0
mov eax, ebx
je 0x4076e0
nop
add eax, 2
cmp word [eax], 0
jne 0x4076d0
lea esi, [esi]
cmp ebx, eax
jae 0x407705
movzx edx, word [eax - 2]
sub eax, 2
cmp dx, 0x2e
je 0x4077da
cmp dx, 0x5c
je 0x4077d0
cmp dx, 0x2f
jne 0x4076e0
movzx edx, word [eax]
lea edi, [eax + 2]
cmp dx, 0x5c
je 0x4077c8
cmp dx, 0x2f
je 0x4077c8
lea esi, [ebp - 0x410]
xor edx, edx
lea esi, cs:[esi]
nop
movzx ecx, word [eax + edx]
mov word [esi + edx], cx
add edx, 2
test cx, cx
jne 0x407730
mov dword [esp + 4], ebx
mov dword [esp], 0x100
call dword [sym.imp.kernel32.dll_GetCurrentDirectoryW]
lea eax, [ebp - 0x468]
movq xmm0, qword [0x41a038]
sub esp, 8
mov dword [ebp - 0x44c], esi
mov dword [ebp - 0x468], 0x58
movq qword [ebp - 0x464], xmm0
mov dword [ebp - 0x45c], str..idl
mov dword [ebp - 0x448], 0x100
mov dword [ebp - 0x43c], ebx
mov dword [ebp - 0x434], 0x806
mov dword [ebp - 0x42c], 0x4106d4
mov dword [esp], eax
call dword [sym.imp.comdlg32.dll_GetSaveFileNameW]
sub esp, 4
test eax, eax
jne 0x407830
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
lea esp, [edi - 8]
pop edi
ret
mov eax, edi
jmp 0x40771f
cmp dx, 0x2e
jne 0x407705
xor edx, edx
mov word [eax], dx
cmp ebx, eax
jb 0x4077f4
jmp 0x40771f
cmp ebx, eax
jae 0x40781a
mov edi, eax
movzx edx, word [eax - 2]
sub eax, 2
cmp dx, 0x5c
mov word [ebp - 0x498], dx
setne cl
cmp dx, 0x2f
mov esi, ecx
setne cl
mov edx, esi
test dl, cl
jne 0x4077f0
movzx edx, word [ebp - 0x498]
jmp 0x40770b
mov dword [esp + 0xc], 0xffff0000
mov ebx, dword [sym.imp.user32.dll_SendMessageW]
mov dword [esp + 8], 4
mov dword [esp + 4], 0x110a
mov eax, dword [0x41a684]
mov dword [esp], eax
call ebx
lea edx, [ebp - 0x490]
mov ecx, 0xa
sub esp, 0x10
mov edi, edx
mov dword [ebp - 0x498], eax
xor eax, eax
rep stosd dword es:[edi], eax
mov eax, dword [ebp - 0x498]
mov dword [ebp - 0x48c], eax
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0
mov dword [esp + 4], 0x113e
mov eax, dword [0x41a684]
mov dword [esp], eax
call ebx
mov edi, dword [ebp - 0x46c]
sub esp, 0x10
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 2
mov dword [esp + 0xc], 0
mov dword [esp + 8], 2
mov dword [esp + 4], 0x40000000
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_CreateFileW]
sub esp, 0x1c
mov ebx, eax
cmp eax, 0xffffffff
je 0x4079ed
mov dword [esp + 0x1c], 0
mov ecx, dword [sym.imp.kernel32.dll_WideCharToMultiByte]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov eax, dword [edi + 0x204]
mov dword [esp + 0xc], eax
mov eax, dword [edi]
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
mov dword [esp + 8], eax
mov dword [ebp - 0x49c], ecx
call ecx
sub esp, 0x20
mov dword [ebp - 0x498], eax
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_malloc]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov esi, eax
mov eax, dword [ebp - 0x498]
mov dword [esp + 0x10], esi
mov dword [esp + 0x14], eax
mov eax, dword [edi + 0x204]
mov dword [esp + 0xc], eax
mov eax, dword [edi]
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
mov dword [esp + 8], eax
mov ecx, dword [ebp - 0x49c]
call ecx
lea eax, [ebp - 0x494]
sub esp, 0x20
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x498]
mov dword [esp + 4], esi
mov dword [esp], ebx
mov dword [esp + 8], eax
call dword [sym.imp.kernel32.dll_WriteFile]
sub esp, 0x14
test eax, eax
je 0x4079e6
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll_free]
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
lea esp, [edi - 8]
pop edi
ret
call fcn.004075c0
jmp 0x4079c5
call fcn.004075c0
jmp 0x4077b8