Function at 0x100003120
Capabilities:
Accept command line arguments
Check if file exists
Create directory
Get common file path
Get file attributes
Set current directory

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xce0
mov rax, qword [0x10009e100]
xor rax, rsp
mov qword [rsp + 0xcd0], rax
mov rbp, rcx
or r14, 0xffffffffffffffff
xor eax, eax
mov rcx, r14
mov rdi, rbp
mov ebx, r8d
repne scasw ax, word [rdi]
mov r13b, dl
xor edx, edx
not rcx
mov r12b, r9b
mov dword [rsp + 0x40], ebx
dec rcx
mov r15, rcx
test ecx, ecx
je 0x10000318e
mov rax, rbp
cmp word [rax], 0x3a
je 0x100031b9f
inc edx
add rax, 2
cmp edx, ecx
jb 0x10000317a
cmp word [rbp], 0x2e
je 0x100031e13
cmp word [rbp], 0x2f
je 0x100031e13
cmp word [rbp], 0x5c
je 0x100031e13
mov edi, 0x104
lea rcx, [rsp + 0xac0]
xor edx, edx
mov r8, rdi
call sub.msvcrt.dll_memset
lea rdx, [rsp + 0xac0]
xor r9d, r9d
mov qword [rsp + 0x20], rdx
xor r8d, r8d
xor ecx, ecx
mov edx, ebx
call qword [sym.imp.SHELL32.dll_SHGetFolderPathW]
lea rcx, [rsp + 0x490]
mov r8, rdi
xor edx, edx
call sub.msvcrt.dll_memset
lea rdx, [rsp + 0x490]
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
lea rcx, [rsp + 0xac0]
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
mov edx, ebx
and edx, 0x28
cmp dl, 0x28
je 0x1000033ad
lea rsi, str.Microsoft_Games
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
mov ebx, 0x80
test eax, eax
je 0x1000241b3
mov rsi, qword [0x10009e158]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
test eax, eax
jne 0x10000419f
call sub.KERNEL32.dll_GetLastError
cmp eax, 2
jne 0x100031c75
test r13b, r13b
je 0x1000040e3
lea rcx, [rsp + 0x490]
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
jmp 0x10000327d
mov rax, r14
mov rcx, qword [rsp + 0xcd0]
xor rcx, rsp
call fcn.1000024e0
mov rbx, qword [rsp + 0xd38]
add rsp, 0xce0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
lea r9, [rsp + 0x270]
lea rcx, [0x10007ca20]
xor r8d, r8d
xor edx, edx
mov dword [rsp + 0x20], edi
call sub.SHELL32.dll_SHGetFolderPathEx
test eax, eax
js 0x100031bab
lea rcx, [rsp + 0x270]
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
nop
jmp 0x100003221
xor edx, edx
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
je 0x100031ca3
test r12b, r12b
je 0x10000418e
lea rdx, [rsp + 0x270]
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
test eax, eax
je 0x100031b74
lea rdx, [rsp + 0x270]
lea rcx, [rsp + 0x270]
mov r8, rsi
call qword [sym.imp.SHLWAPI.dll_PathCombineW]
test rax, rax
je 0x100031bd2
call qword [sym.imp.KERNEL32.dll_GetCommandLineW]
test rax, rax
je 0x10000418e
lea rdx, [rsp + 0x44]
mov rcx, rax
call qword [sym.imp.SHELL32.dll_CommandLineToArgvW]
mov rdi, rax
test rax, rax
je 0x10000418e
cmp dword [rsp + 0x44], 0
jle 0x100004185
mov r8d, dword [rsp + 0xd40]
mov rdx, qword [rax]
lea rcx, [rsp + 0x270]
call qword [sym.imp.SHELL32.dll_SHSetLocalizedName]
mov r12d, eax
test eax, eax
js 0x100031c45
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
test eax, eax
je 0x100031c75
xor esi, esi
xor edi, edi
mov r14, rbp
test r15d, r15d
je 0x1000041d1
mov r12, rbp
cmp word [r12], 0x5c
je 0x100031cc1
cmp word [r12], 0x2f
je 0x100031cc1
inc edi
add r12, 2
cmp edi, r15d
jb 0x1000041ae
test esi, esi
jne 0x100031d6f
mov esi, 0x104
lea rcx, [rsp + 0x8b0]
mov r8, rbp
mov rdx, rsi
call sub.msvcrt.dll_wcscpy_s
test r13b, r13b
jne 0x10000420d
lea r8, str..tmp
lea rcx, [rsp + 0x8b0]
mov rdx, rsi
call sub.msvcrt.dll_wcscat_s
mov al, r13b
neg al
mov al, r13b
sbb ecx, ecx
neg ecx
add ecx, 2
neg al
sbb edx, edx
and qword [rsp + 0x30], 0
mov dword [rsp + 0x28], ebx
not edx
mov dword [rsp + 0x20], ecx
lea rcx, [rsp + 0x8b0]
and edx, 0x40000000
xor r9d, r9d
xor r8d, r8d
bts edx, 0x1f
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
cmp rax, 0xffffffffffffffff
je 0x100031d8a
lea rcx, [rsp + 0x490]
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
test r13b, r13b
jne 0x100004325
lea rcx, [rsp + 0x27c]
mov r8, rbp
mov rdx, rsi
call sub.msvcrt.dll_wcscpy_s
mov eax, dword [rsp + 0x40]
mov ebx, 0x218
lea rcx, [rsp + 0x50]
lea rdx, [rsp + 0x270]
mov r8, rbx
mov dword [rsp + 0x278], eax
mov qword [rsp + 0x270], rdi
call sub.msvcrt.dll_memcpy
mov eax, dword [0x10009e3b8]
mov ecx, dword [0x10009e3bc]
inc eax
mov dword [0x10009e3b8], eax
cmp eax, ecx
jbe 0x100024d20
add ecx, dword [0x10009e3c0]
mov edx, ecx
mov dword [0x10009e3bc], ecx
mov rcx, qword [0x10009e3c8]
imul rdx, rdx, 0x218
call qword [sym.imp.msvcrt.dll_realloc]
mov rdx, rax
test rax, rax
je 0x100031e07
mov qword [0x10009e3c8], rax
mov eax, dword [0x10009e3b8]
jmp 0x10000430b
lea ecx, [rax - 1]
mov r8, rbx
imul rcx, rcx, 0x218
add rcx, rdx
lea rdx, [rsp + 0x50]
call sub.msvcrt.dll_memcpy
mov rax, rdi
jmp 0x100003280
call sub.KERNEL32.dll_GetLastError
cmp eax, 2
jne 0x100031c32
lea r9, str.Microsoft_Games_directory_not_found___creating
lea r8, str.SaveFS.cpp
mov edx, 0x18b
mov ecx, ebx
call fcn.100002c98
xor edx, edx
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
je 0x100031c1f
test r12b, r12b
je 0x100024257
lea rdx, [rsp + 0x270]
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
test eax, eax
je 0x100031b74
lea rdx, [rsp + 0x270]
lea rcx, [rsp + 0x270]
mov r8, rsi
call qword [sym.imp.SHLWAPI.dll_PathCombineW]
test rax, rax
je 0x100031bd2
lea rdx, str._SystemRoot_System32gameux.dll
lea rcx, [rsp + 0x270]
mov r8d, 0x273e
call qword [sym.imp.SHELL32.dll_SHSetLocalizedName]
mov edi, eax
test eax, eax
js 0x100031bf3
mov edi, 0x104
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
test eax, eax
jne 0x10000323e
jmp 0x100031c0a
mov rdx, qword [0x10009e3c8]
jmp 0x10000430b
call sub.KERNEL32.dll_GetLastError
lea rcx, [rsp + 0x490]
mov edi, eax
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
lea rdx, str.Unable_to_get_current_directory:_Error__d
mov r8d, edi
mov ecx, ebx
call fcn.100002470
jmp 0x10000327d
lea rdx, str.FileNames_cannot_have_colons_in_them:__s
jmp 0x100031e1a
lea r9, str.Couldnt_set_into_the_Saved_Games_directory.__WinError:__d_
mov edx, 0x156
mov ecx, 0x80
lea r8, str.SaveFS.cpp
mov dword [rsp + 0x20], eax
call fcn.100002c98
nop
jmp 0x10000326d
lea rcx, [rsp + 0x490]
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
lea rdx, str.Unable_to_combine_path.
mov ecx, ebx
call fcn.100002470
jmp 0x10000327d
lea rcx, [rsp + 0x490]
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
lea rdx, str.Unable_to_localize_Microsoft_Games:_Error__d
jmp 0x100031b90
call sub.KERNEL32.dll_GetLastError
lea r9, str.After_creating_the_Microsoft_Games_folder__unable_to_go_into_it.__WinError:__d_
mov edx, 0x1b8
mov ecx, ebx
jmp 0x100031bbc
call sub.KERNEL32.dll_GetLastError
lea r9, str.Unable_to_create_Microsoft_Games_folder__WinError:__d_
mov edx, 0x1af
jmp 0x100031c1b
call sub.KERNEL32.dll_GetLastError
lea r9, str.Couldnt_set_into_the_Microsoft_Games_directory.__WinError:__d_
mov edx, 0x1c2
jmp 0x100031c1b
lea rcx, [rsp + 0x490]
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
lea rdx, str.Unable_to_localize_name_of_subdirectory__s_in_special_folder:_Error__d
mov r9d, r12d
mov r8, rsi
mov ecx, ebx
call fcn.100002470
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x10000327d
call sub.KERNEL32.dll_GetLastError
lea rcx, [rsp + 0x490]
mov edi, eax
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
lea rdx, str.Unable_to_set_current_directory_to_special_path:__s__Error__d_
mov r8, rsi
mov r9d, edi
mov ecx, ebx
call fcn.100002470
jmp 0x10000327d
call sub.KERNEL32.dll_GetLastError
lea rcx, [rsp + 0x490]
mov edi, eax
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
lea rdx, str.Unable_to_create_subdirectory__s_in_special_folder:_Error__d
jmp 0x100031c91
mov rax, r14
mov r9d, edi
lea rcx, [rsp + 0x6a0]
sub rax, rbp
mov r8, r14
mov edx, 0x104
sar rax, 1
sub r9, rax
call sub.msvcrt.dll_wcsncpy_s
lea rcx, [rsp + 0x6a0]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x100031d4f
test r13b, r13b
jne 0x100031da3
call sub.KERNEL32.dll_GetLastError
cmp eax, 2
jne 0x100031d53
lea rcx, [rsp + 0x6a0]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x100031d53
call sub.KERNEL32.dll_GetLastError
lea rcx, [rsp + 0x490]
mov edi, eax
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
lea r8, [rsp + 0x6a0]
lea rdx, str.Unable_to_create_subdirectory:__s__Error__d_
mov r9d, edi
mov ecx, ebx
call fcn.100002470
jmp 0x100031db1
test al, 0x10
je 0x100031dba
lea rcx, [rsp + 0x6a0]
inc esi
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
lea edx, [rdi + 1]
lea r14, [r14 + rdx*2]
jmp 0x1000041c6
mov edi, esi
lea rcx, [0x10008cad8]
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
sub rdi, 1
je 0x1000041d9
jmp 0x100031d71
test r13b, r13b
je 0x100031de3
call sub.KERNEL32.dll_GetLastError
cmp eax, 2
jne 0x100031de3
lea rcx, [rsp + 0x490]
jmp 0x100031dab
lea rcx, [rsp + 0x6a0]
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
or rax, 0xffffffffffffffff
jmp 0x100003280
lea rcx, [rsp + 0x490]
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
lea r9, [rsp + 0x6a0]
lea rdx, str.Subdirectory_in_special_folder_is_a_file__not_a_directory:__s___s
mov r8, rbp
mov ecx, ebx
call fcn.100002470
jmp 0x100031db1
call sub.KERNEL32.dll_GetLastError
lea rcx, [rsp + 0x490]
mov edi, eax
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
mov r8, rbp
lea rdx, str.Unable_to_create_file:__s__Error__d_
jmp 0x100031d43
xor ecx, ecx
call fcn.10000a0c0
jmp 0x100004325
lea rdx, str.FileNames_cannot_start_with_a_slash_or_a_period:__s
mov r8, rbp
mov ecx, 0x80
call fcn.100002470
nop
jmp 0x10000327d