Function at 0x12cc798
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 0x12cc7c8
mov dword [ecx], esi
test eax, eax
je 0x12cc7ff
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 0x12cc7ff
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x12cc9f9
movzx esi, si
or esi, 0x80070000
jmp 0x12cc9f9
push esi
push esi
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
je 0x12cc7e1
inc eax
push eax
mov dword [ebp - 8], eax
call fcn.012d79f2
mov dword [ebp - 0x10], eax
pop ecx
test eax, eax
jne 0x12cc827
mov esi, 0x8007000e
jmp 0x12cc9f9
push eax
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
jne 0x12cc853
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x12cc9e5
movzx esi, si
or esi, 0x80070000
jmp 0x12cc9e5
add eax, 0xf
add eax, ebx
push eax
mov dword [ebp - 0x18], eax
call fcn.012d79f2
mov ebx, eax
mov dword [ebp - 8], ebx
pop ecx
test ebx, ebx
jne 0x12cc875
mov esi, 0x8007000e
jmp 0x12cc9e5
push ebx
push esi
push 0x12c3f7c
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
test eax, eax
jne 0x12cc8a7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x12cc9de
movzx esi, si
or esi, 0x80070000
jmp 0x12cc9de
mov edx, dword [ebp - 0x14]
test edx, edx
je 0x12cc8db
mov ecx, ebx
lea eax, [ecx + 1]
mov dword [ebp - 0x14], eax
mov al, byte [ecx]
inc ecx
test al, al
jne 0x12cc8b6
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 0x12cc889
push esi
push 0x4002100
push 2
push esi
push esi
push 0xc0000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
lea edi, [eax + 1]
neg edi
sbb edi, edi
and edi, eax
je 0x12cc889
cmp dword [ebp + 8], esi
jle 0x12cc953
mov eax, dword [ebp - 0xc]
mov ax, word [eax]
cmp ax, word [ebp - 4]
je 0x12cc927
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 0x12cc889
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 0x12cc889
push edi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
je 0x12cc889
cmp dword [ebp + 0x10], esi
je 0x12cc9c7
mov ecx, ebx
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x12cc95d
push esi
push esi
sub ecx, edx
push ecx
push ebx
push esi
push esi
mov dword [ebp - 0x14], ecx
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov dword [ebp - 0x18], eax
test eax, eax
je 0x12cc889
push eax
push esi
call dword [sym.imp.OLEAUT32.dll_SysReAllocStringLen]
mov ebx, eax
test ebx, ebx
jne 0x12cc995
mov esi, 0x8007000e
jmp 0x12cc9db
push dword [ebp - 0x18]
push ebx
push dword [ebp - 0x14]
push dword [ebp - 8]
push esi
push esi
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
jne 0x12cc9c2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x12cc9d0
movzx esi, si
or esi, 0x80070000
jmp 0x12cc9d0
mov eax, dword [ebp + 0x10]
mov dword [eax], ebx
mov eax, dword [ebp + 0xc]
mov ebx, esi
mov dword [eax], edi
mov edi, esi
test ebx, ebx
je 0x12cc9db
push ebx
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov ebx, dword [ebp - 8]
push ebx
call fcn.012d7a1b
pop ecx
push dword [ebp - 0x10]
call fcn.012d7a1b
pop ecx
test edi, edi
je 0x12cc9f9
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc