Function at 0x408b97
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.00406310
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 0x408bdc
cmp eax, edi
ja 0x408bf1
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
jmp 0x408c42
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x408cc8
lea eax, [ebp - 0x218]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, di
jne 0x408c10
sub eax, edx
sar eax, 1
lea esi, [ebp + eax*2 - 0x21a]
lea eax, [ebp - 0x218]
push eax
mov word [esi], di
call fcn.004087c8
test al, al
pop ecx
mov word [esi], 0x5c
jne 0x408cc8
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 0x408c77
push eax
lea eax, [ebp - 0x218]
push eax
call fcn.004082f0
pop ecx
pop ecx
mov word [eax], di
jmp 0x408cc8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, 0x4018e4
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 0x408c9f
push ebx
push eax
jmp 0x408cb9
push 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
cmp eax, 1
je 0x408cc8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebx
push 0x4018dc
lea eax, [ebp - 0x218]
push eax
call fcn.0040834d
add esp, 0xc
xor esi, esi
push 0x208
lea eax, [ebp - 0x422]
push esi
push eax
mov word [ebp - 0x424], si
call fcn.00406310
add esp, 0xc
lea eax, [ebp - 0x424]
push eax
push esi
push 0x4018d4
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 0x408d3f
push ebx
push esi
lea eax, [ebp - 0x424]
push eax
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
cmp eax, 0x105
ja 0x408d3f
test eax, eax
je 0x408d3f
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
je 0x408d3f
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x408d84
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea eax, [ebp - 0x424]
push eax
push eax
call fcn.00408b53
push ebx
lea eax, [ebp - 0x218]
push eax
push esi
call fcn.0040834d
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 0x408d84
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor al, al
jmp 0x408daf
push 0x4018f8
push esi
call edi
push esi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
cmp eax, 1
je 0x408d9e
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