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

Disassembly:
sub esp, 0x324
push ebx
push ebp
push esi
push edi
mov esi, ecx
call sub.MFC42.DLL_AfxGetModuleState
mov eax, dword [eax + 4]
test eax, eax
mov dword [esp + 0x18], eax
je 0x500512
mov ebp, dword [esp + 0x338]
test ebp, ebp
je 0x500512
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esi + 0x9c]
xor edi, edi
test eax, eax
jle 0x5005f2
xor ebx, ebx
mov eax, dword [esi + 0x98]
add eax, ebx
push eax
push ebp
call dword [sym.imp.MSVCRT.dll__stricmp]
add esp, 8
test eax, eax
je 0x500495
mov eax, dword [esi + 0x9c]
inc edi
add ebx, 0x80
cmp edi, eax
jl 0x500468
jmp 0x5005d7
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::CString_2
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::CString_2
lea ecx, [esp + 0x10]
push ecx
mov ecx, dword [0x5a0f78]
push 0x1426
call fcn.004c27f0
mov edx, dword [esi + 0x98]
mov eax, dword [esp + 0x10]
mov ebx, edi
lea ecx, [esp + 0x14]
shl ebx, 7
add edx, ebx
push edx
push eax
push ecx
call sub.MFC42.DLL_CString::Format
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x14]
push 0x24
push 0x5a24a4
mov ecx, dword [eax + 0x20]
push edx
call sub.MFC42.DLL_CWnd::MessageBoxA
cmp eax, 6
je 0x500521
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::CString
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x324
ret 4
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ebp, dword [esi + 0x98]
add ebp, ebx
je 0x5005be
push ebp
push 0x5965b8
push str._sprofiles_s.
lea ecx, [esp + 0x28]
push 0xff
push ecx
call dword [sym.imp.MSVCRT.dll__snprintf]
lea edx, [esp + 0x230]
lea eax, [esp + 0x30]
push edx
push eax
call dword [sym.imp.MSVCRT.dll__findfirst]
mov ebx, eax
add esp, 0x1c
test ebx, ebx
jl 0x5005be
lea ecx, [esp + 0x230]
lea edx, [esp + 0x1c]
push ecx
push ebp
push 0x5965b8
push str._sprofiles_s_s
push 0xff
push edx
call dword [sym.imp.MSVCRT.dll__snprintf]
add esp, 0x18
lea eax, [esp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
lea ecx, [esp + 0x21c]
push ecx
push ebx
call dword [sym.imp.MSVCRT.dll__findnext]
add esp, 8
test eax, eax
je 0x50056d
push ebx
call dword [sym.imp.MSVCRT.dll__findclose]
add esp, 4
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::CString
mov ebp, dword [esp + 0x338]
cmp edi, 0x64
jl 0x5005f2
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x324
ret 4
mov eax, dword [esi + 0x9c]
mov ebx, dword [sym.imp.MSVCRT.dll_strncpy]
cmp edi, eax
jne 0x500648
mov edx, dword [esi + 0x98]
push 0x7f
shl edi, 7
add edx, edi
push ebp
push edx
call ebx
mov eax, dword [esi + 0x98]
mov byte [eax + edi + 0x7f], 0
mov ecx, dword [esi + 0x98]
movsx edx, byte [ecx + edi]
push edx
call dword [sym.imp.MSVCRT.dll_toupper]
mov ecx, dword [esi + 0x98]
add esp, 0x10
mov byte [ecx + edi], al
mov eax, dword [esi + 0x9c]
inc eax
mov dword [esi + 0x9c], eax
push ebp
push 0x5965b8
push str._sprofiles_s
lea edx, [esp + 0x128]
push 0xff
push edx
call dword [sym.imp.MSVCRT.dll__snprintf]
add esp, 0x14
lea eax, [esp + 0x11c]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x50068c
lea ecx, [esp + 0x11c]
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
push 0x7f
lea edx, [esi + 0x18]
push ebp
push edx
call ebx
add esp, 0xc
mov byte [esi + 0x97], 0
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 0
push 0x8182
push 0x111
mov eax, dword [0x5a0c30]
push eax
call dword [sym.imp.USER32.dll_PostMessageA]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x324
ret 4