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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
mov esi, edx
push ebx
mov ebx, eax
sub esp, 0x65c
mov dword [ebp - 0x62c], ecx
mov dword [esp + 4], edx
mov dword [esp], 2
call dword [sym.imp.msvcrt.dll_setlocale]
test eax, eax
je 0x4124f0
lea esi, [ebp - 0x620]
mov dword [esp], 0x104
mov dword [esp + 4], esi
call dword [sym.imp.kernel32.dll_GetTempPathA]
lea eax, [ebp - 0x51c]
sub esp, 8
mov dword [esp], esi
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0x45b3b9
call dword [sym.imp.kernel32.dll_GetTempFileNameA]
lea eax, [ebp - 0x51c]
sub esp, 0x10
mov dword [esp], eax
mov eax, dword [sym.imp.msvcrt.dll_fopen]
mov dword [esp + 4], 0x45b139
mov dword [ebp - 0x638], eax
call eax
mov dword [esp + 4], 0x37a
mov dword [esp], 0x45a2c0
mov esi, eax
call fcn.0044c860
xor eax, eax
test esi, esi
mov dword [esp + 4], str.cant_open_tempfile_n
setne al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp], ebx
call dword [sym.imp.msvcrt.dll_strlen]
mov dword [esp + 0xc], esi
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll_fwrite]
mov dword [esp + 4], 1
mov dword [esp], ebx
mov dword [ebp - 0x640], eax
call eax
mov eax, dword [sym.imp.msvcrt.dll_fclose]
mov dword [esp], esi
mov dword [ebp - 0x63c], eax
call eax
mov edx, dword [ebp - 0x62c]
test edx, edx
jne 0x412470
movzx eax, byte [ebx]
xor esi, esi
lea edi, [ebp - 0x418]
test al, al
je 0x4124dd
add esi, 1
mov word [edi + esi*2 - 2], ax
movzx eax, byte [ebx + esi]
test al, al
jne 0x412194
xor eax, eax
mov word [ebp + esi*2 - 0x418], ax
lea eax, [ebp - 0x51c]
mov dword [esp + 4], 0x45b14a
mov dword [esp], eax
mov eax, dword [ebp - 0x638]
call eax
mov dword [esp + 4], 0x38f
mov dword [esp], 0x45a2c0
mov edi, eax
mov dword [ebp - 0x630], eax
call fcn.0044c860
test edi, edi
mov dword [esp + 4], str.cant_open_tempfile_n
lea edi, [ebp - 0x418]
setne al
xor ebx, ebx
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
test esi, esi
jle 0x412277
mov dword [ebp - 0x634], esi
lea esi, [esi]
mov eax, dword [ebp - 0x630]
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll_fgetwc]
mov dword [esp + 4], 0x394
mov dword [esp], 0x45a2c0
mov esi, eax
call fcn.0044c860
movzx ecx, word [edi + ebx*2]
mov eax, dword [ebp - 0x62c]
mov dword [esp + 0x14], ebx
mov dword [esp + 4], str.got__04hx__expected__04hx__cp_d__d___n
mov edx, ecx
mov dword [esp + 0x10], eax
xor eax, eax
cmp dx, si
mov dword [esp + 0xc], ecx
movzx ecx, si
sete al
mov dword [esp + 8], ecx
add ebx, 1
mov dword [esp], eax
call fcn.0044cad0
cmp dword [ebp - 0x634], ebx
jne 0x412210
mov edi, dword [ebp - 0x630]
mov dword [esp], edi
call dword [sym.imp.msvcrt.dll_fgetwc]
mov dword [esp + 4], 0x397
mov dword [esp], 0x45a2c0
mov ebx, eax
call fcn.0044c860
mov eax, dword [ebp - 0x62c]
mov dword [esp + 4], str.got__04hx__expected_WEOF__cp_d__n
mov dword [esp + 0xc], eax
movzx eax, bx
mov dword [esp + 8], eax
xor eax, eax
cmp bx, 0xffff
sete al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp], edi
mov edi, dword [ebp - 0x63c]
call edi
lea eax, [ebp - 0x51c]
mov esi, dword [ebp - 0x638]
mov dword [esp + 4], 0x45b139
mov dword [esp], eax
call esi
mov dword [esp + 4], 0x39b
mov dword [esp], 0x45a2c0
mov ebx, eax
call fcn.0044c860
xor eax, eax
test ebx, ebx
mov dword [esp + 4], str.cant_open_tempfile_n
setne al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 0xc], ebx
mov eax, dword [ebp - 0x640]
mov dword [esp + 8], 6
mov dword [esp + 4], 1
mov dword [esp], 0x45d7e4
call eax
mov dword [esp], ebx
call edi
lea eax, [ebp - 0x51c]
mov dword [esp + 4], 0x45b429
mov edi, 0xfffffeff
mov dword [esp], eax
call esi
mov dword [esp + 4], 0x3a0
mov dword [esp], 0x45a2c0
mov esi, eax
call fcn.0044c860
xor eax, eax
test esi, esi
mov dword [esp + 4], str.cant_open_tempfile_n
setne al
xor ebx, ebx
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp], esi
call dword [sym.imp.msvcrt.dll_fgetwc]
mov dword [esp + 4], 0x3a4
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x630], eax
call fcn.0044c860
mov eax, dword [ebp - 0x62c]
movzx ecx, di
mov dword [esp + 0x14], ebx
mov dword [esp + 0xc], ecx
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x630]
mov dword [esp + 4], str.got__04hx__expected__04x__cp_d__d___n
cmp di, ax
movzx ecx, ax
sete al
mov dword [esp + 8], ecx
add ebx, 1
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
cmp ebx, 3
je 0x412400
movzx edi, word [ebx + ebx + 0x45d7e4]
jmp 0x412386
mov dword [esp], esi
call dword [sym.imp.msvcrt.dll_fgetwc]
mov dword [esp + 4], 0x3a7
mov dword [esp], 0x45a2c0
mov ebx, eax
call fcn.0044c860
mov eax, dword [ebp - 0x62c]
mov dword [esp + 4], str.got__04hx__expected_WEOF__cp_d__n
mov dword [esp + 0xc], eax
movzx eax, bx
mov dword [esp + 8], eax
xor eax, eax
cmp bx, 0xffff
sete al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp], esi
mov eax, dword [ebp - 0x63c]
call eax
lea eax, [ebp - 0x51c]
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__unlink]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp - 0x62c]
lea edi, [ebp - 0x418]
mov dword [esp + 8], ebx
mov dword [esp + 0x14], 0x200
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_MultiByteToWideChar]
sub esp, 0x18
mov esi, eax
mov dword [esp + 4], 0x383
mov dword [esp], 0x45a2c0
call fcn.0044c860
xor eax, eax
test esi, esi
mov dword [esp + 4], str.MultiByteToWideChar_failed_n
setg al
sub esi, 1
mov dword [esp], eax
call fcn.0044cad0
jmp 0x4121ae
mov esi, dword [ebp - 0x62c]
jmp 0x4121a4
mov dword [esp + 4], 0x372
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov dword [esp + 4], esi
mov dword [esp], str._s_locale_not_available_n
call fcn.0044cbe0
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret