Function at 0x403310
Capabilities:
Check if file exists
Create directory
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xbc4
mov eax, dword [0x4a2300]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0x257
lea eax, [ebp - 0x70f]
mov byte [ebp - 0x710], 0
push 0
push eax
call fcn.00451650
add esp, 0xc
lea eax, [ebp - 0x710]
push eax
push 0
push 0
push 0x1a
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathA]
test eax, eax
jne 0x403758
lea edi, [ebp - 0x710]
dec edi
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x403367
mov ax, word [0x480958]
lea ecx, [ebp - 0x710]
mov word [edi], ax
dec ecx
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x403381
mov eax, dword [str.iGameDX]
mov ebx, dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
mov dword [ecx], eax
mov eax, dword [0x480960]
mov dword [ecx + 4], eax
lea eax, [ebp - 0x710]
push eax
call ebx
test eax, eax
jne 0x4033bb
push eax
lea eax, [ebp - 0x710]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
lea eax, [ebp - 0x710]
push eax
call ebx
test eax, eax
je 0x403758
push 0x257
lea eax, [ebp - 0x25f]
mov byte [ebp - 0x260], 0
push 0
push eax
call fcn.00451650
lea edi, [ebp - 0x260]
add esp, 0xc
dec edi
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x4033f0
mov ax, word [0x480958]
mov edx, 0x6ae4cc
mov word [edi], ax
mov esi, edx
lea ebx, [ebx]
mov al, byte [edx]
inc edx
test al, al
jne 0x403410
lea edi, [ebp - 0x260]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x403420
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [ebp - 0x260]
dec ecx
lea ecx, [ecx]
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x403440
mov eax, dword [str..exe]
mov dword [ecx], eax
mov al, byte [0x480968]
push 0x257
mov byte [ecx + 4], al
lea eax, [ebp - 0x4b7]
push 0
push eax
mov byte [ebp - 0x4b8], 0
call fcn.00451650
lea edx, [ebp - 0x710]
add esp, 0xc
mov esi, edx
mov edi, edi
mov al, byte [edx]
inc edx
test al, al
jne 0x403480
lea edi, [ebp - 0x4b8]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x403490
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x4b8]
dec edi
lea ecx, [ecx]
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x4034b0
mov ax, word [0x480958]
mov edx, 0x6ae3e4
mov word [edi], ax
mov esi, edx
lea ebx, [ebx]
mov al, byte [edx]
inc edx
test al, al
jne 0x4034d0
lea edi, [ebp - 0x4b8]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4034e0
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push 0x258
and ecx, 3
push 0
rep movsb byte es:[edi], byte [esi]
push 0x6af5b4
call fcn.00451650
lea edx, [ebp - 0x4b8]
add esp, 0xc
mov esi, edx
mov al, byte [edx]
inc edx
test al, al
jne 0x403512
mov edi, 0x6af5b4
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x403521
mov ecx, edx
lea eax, [ebp - 0x4b8]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push eax
call ebx
test eax, eax
jne 0x403552
push eax
lea eax, [ebp - 0x4b8]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
lea eax, [ebp - 0x4b8]
push eax
call ebx
test eax, eax
je 0x403758
push 0x257
lea eax, [ebp - 0x967]
mov byte [ebp - 0x968], 0
push 0
push eax
call fcn.00451650
lea edx, [ebp - 0x710]
add esp, 0xc
mov esi, edx
mov al, byte [edx]
inc edx
test al, al
jne 0x403588
lea edi, [ebp - 0x968]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x403598
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x968]
dec edi
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x4035b5
mov ax, word [0x480958]
mov edx, 0x6ae3e4
mov word [edi], ax
mov esi, edx
nop
mov al, byte [edx]
inc edx
test al, al
jne 0x4035d0
lea edi, [ebp - 0x968]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4035e0
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [ebp - 0x260]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, edx
mov edi, edi
mov al, byte [edx]
inc edx
test al, al
jne 0x403600
lea edi, [ebp - 0x968]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x403610
mov ecx, edx
mov byte [ebp - 0xbc0], al
shr ecx, 2
lea eax, [ebp - 0xbbf]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push 0x257
and ecx, 3
push 0
rep movsb byte es:[edi], byte [esi]
push eax
call fcn.00451650
add esp, 0xc
lea eax, [ebp - 0xbc0]
push 0x258
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0x258
push 0
push 0x4a6890
call fcn.00451650
lea ebx, [ebp - 0x4b8]
add esp, 0xc
mov esi, ebx
mov al, byte [ebx]
inc ebx
test al, al
jne 0x403672
mov edx, 0x4a6890
sub ebx, esi
lea edi, [edx - 1]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x403683
mov ecx, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [edx - 1]
lea esp, [esp]
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x4036a0
mov ax, word [0x480958]
dec edx
mov word [edi], ax
mov al, byte [edx + 1]
lea edx, [edx + 1]
test al, al
jne 0x4036b4
cmp dword [0x6ae3e0], 1
mov eax, dword [str.iGameDX.ini]
mov dword [edx], eax
mov eax, dword [0x480970]
mov dword [edx + 4], eax
mov eax, dword [0x480974]
mov dword [edx + 8], eax
jne 0x40376b
push 0x257
lea eax, [ebp - 0x25f]
mov byte [ebp - 0x260], 0
push 0
push eax
call fcn.00451650
add esp, 0xc
lea eax, [ebp - 0x260]
push 0x258
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [ebp - 0x260]
push 0x5c
push eax
call fcn.00456990
add esp, 8
test eax, eax
je 0x40373c
lea eax, [ebp - 0x260]
push 0x5c
push eax
call fcn.00456990
add esp, 8
mov byte [eax], 0
push 0x4a6890
lea eax, [ebp - 0x260]
push eax
push str.Start
push str.PATH
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringA]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0045094b
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x968]
push eax
lea eax, [ebp - 0xbc0]
push eax
call fcn.00456643
add esp, 8
test eax, eax
je 0x403758
lea ecx, [ebp - 0x4b8]
call fcn.00402f90
lea eax, [ebp - 0x968]
push eax
lea ecx, [ebp - 0xbc0]
call fcn.004030a0
mov ecx, dword [ebp - 4]
add esp, 4
xor ecx, ebp
mov eax, 1
pop edi
pop esi
pop ebx
call fcn.0045094b
mov esp, ebp
pop ebp
ret