Function at 0x4012f0
Capabilities:
Get common file path
Get file size

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x411d05
mov eax, dword fs:[0]
push eax
sub esp, 0x848
mov eax, dword [0x41b008]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x854], ecx
mov eax, dword [ebp + 0xc]
xor edi, edi
mov esi, dword [ebp + 8]
mov ebx, 0x80
mov dword [ebp - 0x84c], eax
mov eax, dword [ebp + 0x18]
push 0x20a
mov dword [ebp - 0x848], eax
lea eax, [ebp - 0x21c]
push edi
push eax
call fcn.004064d0
add esp, 0xc
test esi, esi
jne 0x4013e7
push 0x20a
lea eax, [ebp - 0x428]
mov dword [ebp - 0x848], 3
push edi
push eax
mov ebx, 0x4000180
call fcn.004064d0
push 0x20a
lea eax, [ebp - 0x634]
push edi
push eax
call fcn.004064d0
add esp, 0x18
lea eax, [ebp - 0x428]
push eax
push 0x105
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
je 0x4013d0
lea eax, [ebp - 0x634]
push eax
push edi
push 0x41808c
lea eax, [ebp - 0x428]
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
test eax, eax
je 0x4013d0
lea eax, [ebp - 0x634]
push eax
jmp 0x4013e8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
test edi, edi
jle 0x4013fc
movzx edi, di
or edi, 0x80070000
jmp 0x4013fc
push esi
lea eax, [ebp - 0x21c]
push 0x105
push eax
call fcn.00407fa2
add esp, 0xc
xor esi, esi
mov dword [ebp - 0x844], esi
mov dword [ebp - 4], esi
test edi, edi
js 0x4015d5
push 0x20a
lea eax, [ebp - 0x840]
mov dword [ebp - 0x850], 0xffffffff
push esi
push eax
call fcn.004064d0
add esp, 0xc
lea eax, [ebp - 0x840]
push 0x105
push eax
lea eax, [ebp - 0x21c]
push eax
call dword [sym.imp.COMDLG32.dll_GetFileTitleW]
test ax, ax
jne 0x401454
lea eax, [ebp - 0x840]
jmp 0x401465
lea eax, [ebp - 0x21c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
test eax, eax
je 0x401486
push eax
call dword [sym.imp.OLEAUT32.dll_SysReAllocString]
mov esi, eax
xor edi, edi
test esi, esi
mov dword [ebp - 0x844], esi
mov eax, 0x8007000e
cmove edi, eax
test edi, edi
js 0x4014c8
jmp 0x401488
xor edi, edi
push 0
push ebx
push dword [ebp - 0x848]
lea eax, [ebp - 0x21c]
push 0
push 0
push dword [ebp - 0x84c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x850], eax
cmp eax, 0xffffffff
jne 0x4014c8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
test edi, edi
jle 0x4014c8
movzx edi, di
or edi, 0x80070000
xor eax, eax
test edi, edi
js 0x4015ca
mov ecx, dword [ebp - 0x84c]
cmp ecx, 0x40000000
je 0x4014f7
cmp ecx, 0x80000000
je 0x4014fc
cmp ecx, 0xc0000000
jne 0x4014fc
mov eax, 2
jmp 0x4014fc
mov eax, 1
and ebx, 0x4000000
or ebx, eax
mov eax, dword [ebp - 0x848]
or ebx, 0x10
cmp eax, 2
je 0x401517
cmp eax, 1
jne 0x40151d
or ebx, 0x1000
push 0x260
call fcn.00404fac
mov dword [ebp - 0x84c], eax
push ecx
lea ecx, [ebp - 0x844]
mov byte [ebp - 4], 1
push ecx
lea ecx, [ebp - 0x21c]
push ecx
push ebx
push dword [ebp - 0x850]
mov ecx, eax
call fcn.00401600
mov esi, eax
mov byte [ebp - 4], 0
test esi, esi
je 0x4015bf
mov eax, dword [esi + 8]
test al, 0xf
jne 0x4015a7
and eax, 0xf0
cmp eax, 0x20
ja 0x4015a7
lea eax, [esi + 0x244]
push eax
push dword [esi + 0xc]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [esi + 0x240], eax
or eax, dword [esi + 0x244]
je 0x4015a7
push 0
push 0
push 0
push 2
push 0
push dword [esi + 0xc]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [esi + 0x10], eax
test eax, eax
jne 0x4015a7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [ebp - 0x854]
xor edi, edi
push esi
mov dword [eax], esi
mov eax, dword [esi]
call dword [eax + 4]
mov eax, dword [esi]
push esi
call dword [eax + 8]
jmp 0x4015c4
mov edi, 0x8007000e
mov esi, dword [ebp - 0x844]
test esi, esi
je 0x4015d5
push esi
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00404f90
mov esp, ebp
pop ebp
ret