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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, ecx
mov dword [ebp - 0xc], edx
mov ecx, 0xfeff
mov dword [ebp - 0x14], eax
push ebx
mov word [ebp - 4], cx
mov ecx, dword [ebp + 0xc]
push esi
xor esi, esi
push edi
mov dword [ecx], esi
mov ebx, esi
mov ecx, dword [ebp + 0x10]
mov edi, esi
test ecx, ecx
je 0x40d46e
mov dword [ecx], esi
test eax, eax
je 0x40d4a5
push esi
push esi
push esi
push esi
push 0xffffffffffffffff
push eax
push esi
push esi
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov ebx, eax
test ebx, ebx
jne 0x40d4a5
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x40d69e
movzx esi, si
or esi, 0x80070000
jmp 0x40d69e
push esi
push esi
call dword [sym.imp.KERNEL32.dll_GetTempPath2A]
test eax, eax
je 0x40d487
inc eax
push eax
mov dword [ebp - 8], eax
call fcn.004195a6
mov dword [ebp - 0x10], eax
pop ecx
test eax, eax
jne 0x40d4cd
mov esi, 0x8007000e
jmp 0x40d69e
push eax
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_GetTempPath2A]
test eax, eax
jne 0x40d4f9
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x40d68a
movzx esi, si
or esi, 0x80070000
jmp 0x40d68a
add eax, 0xf
add eax, ebx
push eax
mov dword [ebp - 0x18], eax
call fcn.004195a6
mov ebx, eax
mov dword [ebp - 8], ebx
pop ecx
test ebx, ebx
jne 0x40d51b
mov esi, 0x8007000e
jmp 0x40d68a
push ebx
push esi
push 0x4027cc
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
test eax, eax
jne 0x40d54d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x40d681
movzx esi, si
or esi, 0x80070000
jmp 0x40d681
mov edx, dword [ebp - 0x14]
test edx, edx
je 0x40d581
mov ecx, ebx
lea eax, [ecx + 1]
mov dword [ebp - 0x14], eax
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40d55c
sub ecx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x18]
push esi
push esi
sub eax, ecx
push eax
lea eax, [ecx + ebx]
push eax
push 0xffffffffffffffff
push edx
push esi
push esi
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
je 0x40d52f
push esi
push 0x4002100
push 2
push esi
push esi
push 0xc0000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x40d5a2
mov edi, esi
jmp 0x40d52f
test edi, edi
je 0x40d52f
cmp dword [ebp + 8], esi
jle 0x40d5fd
mov eax, dword [ebp - 0xc]
mov ax, word [eax]
cmp ax, word [ebp - 4]
je 0x40d5d1
push esi
lea eax, [ebp - 0x1c]
push eax
push 2
lea eax, [ebp - 4]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40d52f
push esi
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [ebp + 8]
add eax, eax
push eax
push dword [ebp - 0xc]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40d52f
push edi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
je 0x40d52f
cmp dword [ebp + 0x10], esi
je 0x40d67a
lea ecx, [ebx + 1]
mov al, byte [ebx]
inc ebx
test al, al
jne 0x40d605
push esi
push esi
sub ebx, ecx
push ebx
push dword [ebp - 8]
push esi
push esi
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov dword [ebp - 0x18], eax
test eax, eax
je 0x40d52f
push eax
push esi
call dword [sym.imp.OLEAUT32.dll_SysReAllocStringLen]
mov dword [ebp - 0xc], eax
test eax, eax
jne 0x40d63d
mov esi, 0x8007000e
jmp 0x40d681
push dword [ebp - 0x18]
push eax
push ebx
push dword [ebp - 8]
push esi
push esi
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
jne 0x40d672
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x40d666
movzx esi, si
or esi, 0x80070000
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
jmp 0x40d681
mov ecx, dword [ebp + 0x10]
mov eax, dword [ebp - 0xc]
mov dword [ecx], eax
mov eax, dword [ebp + 0xc]
mov dword [eax], edi
mov edi, esi
push dword [ebp - 8]
call fcn.004195d5
pop ecx
push dword [ebp - 0x10]
call fcn.004195d5
pop ecx
test edi, edi
je 0x40d69e
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
mov eax, esi
pop esi
pop ebx
leave
ret 0xc