Function at 0x401b6f
Capabilities:
Check if file exists
Create directory
Read .ini file

Disassembly:
mov eax, 0x40b33c
call fcn.0040adc0
sub esp, 0x54c
push ebx
mov dword [ebp - 0x20], ecx
push esi
push edi
lea ecx, [ebp - 0x44]
call sub.MFC42.DLL_CFile::CFile
push 0x40
xor ebx, ebx
pop ecx
xor eax, eax
lea edi, [ebp - 0x453]
mov byte [ebp - 0x454], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x454]
push 0x104
push eax
push ebx
mov dword [ebp - 4], ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov esi, 0x40f7f8
push 0x40f7f4
mov ecx, esi
call sub.MFC42.DLL_CString::operator_1
add esi, 4
cmp esi, 0x40f820
jl 0x401bc0
push ecx
lea eax, [ebp - 0x454]
mov ecx, esp
mov dword [ebp - 0x18], esp
push eax
mov dword [0x40f904], ebx
call fcn.0040abe4
mov ecx, dword [ebp - 0x20]
call fcn.004028d9
cmp eax, ebx
jne 0x401c51
lea ecx, [ebp - 0x20]
call sub.MFC42.DLL_CString::CString_2
push dword [0x40f82c]
lea eax, [ebp - 0x20]
mov byte [ebp - 4], 1
push 0x40f328
push eax
call sub.MFC42.DLL_CString::Format
add esp, 0xc
lea eax, [ebp - 0x20]
push ebx
push ecx
mov ecx, esp
mov dword [ebp - 0x18], esp
push eax
call sub.MFC42.DLL_CString::CString_1
call fcn.00402ef6
pop ecx
push eax
push 0x40d
push dword [0x40f908]
call dword [sym.imp.USER32.dll_PostMessageA]
mov byte [ebp - 4], bl
lea ecx, [ebp - 0x20]
jmp 0x4022e0
mov esi, dword [sym.imp.USER32.dll_PostMessageA]
xor edi, edi
cmp dword [0x40f904], ebx
jle 0x402000
mov dword [ebp - 0x24], 0x40f7f8
lea ecx, [ebp - 0x1c]
call sub.MFC42.DLL_CString::CString_2
push dword [0x40f904]
lea eax, [edi + 1]
mov dword [ebp - 0x18], eax
mov byte [ebp - 4], 2
push eax
lea eax, [ebp - 0x1c]
push 0x40f304
push eax
call sub.MFC42.DLL_CString::Format
add esp, 0x10
lea eax, [ebp - 0x1c]
push ebx
push ecx
mov ecx, esp
mov dword [ebp - 0x10], esp
push eax
call sub.MFC42.DLL_CString::CString_1
call fcn.00402ef6
pop ecx
push eax
push 0x411
push dword [0x40f908]
call esi
push dword [ebp - 0x24]
mov ecx, 0x40f82c
call sub.MFC42.DLL_CString::operator
push ecx
mov ecx, esp
mov dword [ebp - 0x10], esp
push str.qgiinstall.cfg
call fcn.0040abe4
mov eax, dword [ebp - 0x20]
lea ecx, [eax + 4]
call fcn.004014ef
cmp eax, ebx
je 0x40205e
push 0x40f7f4
lea ecx, [ebp - 0x14]
call fcn.0040abe4
push dword [0x40f838]
lea eax, [ebp - 0x14]
mov byte [ebp - 4], 4
push dword [0x40f830]
push str._s_s.cfg
push eax
call sub.MFC42.DLL_CString::Format
add esp, 0x10
lea eax, [ebp - 0x14]
mov ecx, 0x40f828
push eax
call sub.MFC42.DLL_CString::operator
push dword [ebp - 0x14]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
cmp eax, 1
jne 0x40209f
push 0x40
xor eax, eax
pop ecx
lea edi, [ebp - 0x24b]
mov byte [ebp - 0x24c], bl
push ebx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea ecx, [ebp - 0x14]
stosb byte es:[edi], al
call sub.MFC42.DLL_CString::GetBuffer
push eax
lea eax, [ebp - 0x24c]
push 0x104
push eax
push 0x40f7f4
mov edi, str.VerInfo
push str.DestRootFolder
push edi
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
lea eax, [ebp - 0x24c]
push eax
call sub.MSVCRT.dll_strlen
test eax, eax
pop ecx
jbe 0x4020e0
push ebx
lea ecx, [ebp - 0x14]
call sub.MFC42.DLL_CString::GetBuffer
push eax
push ebx
push str.UpdateFileNum
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntA]
call edi
cmp eax, ebx
je 0x402121
push ebx
push eax
push 0x40b
push dword [0x40f908]
call esi
lea eax, [ebp - 0x24c]
push eax
push dword [0x40f834]
push str._s_s_
push 0x40f824
call sub.MFC42.DLL_CString::Format
add esp, 0x10
push ebx
push dword [0x40f824]
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
jne 0x401e04
push dword [0x40f824]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
cmp eax, 1
jne 0x402162
push ecx
mov ecx, esp
mov dword [ebp - 0x10], esp
push 0x40f7f4
call fcn.0040abe4
mov eax, dword [ebp - 0x20]
lea ecx, [eax + 4]
call fcn.004014ef
cmp eax, ebx
je 0x4021b5
push str.config.ini
lea eax, [ebp - 0x28]
push 0x40f824
push eax
call sub.MFC42.DLL_operator
push dword [ebp - 0x28]
mov byte [ebp - 4], 0xa
push ebx
push str.PackVersion
push str.Public
call edi
push dword [ebp - 0x28]
mov dword [ebp - 0x30], eax
push ebx
push str.CommonPackID
push str.Public
call edi
cmp eax, ebx
mov dword [ebp - 0x10], eax
jne 0x401e89
cmp dword [ebp - 0x30], ebx
jne 0x401e89
mov ecx, dword [ebp - 0x20]
lea eax, [ebp - 0x24c]
push eax
call fcn.004026d0
test eax, eax
je 0x4021f6
jmp 0x401fb2
push str.GamesConfig.ini
lea eax, [ebp - 0x2c]
push 0x40f834
push eax
call sub.MFC42.DLL_operator
push 0x40
xor eax, eax
pop ecx
lea edi, [ebp - 0x34f]
mov byte [ebp - 0x350], bl
push dword [ebp - 0x28]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x350]
push 0x104
push eax
push 0x40f7f4
push str.DestRootFolder
push str.QgiMustHave
mov byte [ebp - 4], 0xc
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
push 0x40
xor eax, eax
pop ecx
lea edi, [ebp - 0x147]
mov byte [ebp - 0x148], bl
push dword [ebp - 0x10]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x148]
push str.Folder_d
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0xc
lea eax, [ebp - 0x350]
push dword [ebp - 0x2c]
push eax
lea eax, [ebp - 0x148]
push eax
push str.GameCommonRes
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringA]
test eax, eax
je 0x402237
push 0x40
xor eax, eax
pop ecx
lea edi, [ebp - 0x557]
mov byte [ebp - 0x558], bl
push dword [ebp - 0x30]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov edi, dword [sym.imp.MSVCRT.dll_sprintf]
lea eax, [ebp - 0x558]
push 0x40f254
push eax
call edi
push 0x104
lea eax, [ebp - 0x148]
push ebx
push eax
call sub.MSVCRT.dll_memset
add esp, 0x18
lea eax, [ebp - 0x148]
push dword [ebp - 0x10]
push 0x40f250
push eax
call edi
add esp, 0xc
lea eax, [ebp - 0x558]
push dword [ebp - 0x2c]
push eax
lea eax, [ebp - 0x148]
push eax
push str.GameCommonRes
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringA]
test eax, eax
je 0x402275
lea ecx, [ebp - 0x2c]
mov byte [ebp - 4], 0xa
call sub.MFC42.DLL_CString::CString
push ecx
mov ecx, esp
mov dword [ebp - 0x10], esp
push 0x40f824
call sub.MFC42.DLL_CString::CString_1
mov ecx, dword [ebp - 0x20]
call fcn.004022f8
lea ecx, [ebp - 0x28]
mov byte [ebp - 4], 4
call sub.MFC42.DLL_CString::CString
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 2
call sub.MFC42.DLL_CString::CString
lea ecx, [ebp - 0x1c]
mov byte [ebp - 4], bl
call sub.MFC42.DLL_CString::CString
mov edi, dword [ebp - 0x18]
add dword [ebp - 0x24], 4
cmp edi, dword [0x40f904]
jl 0x401c6c
push 0x40f7f4
lea ecx, [ebp - 0x34]
call fcn.0040abe4
push ebx
push ecx
lea eax, [ebp - 0x34]
mov ecx, esp
mov dword [ebp - 0x18], esp
push eax
mov byte [ebp - 4], 0xf
call sub.MFC42.DLL_CString::CString_1
call fcn.00402ef6
pop ecx
push eax
push 0x411
push dword [0x40f908]
call esi
lea ecx, [ebp - 0x34]
mov byte [ebp - 4], bl
call sub.MFC42.DLL_CString::CString
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x44]
call fcn.0040ac20
push 1
pop eax
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
leave
ret
push 0x40f234
lea ecx, [ebp - 0x10]
call fcn.0040abe4
push ebx
push ecx
lea eax, [ebp - 0x10]
mov ecx, esp
mov dword [ebp - 0x18], esp
push eax
mov byte [ebp - 4], 3
call sub.MFC42.DLL_CString::CString_1
call fcn.00402ef6
pop ecx
push eax
push 0x40d
push dword [0x40f908]
call esi
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x10]
jmp 0x4022d5
push 0x40f218
lea ecx, [ebp - 0x10]
call fcn.0040abe4
push ebx
push ecx
lea eax, [ebp - 0x10]
mov ecx, esp
mov dword [ebp - 0x18], esp
push eax
mov byte [ebp - 4], 5
call sub.MFC42.DLL_CString::CString_1
call fcn.00402ef6
pop ecx
push eax
push 0x40d
push dword [0x40f908]
call esi
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x10]
jmp 0x4022c9
push 0x40f204
lea ecx, [ebp - 0x10]
call fcn.0040abe4
push ebx
push ecx
lea eax, [ebp - 0x10]
mov ecx, esp
mov dword [ebp - 0x18], esp
push eax
mov byte [ebp - 4], 6
call sub.MFC42.DLL_CString::CString_1
call fcn.00402ef6
pop ecx
push eax
push 0x40d
push dword [0x40f908]
call esi
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x10]
jmp 0x4022c9
push 0x40f1ec
lea ecx, [ebp - 0x10]
call fcn.0040abe4
push ebx
push ecx
lea eax, [ebp - 0x10]
mov ecx, esp
mov dword [ebp - 0x18], esp
push eax
mov byte [ebp - 4], 7
call sub.MFC42.DLL_CString::CString_1
call fcn.00402ef6
pop ecx
push eax
push 0x40d
push dword [0x40f908]
call esi
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x10]
jmp 0x4022c9
lea ecx, [ebp - 0x24]
call sub.MFC42.DLL_CString::CString_2
push dword [0x40f824]
lea eax, [ebp - 0x24]
mov byte [ebp - 4], 8
push 0x40f1d8
push eax
call sub.MFC42.DLL_CString::Format
add esp, 0xc
lea eax, [ebp - 0x24]
push ebx
push ecx
mov ecx, esp
mov dword [ebp - 0x18], esp
push eax
call sub.MFC42.DLL_CString::CString_1
call fcn.00402ef6
pop ecx
push eax
push 0x40d
push dword [0x40f908]
call esi
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x24]
jmp 0x4022c9
push 0x40f1b0
lea ecx, [ebp - 0x10]
call fcn.0040abe4
push ebx
push ecx
lea eax, [ebp - 0x10]
mov ecx, esp
mov dword [ebp - 0x18], esp
push eax
mov byte [ebp - 4], 9
call sub.MFC42.DLL_CString::CString_1
call fcn.00402ef6
pop ecx
push eax
push 0x40d
push dword [0x40f908]
call esi
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x10]
jmp 0x4022c9
push 0x40f198
lea ecx, [ebp - 0x10]
call fcn.0040abe4
push ebx
push ecx
lea eax, [ebp - 0x10]
mov ecx, esp
mov dword [ebp - 0x18], esp
push eax
mov byte [ebp - 4], 0xb
call sub.MFC42.DLL_CString::CString_1
call fcn.00402ef6
pop ecx
push eax
push 0x40d
push dword [0x40f908]
call esi
mov byte [ebp - 4], 0xa
lea ecx, [ebp - 0x10]
jmp 0x4022bd
push 0x40f17c
lea ecx, [ebp - 0x10]
call fcn.0040abe4
push ebx
push ecx
lea eax, [ebp - 0x10]
mov ecx, esp
mov dword [ebp - 0x18], esp
push eax
mov byte [ebp - 4], 0xd
call sub.MFC42.DLL_CString::CString_1
call fcn.00402ef6
pop ecx
push eax
push 0x40d
push dword [0x40f908]
call esi
mov byte [ebp - 4], 0xc
lea ecx, [ebp - 0x10]
jmp 0x4022b1
push 0x40f17c
lea ecx, [ebp - 0x30]
call fcn.0040abe4
push ebx
push ecx
lea eax, [ebp - 0x30]
mov ecx, esp
mov dword [ebp - 0x18], esp
push eax
mov byte [ebp - 4], 0xe
call sub.MFC42.DLL_CString::CString_1
call fcn.00402ef6
pop ecx
push eax
push 0x40d
push dword [0x40f908]
call esi
mov byte [ebp - 4], 0xc
lea ecx, [ebp - 0x30]
call sub.MFC42.DLL_CString::CString
mov byte [ebp - 4], 0xa
lea ecx, [ebp - 0x2c]
call sub.MFC42.DLL_CString::CString
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x28]
call sub.MFC42.DLL_CString::CString
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x14]
call sub.MFC42.DLL_CString::CString
mov byte [ebp - 4], bl
lea ecx, [ebp - 0x1c]
call sub.MFC42.DLL_CString::CString
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x44]
call fcn.0040ac20
xor eax, eax
jmp 0x40204f