Function at 0x4087f7
Capabilities:
Check if file exists
Create directory
Delete file
Get file attributes

Disassembly:
push 0x26c
mov eax, 0x4395ce
call fcn.004385bc
mov esi, ecx
xor ebx, ebx
mov dword [ebp - 0x268], ebx
mov dword [ebp - 0x274], ebx
mov dword [ebp - 0x270], ebx
mov dword [ebp - 0x26c], ebx
lea eax, [ebp - 0x264]
mov dword [ebp - 4], ebx
push eax
call fcn.00405a51
xor ecx, ecx
mov byte [ebp - 4], 1
inc ecx
cmp dword [eax + 0x14], 8
mov dword [ebp - 0x278], ecx
mov dword [ebp - 0x268], ecx
jb 0x40884c
mov eax, dword [eax]
push 0x2001f
push eax
push 0x80000001
lea ecx, [ebp - 0x274]
call fcn.00405e1e
test eax, eax
je 0x40889c
lea eax, [ebp - 0x24c]
mov ecx, esi
push eax
call fcn.00405a51
mov dword [ebp - 0x278], 3
cmp dword [eax + 0x14], 8
jb 0x408886
mov eax, dword [eax]
sub esp, 0x14
push eax
push ecx
lea ecx, [ebp - 0x274]
call fcn.004059ee
test eax, eax
je 0x40889c
mov bl, 1
xor esi, esi
test byte [ebp - 0x278], 2
je 0x4088b5
push esi
push 1
lea ecx, [ebp - 0x24c]
call fcn.004069d5
push esi
push 1
lea ecx, [ebp - 0x264]
mov dword [ebp - 4], esi
call fcn.004069d5
test bl, bl
je 0x4088da
lea ecx, [ebp - 0x274]
call fcn.00405e7c
jmp 0x408ab3
xor eax, eax
mov dword [ebp - 0x220], 7
mov dword [ebp - 0x224], esi
mov word [ebp - 0x234], ax
push 0x208
lea eax, [ebp - 0x21c]
mov byte [ebp - 4], 2
push esi
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov dword [ebp - 0x268], 0x103
lea eax, [ebp - 0x268]
lea ecx, [ebp - 0x274]
push eax
lea eax, [ebp - 0x21c]
push eax
push 0x4458c4
call fcn.00405d48
cmp word [ebp - 0x21c], 0
mov ebx, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcslen]
jne 0x408994
lea ecx, [ebp - 0x24c]
call fcn.0040f79e
push str.TempTxGameDownloadMobileGamePCShared
mov edx, eax
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x264]
call fcn.00405830
pop ecx
push eax
lea ecx, [ebp - 0x234]
call fcn.00405576
push esi
push 1
lea ecx, [ebp - 0x264]
call fcn.004069d5
push esi
push 1
lea ecx, [ebp - 0x24c]
mov byte [ebp - 4], 2
call fcn.004069d5
jmp 0x4089b1
lea eax, [ebp - 0x21c]
push eax
call ebx
pop ecx
push eax
lea eax, [ebp - 0x21c]
push eax
lea ecx, [ebp - 0x234]
call fcn.00405894
cmp dword [ebp - 0x220], 8
lea eax, [ebp - 0x234]
cmovae eax, dword [ebp - 0x234]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
lea eax, [ebp - 0x234]
je 0x408a11
cmp dword [ebp - 0x220], 8
cmovae eax, dword [ebp - 0x234]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0x10
je 0x408a5f
cmp dword [ebp - 0x220], 8
lea eax, [ebp - 0x234]
cmovae eax, dword [ebp - 0x234]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea eax, [ebp - 0x234]
cmp dword [ebp - 0x220], 8
mov edi, dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
cmovae eax, dword [ebp - 0x234]
push esi
push eax
push esi
call edi
test eax, eax
je 0x408a5f
mov esi, str.C:TempTxGameDownloadMobileGamePCShared
push esi
call ebx
pop ecx
push eax
push esi
lea ecx, [ebp - 0x234]
call fcn.00405894
cmp dword [ebp - 0x220], 8
lea eax, [ebp - 0x234]
cmovae eax, dword [ebp - 0x234]
xor esi, esi
push esi
push eax
push esi
call edi
lea edx, [ebp - 0x21c]
lea ecx, [ebp - 0x234]
call fcn.00404466
test al, al
jne 0x408a9a
cmp dword [ebp - 0x220], 8
lea eax, [ebp - 0x234]
push ecx
cmovae eax, dword [ebp - 0x234]
lea ecx, [ebp - 0x274]
push eax
push 0x4458c4
call fcn.00405cee
lea ecx, [ebp - 0x274]
call fcn.00405e7c
push esi
push 1
lea ecx, [ebp - 0x234]
call fcn.004069d5
lea ecx, [ebp - 0x274]
call fcn.00405e7c
call fcn.00438566
ret