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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
lea eax, [ebp - 0x420]
push ebx
sub esp, 0x45c
mov dword [esp + 4], eax
mov dword [esp], 0x104
call dword [sym.imp.kernel32.dll_GetTempPathA]
lea eax, [ebp - 0x31c]
sub esp, 8
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x420]
mov dword [esp + 8], 0
mov dword [esp + 4], 0x45b3b9
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetTempFileNameA]
mov eax, dword [0x46d7ac]
sub esp, 0x10
test eax, eax
je 0x413160
lea eax, [ebp - 0x31c]
mov esi, dword [sym.imp.msvcrt.dll_fopen]
mov dword [esp + 4], 0x45b139
mov dword [esp], eax
call esi
mov dword [esp + 4], 0x3bf
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 eax, dword [sym.imp.msvcrt.dll_fwrite]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 6
mov dword [esp + 4], 1
mov dword [esp], 0x45d7dc
mov dword [ebp - 0x438], eax
call eax
mov eax, dword [sym.imp.msvcrt.dll_fclose]
mov dword [esp], ebx
mov dword [ebp - 0x430], eax
call eax
lea ecx, [ebp - 0x31c]
mov dword [esp + 4], str.rt_ccsunicode
mov dword [esp], ecx
mov dword [ebp - 0x434], esi
call esi
mov dword [esp + 4], 0x3c4
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 edi, dword [sym.imp.msvcrt.dll_fgetwc]
mov dword [esp], ebx
call edi
mov dword [esp + 4], 0x3c8
mov dword [esp], 0x45a2c0
mov esi, eax
call fcn.0044c860
movzx eax, si
mov dword [esp + 0x10], 0
mov dword [esp + 8], eax
xor eax, eax
cmp si, 0xff1f
sete al
mov dword [esp + 0xc], 0xff1f
mov dword [esp], eax
mov dword [esp + 4], str.got__04hx__expected__04x__unicode__d___n
call fcn.0044cad0
mov dword [esp], ebx
call edi
mov dword [esp + 4], 0x3c8
mov dword [esp], 0x45a2c0
mov esi, eax
call fcn.0044c860
movzx eax, si
mov dword [esp + 0x10], 1
mov dword [esp + 8], eax
xor eax, eax
cmp si, 0x21
sete al
mov dword [esp + 0xc], 0x21
mov dword [esp], eax
mov dword [esp + 4], str.got__04hx__expected__04x__unicode__d___n
call fcn.0044cad0
mov dword [esp], ebx
call edi
mov dword [esp + 4], 0x3cc
mov dword [esp], 0x45a2c0
mov esi, eax
call fcn.0044c860
movzx eax, si
mov dword [esp + 4], str.got__04hx__expected_WEOF__unicode__n
mov dword [esp + 8], eax
xor eax, eax
cmp si, 0xffff
sete al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp], ebx
lea ebx, [ebp - 0x31c]
mov eax, dword [ebp - 0x430]
call eax
mov dword [esp], ebx
mov esi, dword [ebp - 0x434]
mov dword [esp + 4], str.r_ccsutf_8
call esi
mov dword [esp + 4], 0x3d0
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], ebx
call edi
mov dword [esp + 4], 0x3d4
mov dword [esp], 0x45a2c0
mov esi, eax
call fcn.0044c860
movzx eax, si
mov dword [esp + 0x10], 0
mov dword [esp + 8], eax
xor eax, eax
cmp si, 0xff1f
sete al
mov dword [esp + 0xc], 0xff1f
mov dword [esp], eax
mov dword [esp + 4], str.got__04hx__expected__04x__unicode__d___n
call fcn.0044cad0
mov dword [esp], ebx
call edi
mov dword [esp + 4], 0x3d4
mov dword [esp], 0x45a2c0
mov esi, eax
call fcn.0044c860
movzx eax, si
mov dword [esp + 0x10], 1
mov dword [esp + 8], eax
xor eax, eax
cmp si, 0x21
sete al
mov dword [esp + 0xc], 0x21
mov dword [esp], eax
mov dword [esp + 4], str.got__04hx__expected__04x__unicode__d___n
call fcn.0044cad0
mov dword [esp], ebx
call edi
mov dword [esp + 4], 0x3d8
mov dword [esp], 0x45a2c0
mov esi, eax
call fcn.0044c860
movzx eax, si
mov dword [esp + 4], str.got__04hx__expected_WEOF__unicode__n
mov dword [esp + 8], eax
xor eax, eax
cmp si, 0xffff
sete al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp], ebx
lea ebx, [ebp - 0x31c]
mov eax, dword [ebp - 0x430]
call eax
mov dword [esp], ebx
mov esi, dword [ebp - 0x434]
mov dword [esp + 4], str.a_ccsutf_16le
call esi
mov dword [esp + 4], 0x3dc
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 + 4], ebx
mov dword [esp], 0x61
call dword [sym.imp.msvcrt.dll_fputwc]
mov dword [esp + 4], 0x3de
mov dword [esp], 0x45a2c0
mov esi, eax
call fcn.0044c860
movzx eax, si
mov dword [esp + 4], str.fputwc_returned__x_n
mov dword [esp + 8], eax
xor eax, eax
cmp si, 0x61
sete al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp], ebx
lea ebx, [ebp - 0x31c]
mov eax, dword [ebp - 0x430]
call eax
mov dword [esp], ebx
mov esi, dword [ebp - 0x434]
mov dword [esp + 4], str.a_ccsutf_8
call esi
mov dword [esp + 4], 0x3e2
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], ebx
call edi
mov dword [esp + 4], 0x3e6
mov dword [esp], 0x45a2c0
mov esi, eax
call fcn.0044c860
movzx eax, si
mov dword [esp + 0x10], 0
mov dword [esp + 8], eax
xor eax, eax
cmp si, 0xff1f
sete al
mov dword [esp + 0xc], 0xff1f
mov dword [esp], eax
mov dword [esp + 4], str.got__04hx__expected__04x__unicode__d___n
call fcn.0044cad0
mov dword [esp], ebx
call edi
mov dword [esp + 4], 0x3e6
mov dword [esp], 0x45a2c0
mov esi, eax
call fcn.0044c860
movzx eax, si
mov dword [esp + 0x10], 1
mov dword [esp + 8], eax
xor eax, eax
cmp si, 0x21
sete al
mov dword [esp + 0xc], 0x21
mov dword [esp], eax
mov dword [esp + 4], str.got__04hx__expected__04x__unicode__d___n
call fcn.0044cad0
mov dword [esp], ebx
call edi
mov dword [esp + 4], 0x3ea
mov dword [esp], 0x45a2c0
mov esi, eax
call fcn.0044c860
movzx eax, si
mov dword [esp + 4], str.got__04x__expected_a_n
mov dword [esp + 8], eax
xor eax, eax
cmp si, 0x61
sete al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp], ebx
mov dword [ebp - 0x42c], edi
call edi
mov dword [esp + 4], 0x3ec
mov dword [esp], 0x45a2c0
mov esi, eax
call fcn.0044c860
movzx eax, si
mov dword [esp + 4], str.got__04hx__expected_WEOF__unicode__n
mov dword [esp + 8], eax
xor eax, eax
cmp si, 0xffff
sete al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp], ebx
lea ebx, [ebp - 0x31c]
mov eax, dword [ebp - 0x430]
call eax
mov dword [esp], ebx
mov esi, dword [ebp - 0x434]
mov dword [esp + 4], 0x45b139
call esi
mov dword [esp + 4], 0x3f0
lea esi, [ebp - 0x218]
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 edx, dword [sym.imp.kernel32.dll_WideCharToMultiByte]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [ebp - 0x43c], edx
mov dword [esp + 0x14], 0x200
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], 3
mov dword [esp + 8], 0x45d7dc
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
call edx
sub esp, 0x20
mov edi, eax
mov dword [esp + 4], 0x3f3
mov dword [esp], 0x45a2c0
call fcn.0044c860
xor eax, eax
test edi, edi
mov dword [esp + 4], str.utf_8_conversion_failed_n
setg al
mov dword [esp], eax
call fcn.0044cad0
mov edx, dword [ebp - 0x438]
mov dword [esp], esi
mov dword [esp + 0xc], ebx
mov dword [esp + 8], edi
mov dword [esp + 4], 1
call edx
mov dword [esp], ebx
lea ebx, [ebp - 0x31c]
mov eax, dword [ebp - 0x430]
call eax
mov dword [esp], ebx
mov eax, dword [ebp - 0x434]
mov dword [esp + 4], str.rt__ccsUTF_8
call eax
mov dword [esp + 4], 0x3f8
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], ebx
mov edi, dword [ebp - 0x42c]
call edi
mov dword [esp + 4], 0x3fc
mov dword [esp], 0x45a2c0
mov edi, eax
call fcn.0044c860
movzx eax, di
mov dword [esp + 0x10], 0
mov dword [esp + 8], eax
xor eax, eax
cmp di, 0xff1f
sete al
mov dword [esp + 0xc], 0xff1f
mov dword [esp], eax
mov dword [esp + 4], str.got__04hx__expected__04x__utf8__d___n
call fcn.0044cad0
mov dword [esp], ebx
mov edi, dword [ebp - 0x42c]
call edi
mov dword [esp + 4], 0x3fc
mov dword [esp], 0x45a2c0
mov edi, eax
call fcn.0044c860
movzx eax, di
mov dword [esp + 0x10], 1
mov dword [esp + 8], eax
xor eax, eax
cmp di, 0x21
sete al
mov dword [esp + 0xc], 0x21
mov dword [esp], eax
mov dword [esp + 4], str.got__04hx__expected__04x__utf8__d___n
call fcn.0044cad0
mov dword [esp], ebx
mov edi, dword [ebp - 0x42c]
call edi
mov dword [esp + 4], 0x400
mov dword [esp], 0x45a2c0
mov edi, eax
call fcn.0044c860
movzx eax, di
mov dword [esp + 4], str.got__04hx__expected_WEOF__utf8__n
mov dword [esp + 8], eax
xor eax, eax
cmp di, 0xffff
sete al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp], ebx
lea ebx, [ebp - 0x31c]
mov ecx, dword [ebp - 0x430]
call ecx
mov edi, dword [ebp - 0x434]
mov dword [esp], ebx
mov dword [esp + 4], 0x45b139
call edi
mov dword [esp + 4], 0x404
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 edx, dword [ebp - 0x438]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 5
mov dword [esp + 4], 1
mov dword [esp], 0x45d7de
call edx
mov dword [esp], ebx
lea ebx, [ebp - 0x31c]
mov ecx, dword [ebp - 0x430]
call ecx
mov dword [esp], ebx
mov dword [esp + 4], str.rt_ccsutf_16le
mov dword [ebp - 0x434], edi
call edi
mov dword [esp + 4], 0x409
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], ebx
mov edi, dword [ebp - 0x42c]
call edi
mov dword [esp + 4], 0x40d
mov dword [esp], 0x45a2c0
mov edi, eax
call fcn.0044c860
movzx eax, di
mov dword [esp + 0x10], 0
mov dword [esp + 8], eax
xor eax, eax
cmp di, 0xff1f
sete al
mov dword [esp + 0xc], 0xff1f
mov dword [esp], eax
mov dword [esp + 4], str.got__04hx__expected__04x__unicode__d___n
call fcn.0044cad0
mov dword [esp], ebx
mov edi, dword [ebp - 0x42c]
call edi
mov dword [esp + 4], 0x40d
mov dword [esp], 0x45a2c0
mov edi, eax
call fcn.0044c860
movzx eax, di
mov dword [esp + 0x10], 1
mov dword [esp + 8], eax
xor eax, eax
cmp di, 0x21
sete al
mov dword [esp + 0xc], 0x21
mov dword [esp], eax
mov dword [esp + 4], str.got__04hx__expected__04x__unicode__d___n
call fcn.0044cad0
mov dword [esp], ebx
mov edi, dword [ebp - 0x42c]
call edi
mov dword [esp + 4], 0x411
mov dword [esp], 0x45a2c0
mov edi, eax
call fcn.0044c860
movzx eax, di
mov dword [esp + 4], str.got__04hx__expected_WEOF__unicode__n
mov dword [esp + 8], eax
xor eax, eax
cmp di, 0xffff
sete al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp], ebx
lea ebx, [ebp - 0x31c]
mov ecx, dword [ebp - 0x430]
call ecx
mov dword [esp], ebx
mov eax, dword [ebp - 0x434]
mov dword [esp + 4], 0x45b139
call eax
mov dword [esp + 4], 0x415
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 edx, dword [ebp - 0x43c]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0x200
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], 2
mov dword [esp + 8], 0x45d7de
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
call edx
sub esp, 0x20
mov edi, eax
mov dword [esp + 4], 0x418
mov dword [esp], 0x45a2c0
call fcn.0044c860
xor eax, eax
test edi, edi
mov dword [esp + 4], str.utf_8_conversion_failed_n
setg al
mov dword [esp], eax
call fcn.0044cad0
mov edx, dword [ebp - 0x438]
mov dword [esp + 0xc], ebx
mov byte [ebp + edi - 0x218], 0
mov dword [esp + 8], edi
mov dword [esp + 4], 1
mov dword [esp], esi
call edx
mov ecx, dword [ebp - 0x430]
mov dword [esp], ebx
call ecx
lea edx, [ebp - 0x31c]
mov dword [esp + 4], str.rt__ccsUTF_8
mov eax, dword [ebp - 0x434]
mov dword [esp], edx
call eax
mov dword [esp + 4], 0x41e
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], ebx
mov edi, dword [ebp - 0x42c]
call edi
mov dword [esp + 4], 0x422
mov dword [esp], 0x45a2c0
mov edi, eax
call fcn.0044c860
movzx eax, di
mov dword [esp + 0x10], 0
mov dword [esp + 8], eax
xor eax, eax
cmp di, 0xff1f
sete al
mov dword [esp + 0xc], 0xff1f
mov dword [esp], eax
mov dword [esp + 4], str.got__04hx__expected__04x__utf8__d___n
call fcn.0044cad0
mov dword [esp], ebx
mov edi, dword [ebp - 0x42c]
call edi
mov dword [esp + 4], 0x422
mov dword [esp], 0x45a2c0
mov edi, eax
call fcn.0044c860
movzx eax, di
mov dword [esp + 0x10], 1
mov dword [esp + 8], eax
xor eax, eax
cmp di, 0x21
sete al
mov dword [esp + 0xc], 0x21
mov dword [esp], eax
mov dword [esp + 4], str.got__04hx__expected__04x__utf8__d___n
call fcn.0044cad0
mov dword [esp], ebx
mov edi, dword [ebp - 0x42c]
call edi
mov dword [esp + 4], 0x426
mov dword [esp], 0x45a2c0
mov edi, eax
call fcn.0044c860
movzx eax, di
mov dword [esp + 4], str.got__04hx__expected_WEOF__utf8__n
mov dword [esp + 8], eax
xor eax, eax
cmp di, 0xffff
sete al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp], ebx
mov ecx, dword [ebp - 0x430]
call ecx
lea ecx, [ebp - 0x31c]
mov dword [esp + 4], str.rt__ccsunicode
mov eax, dword [ebp - 0x434]
mov dword [esp], ecx
call eax
mov dword [esp + 4], 0x42a
mov dword [esp], 0x45a2c0
mov ebx, eax
mov dword [ebp - 0x434], eax
call fcn.0044c860
test ebx, ebx
mov dword [esp + 4], str.cant_open_tempfile_n
setne al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
cmp byte [ebp - 0x218], 0
je 0x4130ed
xor ebx, ebx
lea esi, [esi]
lea esi, [esi]
mov eax, dword [ebp - 0x434]
mov dword [esp], eax
mov eax, dword [ebp - 0x42c]
call eax
mov dword [esp + 4], 0x42e
mov dword [esp], 0x45a2c0
mov edi, eax
call fcn.0044c860
movzx ecx, byte [esi + ebx]
xor eax, eax
mov dword [esp + 0x10], ebx
mov dword [esp + 4], str.got__04hx__expected__04x__unicode__d___n
mov edx, ecx
mov dword [esp + 0xc], ecx
movzx ecx, di
cmp dx, di
mov dword [esp + 8], ecx
sete al
add ebx, 1
mov dword [esp], eax
call fcn.0044cad0
cmp byte [esi + ebx], 0
jne 0x413090
mov esi, dword [ebp - 0x434]
mov eax, dword [ebp - 0x42c]
mov dword [esp], esi
call eax
mov dword [esp + 4], 0x432
mov dword [esp], 0x45a2c0
mov ebx, eax
call fcn.0044c860
movzx eax, bx
mov dword [esp + 4], str.got__04hx__expected_WEOF__unicode__n
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 - 0x430]
call eax
lea eax, [ebp - 0x420]
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 dword [esp + 4], 0x3ba
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov dword [esp], str.fopen_s_not_available_n
call fcn.0044cbe0
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret