Function at 0x4086a6
Capabilities:
Check if file exists
Create directory
Delete file
Get common file path
Get file attributes
Set current directory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x424
push ebx
push esi
push edi
xor edi, edi
push 0x206
lea eax, [ebp - 0x216]
push edi
push eax
mov word [ebp - 0x218], di
call fcn.004062a0
add esp, 0xc
lea eax, [ebp - 0x218]
push eax
mov ebx, 0x104
push ebx
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
cmp eax, ebx
jae 0x4086eb
cmp eax, edi
ja 0x408700
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
jmp 0x408751
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x4087d7
lea eax, [ebp - 0x218]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, di
jne 0x40871f
sub eax, edx
sar eax, 1
lea esi, [ebp + eax*2 - 0x21a]
lea eax, [ebp - 0x218]
push eax
mov word [esi], di
call fcn.00408524
test al, al
pop ecx
mov word [esi], 0x5c
jne 0x4087d7
push edi
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push ebx
lea ecx, [ebp - 0x218]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea ecx, [eax - 1]
cmp ecx, 0x102
ja 0x408786
push eax
lea eax, [ebp - 0x218]
push eax
call fcn.00408061
pop ecx
pop ecx
mov word [eax], di
jmp 0x4087d7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, 0x401838
lea edi, [ebp - 0x10]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
lea eax, [ebp - 0x10]
push eax
movsd dword es:[edi], dword [esi]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
lea eax, [ebp - 0x10]
je 0x4087ae
push ebx
push eax
jmp 0x4087c8
push 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
cmp eax, 1
je 0x4087d7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebx
push 0x401830
lea eax, [ebp - 0x218]
push eax
call fcn.004080be
add esp, 0xc
xor esi, esi
push 0x208
lea eax, [ebp - 0x422]
push esi
push eax
mov word [ebp - 0x424], si
call fcn.004062a0
add esp, 0xc
lea eax, [ebp - 0x424]
push eax
push esi
push 0x401828
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
test eax, eax
mov edi, dword [sym.imp.KERNEL32.dll_lstrcatW]
mov esi, dword [ebp + 8]
je 0x40884e
push ebx
push esi
lea eax, [ebp - 0x424]
push eax
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
cmp eax, 0x105
ja 0x40884e
test eax, eax
je 0x40884e
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
je 0x40884e
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x408893
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea eax, [ebp - 0x424]
push eax
push eax
call fcn.00408662
push ebx
lea eax, [ebp - 0x218]
push eax
push esi
call fcn.004080be
add esp, 0x14
lea eax, [ebp - 0x424]
push eax
push esi
call edi
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x408893
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor al, al
jmp 0x4088be
push 0x40184c
push esi
call edi
push esi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
cmp eax, 1
je 0x4088ad
call dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
mov al, cl
pop edi
pop esi
pop ebx
leave
ret