Function at 0x402100
Capabilities:
Check if file exists
Create directory
Get common file path
Get file attributes
Terminate process

Disassembly:
sub esp, 0x230
mov eax, dword [0x46fc00]
xor eax, dword [esp + 0x230]
and dword [esp + 0x1c], 0
and word [esp + 0x24], 0
push ebx
push ebp
push esi
push edi
mov edi, 0x4075f0
mov dword [esp + 0x23c], eax
mov esi, edi
mov dword [esp + 0x18], 0xd
mov ebx, 0x208
mov ebp, 0x104
push ebp
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
lea eax, [esp + 0x34]
push eax
push 0x401488
push esi
call fcn.00402052
test eax, eax
jne 0x40217d
push ebp
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
lea eax, [esp + 0x34]
push eax
push 0x40146c
push esi
call fcn.00402052
add esi, ebx
dec dword [esp + 0x18]
jne 0x40213c
and dword [esp + 0x10], 0
mov ebp, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov esi, edi
and dword [esp + 0x14], 0
push ebx
push esi
call fcn.00401ea5
test eax, eax
jbe 0x4021db
mov edi, esi
cmp word [edi], 0x5c
jne 0x4021c8
and word [edi], 0
push esi
call ebp
cmp eax, 0xffffffff
je 0x4021ba
test al, 0x10
jne 0x4021c3
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov word [edi], 0x5c
inc dword [esp + 0x14]
push ebx
inc edi
push esi
inc edi
call fcn.00401ea5
cmp dword [esp + 0x14], eax
jb 0x4021a4
push esi
call ebp
cmp eax, 0xffffffff
je 0x4021e7
test al, 0x10
jne 0x4021f8
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
je 0x40229e
add dword [esp + 0x10], ebx
add esi, ebx
cmp dword [esp + 0x10], 0x1a68
jb 0x402192
and dword [esp + 0x10], 0
mov eax, dword [esp + 0x10]
and dword [esp + 0x14], 0
mov dword [esp + 0x1c], eax
mov ebx, dword [esp + 0x1c]
lea ebx, [ebx + 0x40932c]
cmp dword [ebx - 0x2d4], 0xffffffff
je 0x402358
push 7
pop ecx
mov edi, 0x40145c
mov esi, ebx
xor eax, eax
repe cmpsw word [esi], word es:[edi]
jne 0x402300
xor edi, edi
mov dword [esp + 0x18], edi
mov dword [esp + 0x20], 0x4068b8
mov dword [esp + 0x24], edi
cmp dword [esp + 0x18], 0
jne 0x4022d1
and dword [esp + 0x28], 0
mov esi, dword [esp + 0x20]
mov ebp, 0x104
push ebp
push esi
call fcn.00401ea5
test eax, eax
je 0x40228e
mov eax, dword [esp + 0x1c]
push esi
lea eax, [eax + 0x40933a]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpW]
test eax, eax
je 0x4022ab
inc dword [esp + 0x28]
add esi, 0x1a
cmp dword [esp + 0x28], 0xa
jb 0x402268
jmp 0x4022b7
mov dword [esp + 0x2c], 1
jmp 0x40236e
mov dword [esp + 0x30], edi
mov dword [esp + 0x18], 1
add dword [esp + 0x24], ebp
add dword [esp + 0x20], ebp
inc edi
cmp dword [esp + 0x24], 0xd34
jb 0x402258
cmp dword [esp + 0x18], 0
je 0x4022eb
mov eax, dword [esp + 0x30]
imul eax, eax, 0x208
add eax, 0x4075f0
push eax
push 0x64
push ebx
call fcn.00401c08
jmp 0x402341
cmp dword [0x46fbe0], 0
je 0x402341
push 0x401420
call fcn.00401faf
jmp 0x402341
mov esi, 0x104
push esi
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
lea eax, [esp + 0x34]
push eax
push 0x401488
push ebx
call fcn.00402052
test eax, eax
jne 0x402341
push esi
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
lea eax, [esp + 0x34]
push eax
push 0x40146c
push ebx
call fcn.00402052
inc dword [esp + 0x14]
add dword [esp + 0x1c], 0x39c
cmp dword [esp + 0x14], 0x1f
jb 0x40221a
add dword [esp + 0x10], 0x6fe4
cmp dword [esp + 0x10], 0x5ae94
jb 0x40220d
mov ecx, dword [esp + 0x23c]
mov eax, dword [esp + 0x2c]
xor ecx, dword [esp + 0x240]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x230
jmp fcn.00403138