Function at 0x40c978
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x15c
mov dword [ebp - 0x130], eax
mov dword [ebp - 0x134], edx
mov dword [ebp - 0x138], ecx
mov dword [ebp - 0x12c], 0x42b724
test edx, edx
je 0x40c9ae
mov dword [ebp - 0x12c], 0x42b721
lea esi, [ebp - 0x11d]
mov dword [esp], 0x105
mov dword [esp + 4], esi
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 0x40ca11
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 0x40cb50
cmp dword [0x4311f4], 0
jne 0x40cb50
mov dword [0x4311f4], 1
mov dword [0x4311f8], 1
jmp 0x40cb50
mov eax, dword [0x4311f8]
inc eax
mov dword [0x4311f8], eax
cmp eax, 0x10000
je 0x40cb6e
mov eax, dword [ebp - 0x13c]
add eax, ebx
cmp eax, 0x104
ja 0x40cb67
mov eax, dword [0x4311f8]
cmp eax, 0xffff
ja 0x40cb5a
cmp byte [ebp + ebx - 0x11e], 0x5c
mov edx, 0x42b728
jne 0x40ca9a
mov edx, 0x42b6b8
mov esi, dword [ebp - 0x12c]
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], esi
mov eax, dword [ebp - 0x130]
lea esi, [ebp - 0x11d]
mov dword [esp + 8], edx
mov dword [esp + 0xc], eax
lea eax, [esi + ebx]
mov dword [esp + 4], str._s_s__x._s
mov dword [esp], eax
call fcn.0040c722
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 0x40cb9e
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x50
je 0x40ca4d
cmp eax, 0xb7
je 0x40ca4d
test edi, edi
jne 0x40cb94
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 0x40ca63
jmp 0x40cb67
cmp dword [0x4311f4], 0
je 0x40ca86
xor eax, eax
jmp 0x40cbfc
cmp dword [0x4311f4], 0
jne 0x40ca63
mov dword [0x4311f4], 1
mov dword [0x4311f8], 1
jmp 0x40ca63
mov dword [esp], eax
call fcn.0041eef4
jmp 0x40cbfc
lea ecx, [ecx + ebx + 1]
mov dword [ebp - 0x130], eax
mov dword [esp], ecx
mov dword [ebp - 0x12c], ecx
call fcn.00411363
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 0x40cc23
mov eax, ebx
movsx edx, byte [eax]
test edx, edx
je 0x40cc23
cmp edx, 0x5c
jne 0x40cbf9
mov byte [eax], 0x2f
inc eax
jmp 0x40cbea
mov edi, dword [ebp - 0x138]
mov dword [edi], 0xffffffff
test eax, eax
jne 0x40cc11
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.0041245c
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret