Function at 0x40c974
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
lea esi, [ebp - 0x11d]
push ebx
sub esp, 0x15c
test edx, edx
mov dword [ebp - 0x130], eax
mov eax, 0x42b721
mov dword [ebp - 0x134], edx
mov edx, 0x42b724
cmove eax, edx
mov dword [ebp - 0x138], ecx
mov dword [ebp - 0x12c], eax
mov dword [esp + 4], esi
mov dword [esp], 0x105
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
push ecx
mov ebx, eax
push ecx
mov eax, dword [ebp - 0x130]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov edi, eax
mov eax, dword [ebp - 0x12c]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
lea eax, [edi + eax + 0xa]
xor edi, edi
mov dword [ebp - 0x13c], eax
test ebx, ebx
jne 0x40ca0a
mov dword [esp + 4], esi
mov edi, 1
mov dword [esp], 0x105
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
push edx
mov ebx, eax
push edx
mov eax, dword [0x4311f8]
inc eax
mov dword [0x4311f8], eax
cmp eax, 0xffff
jbe 0x40cb4c
cmp dword [0x4311f4], 0
jne 0x40cb4c
mov dword [0x4311f4], 1
mov dword [0x4311f8], 1
jmp 0x40cb4c
mov eax, dword [0x4311f8]
inc eax
mov dword [0x4311f8], eax
cmp eax, 0x10000
je 0x40cb6a
mov eax, dword [ebp - 0x13c]
add eax, ebx
cmp eax, 0x104
ja 0x40cb63
mov edx, dword [0x4311f8]
cmp edx, 0xffff
ja 0x40cb56
mov esi, dword [ebp - 0x12c]
mov ecx, 0x42b6b8
mov eax, 0x42b728
cmp byte [ebp + ebx - 0x11e], 0x5c
mov dword [esp + 0x10], edx
cmove eax, ecx
mov dword [esp + 0x14], esi
mov esi, dword [ebp - 0x130]
mov dword [esp + 8], eax
mov dword [esp + 0xc], esi
lea esi, [ebp - 0x11d]
lea eax, [esi + ebx]
mov dword [esp + 4], str._s_s__x._s
mov dword [esp], eax
call fcn.0040c726
mov dword [ebp - 0x140], eax
xor eax, eax
mov dword [esp + 0x18], eax
xor eax, eax
mov dword [esp + 0x14], 0x180
mov dword [esp + 0x10], 1
mov dword [esp + 0xc], eax
mov dword [esp + 8], eax
mov dword [esp + 4], 0xc0000000
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ecx, dword [ebp - 0x140]
sub esp, 0x1c
cmp eax, 0xffffffff
jne 0x40cb9a
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x50
je 0x40ca46
cmp eax, 0xb7
je 0x40ca46
test edi, edi
jne 0x40cb90
mov dword [esp + 4], esi
mov edi, 1
mov dword [esp], 0x105
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
push ecx
mov ebx, eax
push ecx
test ebx, ebx
jne 0x40ca5c
jmp 0x40cb63
cmp dword [0x4311f4], 0
je 0x40ca81
xor eax, eax
jmp 0x40cbf8
cmp dword [0x4311f4], 0
jne 0x40ca5c
mov dword [0x4311f4], 1
mov dword [0x4311f8], 1
jmp 0x40ca5c
mov dword [esp], eax
call fcn.0041ef04
jmp 0x40cbf8
lea ecx, [ecx + ebx + 1]
mov dword [ebp - 0x130], eax
mov dword [esp], ecx
mov dword [ebp - 0x12c], ecx
call fcn.00411351
xor edx, edx
mov ecx, dword [ebp - 0x12c]
mov edi, eax
mov ebx, eax
rep movsb byte es:[edi], byte [esi]
mov dword [esp + 4], edx
mov edx, dword [ebp - 0x130]
mov dword [esp], edx
call dword [sym.imp.msvcrt.dll__open_osfhandle]
mov edi, dword [ebp - 0x138]
cmp dword [ebp - 0x134], 0
mov dword [edi], eax
je 0x40cc1f
mov eax, ebx
movsx edx, byte [eax]
test edx, edx
je 0x40cc1f
cmp edx, 0x5c
jne 0x40cbf5
mov byte [eax], 0x2f
inc eax
jmp 0x40cbe6
mov edi, dword [ebp - 0x138]
mov dword [edi], 0xffffffff
test eax, eax
jne 0x40cc0d
mov eax, str.Cannot_create_a_temporary_file
mov dword [esp + 8], eax
xor eax, eax
mov dword [esp + 4], eax
mov dword [esp], eax
call fcn.00412444
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret