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

Disassembly:
sub esp, 0x314
mov eax, dword [section..data]
xor eax, esp
mov dword [esp + 0x310], eax
push ebx
push esi
mov esi, dword [sym.imp.MSVCR90.dll___iob_func]
push edi
push str.Exporting_Tooling_r
call esi
add eax, 0x40
push eax
call dword [sym.imp.MSVCR90.dll_fprintf]
add esp, 8
lea eax, [esp + 0x10]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
mov edi, dword [sym.imp.MSVCR90.dll_strcpy_s]
lea ecx, [esp + 0x10]
push ecx
lea edx, [esp + 0x118]
push 0x104
push edx
call edi
mov ebx, dword [sym.imp.MSVCR90.dll_strcat_s]
push str.plink.exe
lea eax, [esp + 0x124]
push 0x104
push eax
call ebx
lea ecx, [esp + 0x28]
push ecx
lea edx, [esp + 0x234]
push 0x104
push edx
call edi
push str.cleanscript.txt
lea eax, [esp + 0x240]
push 0x104
push eax
call ebx
add esp, 0x30
push str.___Exporting_SSH_Tool_r
call esi
mov edi, dword [sym.imp.MSVCR90.dll_fprintf_s]
add eax, 0x40
push eax
call edi
mov ebx, dword [sym.imp.MSVCR90.dll_fopen_s]
push 0x4042d0
lea ecx, [esp + 0x120]
push ecx
lea edx, [esp + 0x1c]
push edx
call ebx
add esp, 0x14
test eax, eax
je 0x40167e
push str.Exporting_plink.exe____opening_failed_r
call esi
add eax, 0x40
push eax
call edi
add esp, 8
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [esp + 0x310]
xor ecx, esp
call fcn.00403178
add esp, 0x314
ret
mov eax, dword [esp + 0xc]
push ebp
mov ebp, dword [sym.imp.MSVCR90.dll_fwrite]
push eax
push 0x4a000
push 1
push 0x405018
call ebp
add esp, 0x10
cmp eax, 0x4a000
je 0x4016b9
push str.Exporting_plink.exe____writing_failed_r
call esi
add eax, 0x40
push eax
call edi
add esp, 8
xor al, al
jmp 0x4017cb
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.MSVCR90.dll_fflush]
add esp, 4
test eax, eax
je 0x4016e2
push str.Exporting_plink.exe____flushing_failed_r
call esi
add eax, 0x40
push eax
call edi
add esp, 8
xor al, al
jmp 0x4017cb
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.MSVCR90.dll_fclose]
add esp, 4
test eax, eax
je 0x40170b
push str.Exporting_plink.exe____closing_failed_r
call esi
add eax, 0x40
push eax
call edi
add esp, 8
xor al, al
jmp 0x4017cb
push str.___Exporting_Clean_up_script_r
call esi
add eax, 0x40
push eax
call edi
call fcn.00401dc0
push 0x4042d0
lea eax, [esp + 0x228]
push eax
lea ecx, [esp + 0x20]
push ecx
call ebx
add esp, 0x14
test eax, eax
je 0x40174c
push str.Exporting_cleanscript.txt____opening_failed_r
call esi
add eax, 0x40
push eax
call edi
add esp, 8
xor al, al
jmp 0x4017cb
mov edx, dword [esp + 0x10]
push edx
push 0x2f7
push 1
push 0x44f4a8
call ebp
add esp, 0x10
cmp eax, 0x2f7
je 0x40177d
push str.Exporting_cleanscript.txt____writing_failed_r
call esi
add eax, 0x40
push eax
call edi
add esp, 8
xor al, al
jmp 0x4017cb
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.MSVCR90.dll_fflush]
add esp, 4
test eax, eax
je 0x4017a3
push str.Exporting_cleanscript.txt____flushing_failed_r
call esi
add eax, 0x40
push eax
call edi
add esp, 8
xor al, al
jmp 0x4017cb
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.MSVCR90.dll_fclose]
add esp, 4
test eax, eax
je 0x4017c9
push str.Exporting_cleanscript.txt____closing_failed_r
call esi
add eax, 0x40
push eax
call edi
add esp, 8
xor al, al
jmp 0x4017cb
mov al, 1
mov ecx, dword [esp + 0x320]
pop ebp
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00403178
add esp, 0x314
ret