Function at 0x10046780
Capabilities:
Check if file exists
Delete file
Move file
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x10084fb5
mov eax, dword fs:[0]
push eax
sub esp, 0x14
push ebx
push esi
push edi
mov eax, dword [0x100a1040]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, edx
mov ebx, ecx
call fcn.10004070
mov ecx, eax
test ecx, ecx
je 0x100469ee
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x10], eax
push ebx
lea ecx, [ebp - 0x10]
mov dword [ebp - 4], 0
call fcn.10007ac0
test al, al
jne 0x10046800
test ebx, ebx
jne 0x100467e2
xor ecx, ecx
jmp 0x100467f6
mov ecx, ebx
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x100467e7
sub ecx, edx
sar ecx, 1
push ecx
push ebx
lea ecx, [ebp - 0x10]
call fcn.10007d40
mov dword [ebp - 4], 1
mov ecx, 1
mov esi, dword [ebp - 0x10]
mov eax, dword [esi - 8]
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
jge 0x1004682e
push 0x104
lea ecx, [ebp - 0x10]
call fcn.10007ce0
mov esi, dword [ebp - 0x10]
push esi
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
push dword [esi - 8]
push esi
call fcn.10061d3b
add esp, 8
test eax, eax
js 0x100469e4
cmp eax, dword [esi - 8]
jg 0x100469e4
xor ecx, ecx
mov dword [esi - 0xc], eax
push esi
mov word [esi + eax*2], cx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x1004686e
push esi
push eax
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
call fcn.10004070
mov ecx, eax
test ecx, ecx
je 0x100469f8
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x14], eax
lea edx, [ebp - 0x14]
mov byte [ebp - 4], 2
mov ecx, edi
call fcn.10046c70
or edi, 0xffffffff
test eax, eax
je 0x10046994
mov eax, dword [ebp - 0x14]
mov eax, dword [eax - 0xc]
mov dword [ebp - 0x1c], eax
test ebx, ebx
je 0x10046994
push ebx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
test eax, eax
je 0x10046994
call fcn.10004070
mov ecx, eax
test ecx, ecx
je 0x10046a02
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x18], eax
push ebx
lea eax, [ebp - 0x18]
mov byte [ebp - 4], 3
push str._s.write_cache
push eax
call fcn.10007310
mov edi, dword [ebp - 0x18]
add esp, 0xc
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x20], eax
cmp eax, 0xffffffff
je 0x1004696d
push 0
lea ecx, [ebp - 0x18]
mov dword [ebp - 0x18], 0
push ecx
push dword [ebp - 0x1c]
push dword [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 0x1c]
xor eax, eax
cmp dword [ebp - 0x18], ecx
push dword [ebp - 0x20]
sete al
mov dword [ebp - 0x1c], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x1c], 0
je 0x10046971
push 0x80
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
push 1
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
push edi
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
jmp 0x10046974
xor ebx, ebx
jmp 0x10046974
mov ebx, dword [ebp - 0x1c]
lea edx, [edi - 0x10]
mov byte [ebp - 4], 2
or edi, 0xffffffff
mov eax, edi
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10046996
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x10046996
xor ebx, ebx
mov byte [ebp - 4], 1
mov eax, edi
mov edx, dword [ebp - 0x14]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x100469b4
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], edi
dec edi
test edi, edi
jg 0x100469d0
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x80070057
call fcn.10001410
push 0x80004005
call fcn.10001410
push 0x80004005
call fcn.10001410
push 0x80004005
call fcn.10001410
int3