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

Disassembly:
push 0x44c
mov eax, 0x4b4390
call fcn.00476529
mov esi, dword [ebp + 8]
mov ebx, ecx
lea edi, [ebx + 4]
push edi
mov dword [ebp - 0x430], edi
call fcn.00411d9b
pop ecx
test eax, eax
jl 0x412334
push esi
lea ecx, [ebx + 8]
call fcn.00411dc2
mov eax, dword [ebp + 0xc]
mov dword [ebx + 0x10], eax
mov eax, dword [edi]
test eax, eax
jne 0x412050
push 0x80004003
call fcn.00474eb0
mov ecx, dword [eax]
push 0xffffffffffffffff
push eax
call dword [ecx + 0x4c]
mov eax, dword [edi]
test eax, eax
je 0x412046
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 0x412116
mov dword [ebp - 0x42c], ecx
cmp eax, ecx
je 0x412081
mov eax, dword [eax]
jmp 0x412083
xor eax, eax
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x4120d3
push esi
lea ecx, [ebp - 0x448]
call fcn.0040293f
and dword [ebp - 4], 0
mov ecx, dword [edi]
test ecx, ecx
je 0x412046
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 0x4d4b6c
lea ecx, [ebp - 0x424]
call fcn.0040285b
lea eax, [ebp - 0x424]
push eax
mov ecx, ebx
mov dword [ebp - 4], 1
call fcn.00411ed8
mov ecx, dword [ebp - 0x424]
mov dword [ebp - 0x428], eax
test ecx, ecx
je 0x41231c
call fcn.004028f4
jmp 0x41231c
mov dword [ebp - 0x434], ecx
cmp eax, ecx
je 0x412124
mov eax, dword [eax]
jmp 0x412126
xor eax, eax
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x412180
push esi
lea ecx, [ebp - 0x448]
call fcn.0040293f
mov dword [ebp - 4], 2
mov ecx, dword [edi]
test ecx, ecx
je 0x412046
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 0x412303
mov dword [ebp - 0x428], 0x80004005
call fcn.00411fc4
mov edi, eax
xor ebx, ebx
cmp edi, ebx
je 0x412303
mov eax, dword [esi]
cmp eax, ebx
je 0x4121a5
mov eax, dword [eax]
jmp 0x4121a7
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 0x412303
push eax
call fcn.0047759d
pop ecx
mov dword [ebp - 0x424], eax
cmp eax, ebx
je 0x412303
push dword [ebp - 0x42c]
push ebx
push eax
call fcn.00475420
mov esi, dword [esi]
add esp, 0xc
cmp esi, ebx
je 0x4121ec
mov esi, dword [esi]
jmp 0x4121ee
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.00475420
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.00475420
mov eax, dword [0x4f7224]
add esp, 0xc
inc dword [0x4f7224]
lea ecx, [ebp - 0x218]
push ecx
push eax
push 0x4d4bac
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
lea eax, [ebp - 0x218]
push 0x4d4bb4
push eax
call fcn.00477537
mov esi, eax
pop ecx
pop ecx
cmp esi, ebx
je 0x4122f7
push esi
push 1
push dword [ebp - 0x42c]
push dword [ebp - 0x424]
call fcn.004773ef
push esi
call fcn.00477211
add esp, 0x14
lea eax, [ebp - 0x218]
push eax
lea ecx, [ebp - 0x458]
call fcn.00411fd5
mov ecx, dword [ebp - 0x430]
mov dword [ebp - 4], 3
mov ecx, dword [ecx]
cmp ecx, ebx
je 0x412046
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.0047710c
pop ecx
mov edi, dword [ebp - 0x430]
cmp word [ebp - 0x434], bx
jne 0x41231c
mov dword [ebp - 0x428], 0x80004005
cmp dword [ebp - 0x428], 0
jge 0x41232e
push 0
mov ecx, edi
call fcn.00402a35
mov eax, dword [ebp - 0x428]
call fcn.004765ac
ret 8