Function at 0x4130c0
Capabilities:
Check if file exists
Delete file
Write file on windows

Disassembly:
sub esp, 0x224
push ebp
push esi
push edi
mov ecx, 0x81
xor eax, eax
lea edi, [esp + 0x2a]
mov word [esp + 0x28], 0
push str._temp_
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov eax, dword [esp + 0x238]
lea ecx, [esp + 0x18]
push eax
push ecx
call fcn.00409a80
push 0
mov esi, eax
call dword [sym.imp.MSVCRT.dll_time]
mov edx, dword [esi]
add esp, 4
push eax
push edx
lea eax, [esp + 0x30]
push str._s__d
push eax
call dword [sym.imp.MSVCRT.dll_swprintf]
mov eax, dword [esp + 0x24]
mov edx, dword [0x463294]
add esp, 0x10
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x413149
add eax, 0xfffffff4
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jg 0x413149
mov edx, dword [esp + 0x14]
add edx, 0xfffffff4
push edx
call fcn.0044737a
add esp, 4
mov ebp, dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea eax, [esp + 0x28]
push eax
call ebp
push 0
push 0
push 1
push 0
push 0
lea ecx, [esp + 0x3c]
push 0x40000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x4132b1
lea edx, [esp + 0x28]
push edx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x4132b1
mov al, byte [esp + 0xf]
push 0
lea ecx, [esp + 0x1c]
mov byte [esp + 0x1c], al
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::_Tidy_bool_]
push str.abcdefg
call dword [sym.imp.MSVCRT.dll_wcslen]
add esp, 4
mov esi, eax
lea ecx, [esp + 0x18]
push 1
push esi
call dword [sym.imp.MSVCP60.dll_private:_bool___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::_Grow_unsigned_int__bool_]
test al, al
je 0x4131e4
mov ecx, dword [esp + 0x1c]
push esi
push str.abcdefg
push ecx
call fcn.00408b50
mov edx, dword [esp + 0x28]
mov dword [esp + 0x2c], esi
add esp, 0xc
mov word [edx + esi*2], 0
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x10], 0
test eax, eax
jne 0x4131f9
mov eax, dword [sym.imp.MSVCP60.dll_unsigned_short_int_const__private:_static_unsigned_short_int_const____cdecl_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::_Nullstr_void_::_2::_C]
mov edx, dword [esp + 0x20]
lea ecx, [esp + 0x10]
push 0
push ecx
lea ecx, [edx + edx]
push ecx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x413273
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x10]
lea eax, [edx + edx]
cmp eax, ecx
jne 0x413273
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [esp + 0x28]
push ecx
call ebp
mov ecx, dword [esp + 0x1c]
test ecx, ecx
je 0x413264
mov al, byte [ecx - 1]
test al, al
je 0x413258
cmp al, 0xff
je 0x413258
dec al
pop edi
mov byte [ecx - 1], al
pop esi
mov eax, 1
pop ebp
add esp, 0x224
ret
add ecx, 0xfffffffe
push ecx
call fcn.0044737a
add esp, 4
pop edi
pop esi
mov eax, 1
pop ebp
add esp, 0x224
ret
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea edx, [esp + 0x28]
push edx
call ebp
mov ecx, dword [esp + 0x1c]
test ecx, ecx
je 0x4132b1
mov al, byte [ecx - 1]
test al, al
je 0x4132a5
cmp al, 0xff
je 0x4132a5
dec al
pop edi
mov byte [ecx - 1], al
pop esi
xor eax, eax
pop ebp
add esp, 0x224
ret
add ecx, 0xfffffffe
push ecx
call fcn.0044737a
add esp, 4
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0x224
ret