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

Disassembly:
sub esp, 0x33c
push ebx
push ebp
mov ebp, dword [esp + 0x34c]
push esi
push edi
mov ebx, ecx
push ebp
push 0x104
mov dword [esp + 0x20], ebx
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
mov esi, dword [esp + 0x350]
lea eax, [esi + 0x40]
push eax
push ebp
call fcn.00471050
mov al, byte [esp + 0x360]
add esp, 8
test al, 2
je 0x406a5a
test al, 1
je 0x406dc0
mov edx, dword [ebx + 0x138]
xor eax, eax
mov ecx, dword [edx + 8]
test ecx, ecx
jle 0x406aa2
mov edx, dword [edx + 4]
cmp dword [edx], esi
je 0x406a7a
inc eax
add edx, 4
cmp eax, ecx
jl 0x406a6c
jmp 0x406aa2
test eax, eax
jl 0x406aa2
mov ecx, dword [ebx + 0x13c]
xor edx, edx
add ecx, eax
mov dl, byte [ecx]
cmp edx, 0xffffffff
je 0x406aa2
mov eax, dword [esp + 0x358]
and al, 4
neg al
sbb al, al
and al, 0xfe
inc al
mov byte [ecx], al
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x38]
push ecx
push edx
push ebp
call fcn.00470f00
add esp, 0xc
test eax, eax
je 0x406aeb
mov eax, dword [esi + 0x34]
mov edx, dword [esp + 0x1c]
xor ecx, ecx
cmp edx, eax
jne 0x406aeb
mov eax, dword [esp + 0x20]
cmp eax, ecx
jne 0x406aeb
lea edi, [esi + 0x38]
mov ecx, 2
lea esi, [esp + 0x38]
xor edx, edx
repe cmpsd dword [esi], dword es:[edi]
je 0x406dc0
mov esi, dword [esp + 0x350]
mov al, byte [0x4f55a8]
mov ecx, 0x40
mov byte [esp + 0x144], al
xor eax, eax
lea edi, [esp + 0x145]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea ecx, [esp + 0x144]
push ecx
push ebp
stosb byte es:[edi], al
call fcn.00471240
add esp, 8
lea edx, [esp + 0x144]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x406cff
mov al, byte [0x4f55a8]
mov ecx, 0x40
mov byte [esp + 0x40], al
xor eax, eax
lea edi, [esp + 0x41]
lea edx, [esp + 0x248]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea ecx, [esp + 0x144]
push ecx
push edx
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [esp + 0x248]
push 0x4ed924
push eax
call fcn.004a88ee
lea edx, [esp + 0x14c]
mov esi, eax
mov ecx, 0x4ed920
add esp, 8
mov ax, word [edx]
cmp ax, word [ecx]
jne 0x406bb2
push esi
lea ecx, [esp + 0x44]
push 0x4ed918
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
push 0x4ed924
push 0
call fcn.004a88ee
add esp, 0x14
mov dword [esp + 0x10], eax
mov esi, eax
test esi, esi
je 0x406cf8
jmp 0x406bc0
mov esi, dword [esp + 0x10]
mov al, byte [esp + 0x40]
test al, al
jne 0x406bd2
cmp byte [esp + 0x144], 0x5c
jne 0x406be2
lea edx, [esp + 0x40]
push 0x4ed924
push edx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea eax, [esp + 0x40]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
push 0x4ed924
push 0
call fcn.004a88ee
mov dword [esp + 0x18], eax
mov al, byte [esp + 0x48]
add esp, 8
test al, al
je 0x406cec
lea ecx, [esp + 0x40]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp byte [esp + eax + 0x3f], 0x3a
je 0x406cec
lea edx, [esp + 0x40]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x406cec
lea eax, [esp + 0x40]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
je 0x406db1
test byte [esp + 0x358], 4
jne 0x406cec
lea ecx, [esp + 0x40]
push ecx
call fcn.00470f80
mov ebp, dword [ebx + 0x150]
add esp, 4
test eax, eax
mov dword [esp + 0x14], eax
je 0x406ce5
mov ecx, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
lea edx, [ecx + 1]
cmp esi, edx
jne 0x406cd5
mov eax, dword [ebp + 0x14]
add eax, ecx
lea ecx, [eax*4 + 4]
push ecx
call fcn.004bd49b
mov edx, dword [ebp + 0xc]
mov esi, dword [ebp + 4]
mov ebx, eax
lea ecx, [edx*4 + 4]
mov edi, ebx
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp + 4]
push ecx
call fcn.004bd4c4
mov edx, dword [ebp + 0x14]
mov eax, dword [ebp + 0xc]
add esp, 8
add eax, edx
mov dword [ebp + 4], ebx
mov ebx, dword [esp + 0x18]
mov dword [ebp + 0xc], eax
mov eax, dword [esp + 0x14]
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 4]
mov dword [edx + ecx*4], eax
mov eax, dword [ebp + 8]
inc eax
mov dword [ebp + 8], eax
mov ebp, dword [esp + 0x354]
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x406bbc
mov esi, dword [esp + 0x350]
push ebp
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov eax, dword [esp + 0x35c]
mov ecx, dword [esp + 0x360]
lea edx, [esp + 0x24]
mov dword [esp + 0x30], eax
mov eax, dword [ebx + 0x148]
push edx
xor edi, edi
mov dword [esp + 0x38], ecx
mov ecx, dword [ebx + 0x134]
push esi
push eax
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], ebp
mov dword [esp + 0x38], edi
call fcn.0048dd50
test eax, eax
je 0x406d55
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x33c
ret 0x14
push edi
push 0x80
push 3
push edi
push 3
push 0xc0000000
push ebp
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x406d90
mov ecx, dword [esp + 0x350]
add ecx, 0x38
push ecx
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test byte [esp + 0x358], 1
je 0x406dc0
push 1
push 0x3e80005
push ebp
push ebp
push 0
call fcn.00474a30
add esp, 0x14
test eax, eax
jge 0x406dc0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x33c
ret 0x14
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x33c
ret 0x14