Function at 0x412004
Capabilities:
Check if file exists
Delete file
Get common file path
Write file on windows

Disassembly:
push 0x44c
mov eax, 0x4b42f0
call fcn.00476519
mov esi, dword [ebp + 8]
mov ebx, ecx
lea edi, [ebx + 4]
push edi
mov dword [ebp - 0x430], edi
call fcn.00411d9a
pop ecx
test eax, eax
jl 0x412333
push esi
lea ecx, [ebx + 8]
call fcn.00411dc1
mov eax, dword [ebp + 0xc]
mov dword [ebx + 0x10], eax
mov eax, dword [edi]
test eax, eax
jne 0x41204f
push 0x80004003
call fcn.00474e40
mov ecx, dword [eax]
push 0xffffffffffffffff
push eax
call dword [ecx + 0x4c]
mov eax, dword [edi]
test eax, eax
je 0x412045
mov ecx, dword [eax]
push 0
push eax
call dword [ecx + 0x50]
mov eax, dword [esi]
xor ecx, ecx
cmp dword [ebp + 0xc], ecx
je 0x412115
mov dword [ebp - 0x42c], ecx
cmp eax, ecx
je 0x412080
mov eax, dword [eax]
jmp 0x412082
xor eax, eax
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x4120d2
push esi
lea ecx, [ebp - 0x448]
call fcn.00402a8c
and dword [ebp - 4], 0
mov ecx, dword [edi]
test ecx, ecx
je 0x412045
mov edx, dword [ecx]
lea esi, [ebp - 0x42c]
push esi
sub esp, 0x10
mov edi, esp
mov esi, eax
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
push ecx
movsd dword es:[edi], dword [esi]
call dword [edx + 0x30]
or dword [ebp - 4], 0xffffffff
lea eax, [ebp - 0x448]
push eax
call dword [sym.imp.OLEAUT32.dll_VariantCopy]
mov edi, dword [ebp - 0x430]
push 0x4d4b64
lea ecx, [ebp - 0x424]
call fcn.004029a8
lea eax, [ebp - 0x424]
push eax
mov ecx, ebx
mov dword [ebp - 4], 1
call fcn.00411ed7
mov ecx, dword [ebp - 0x424]
mov dword [ebp - 0x428], eax
test ecx, ecx
je 0x41231b
call fcn.00402a41
jmp 0x41231b
mov dword [ebp - 0x434], ecx
cmp eax, ecx
je 0x412123
mov eax, dword [eax]
jmp 0x412125
xor eax, eax
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x41217f
push esi
lea ecx, [ebp - 0x448]
call fcn.00402a8c
mov dword [ebp - 4], 2
mov ecx, dword [edi]
test ecx, ecx
je 0x412045
mov edx, dword [ecx]
lea esi, [ebp - 0x434]
push esi
sub esp, 0x10
mov edi, esp
mov esi, eax
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
push ecx
movsd dword es:[edi], dword [esi]
call dword [edx + 0x30]
mov dword [ebp - 0x428], eax
lea eax, [ebp - 0x448]
push eax
call dword [sym.imp.OLEAUT32.dll_VariantCopy]
xor ebx, ebx
jmp 0x412302
mov dword [ebp - 0x428], 0x80004005
call fcn.00411fc3
mov edi, eax
xor ebx, ebx
cmp edi, ebx
je 0x412302
mov eax, dword [esi]
cmp eax, ebx
je 0x4121a4
mov eax, dword [eax]
jmp 0x4121a6
xor eax, eax
mov ecx, dword [edi]
push eax
push ebx
push edi
call dword [ecx + 0x10]
cmp eax, ebx
mov dword [ebp - 0x42c], eax
jle 0x412302
push eax
call fcn.0047758d
pop ecx
mov dword [ebp - 0x424], eax
cmp eax, ebx
je 0x412302
push dword [ebp - 0x42c]
push ebx
push eax
call fcn.00475410
mov esi, dword [esi]
add esp, 0xc
cmp esi, ebx
je 0x4121eb
mov esi, dword [esi]
jmp 0x4121ed
xor esi, esi
push dword [ebp - 0x42c]
mov eax, dword [edi]
push dword [ebp - 0x424]
push esi
push ebx
push edi
call dword [eax + 0x14]
mov esi, 0x208
push esi
lea eax, [ebp - 0x420]
push ebx
push eax
call fcn.00475410
add esp, 0xc
lea eax, [ebp - 0x420]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
push esi
lea eax, [ebp - 0x218]
push ebx
push eax
call fcn.00475410
mov eax, dword [0x4f7224]
add esp, 0xc
inc dword [0x4f7224]
lea ecx, [ebp - 0x218]
push ecx
push eax
push 0x4d4ba4
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
lea eax, [ebp - 0x218]
push 0x4d4bac
push eax
call fcn.00477527
mov esi, eax
pop ecx
pop ecx
cmp esi, ebx
je 0x4122f6
push esi
push 1
push dword [ebp - 0x42c]
push dword [ebp - 0x424]
call fcn.004773df
push esi
call fcn.00477201
add esp, 0x14
lea eax, [ebp - 0x218]
push eax
lea ecx, [ebp - 0x458]
call fcn.00411fd4
mov ecx, dword [ebp - 0x430]
mov dword [ebp - 4], 3
mov ecx, dword [ecx]
cmp ecx, ebx
je 0x412045
mov edx, dword [ecx]
lea esi, [ebp - 0x434]
push esi
sub esp, 0x10
mov edi, esp
mov esi, eax
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
push ecx
movsd dword es:[edi], dword [esi]
call dword [edx + 0x30]
mov dword [ebp - 0x428], eax
lea eax, [ebp - 0x458]
push eax
call dword [sym.imp.OLEAUT32.dll_VariantCopy]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push dword [ebp - 0x424]
call fcn.004770fc
pop ecx
mov edi, dword [ebp - 0x430]
cmp word [ebp - 0x434], bx
jne 0x41231b
mov dword [ebp - 0x428], 0x80004005
cmp dword [ebp - 0x428], 0
jge 0x41232d
push 0
mov ecx, edi
call fcn.00402b82
mov eax, dword [ebp - 0x428]
call fcn.0047659c
ret 8