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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4e2ebf
mov eax, dword fs:[0]
push eax
sub esp, 0xa34
mov eax, dword [0x530400]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [ebp - 0x424], edi
cmp byte [edi + 0x584], 0
je 0x40be95
lea ecx, [edi + 0x520]
mov byte [edi + 0x586], 1
call fcn.00413f30
jmp 0x40c96c
lea ecx, [ebp - 0xa35]
call fcn.00407dc0
mov ecx, dword [edi + 0x50c]
lea edx, [ebp - 0x550]
push edx
mov eax, dword [ecx]
mov eax, dword [eax + 0x38]
call eax
mov ecx, eax
mov dword [ebp - 4], 0
call dword [0x50b044]
mov edx, eax
mov dword [ebp - 0x48c], 0
mov ecx, edx
mov dword [ebp - 0x488], 0
xorps xmm0, xmm0
movups xmmword [ebp - 0x49c], xmm0
lea esi, [ecx + 2]
nop dword [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40bef0
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x49c]
call fcn.00408fa0
lea ecx, [ebp - 0x550]
mov byte [ebp - 4], 2
call dword [0x50b040]
cmp dword [ebp - 0x488], 7
lea eax, [ebp - 0x49c]
cmova eax, dword [ebp - 0x49c]
push eax
lea eax, [ebp - 0x43c]
push eax
call fcn.00401ac0
add esp, 8
cmp dword [ebp - 0x428], 0xf
lea eax, [ebp - 0x43c]
mov byte [ebp - 4], 3
cmova eax, dword [ebp - 0x43c]
push eax
call fcn.0040ce80
mov ecx, eax
call sym.RedAlert.exe_public_virtual:_class_DuiLib::IListCallbackUI____thiscall_DuiLib::CListUI::GetTextCallback_void_const
mov ecx, eax
call fcn.004087e0
test al, al
jne 0x40c023
push 0x568
lea eax, [ebp - 0xa34]
push 0
push eax
call fcn.004bda10
add esp, 0xc
lea eax, [ebp - 0x424]
lea ecx, [ebp - 0xa34]
push eax
call fcn.00416cb0
push 0
push 0
push 0
push 0
push 0
push 0x100
push 0x10ce0000
push 0x4e7d0c
mov ecx, edi
mov byte [ebp - 4], 4
call dword [0x50b05c]
push eax
lea ecx, [ebp - 0xa34]
call dword [0x50b060]
lea ecx, [ebp - 0xa34]
call dword [0x50b068]
push 0
lea ecx, [ebp - 0xa34]
call fcn.00418030
push 0x4e7e70
lea ecx, [ebp - 0xa34]
call fcn.00418790
push 0x4e7e7c
lea ecx, [ebp - 0xa34]
call fcn.00418490
lea ecx, [ebp - 0xa34]
call dword [0x50b064]
lea ecx, [ebp - 0xa34]
call fcn.00416e10
jmp 0x40c910
mov ecx, edi
call fcn.0040cf00
test al, al
jne 0x40c0e1
push 0x568
lea eax, [ebp - 0xa34]
push 0
push eax
call fcn.004bda10
add esp, 0xc
lea eax, [ebp - 0x424]
lea ecx, [ebp - 0xa34]
push eax
call fcn.00416cb0
push 0
push 0
push 0
push 0
push 0
push 0x100
push 0x10ce0000
push 0x4e7d0c
mov ecx, edi
mov byte [ebp - 4], 5
call dword [0x50b05c]
push eax
lea ecx, [ebp - 0xa34]
call dword [0x50b060]
lea ecx, [ebp - 0xa34]
call dword [0x50b068]
push 0
lea ecx, [ebp - 0xa34]
call fcn.00418030
push 0x4e7ea0
lea ecx, [ebp - 0xa34]
call fcn.00418790
push 0x4e7eac
lea ecx, [ebp - 0xa34]
call fcn.00418490
lea ecx, [ebp - 0xa34]
call dword [0x50b064]
lea ecx, [ebp - 0xa34]
call fcn.00416e10
jmp 0x40c910
push 0
push 0
push str.ScreenMode
push str.SOFTWAREPopCapPlantsVsZombies
push reloc.WS2_32.dll_accept
mov ecx, edi
call fcn.0040cde0
push 0
push 0
push str.ScreenMode
push str.SOFTWARESteamPopCapPlantsVsZombies
push reloc.WS2_32.dll_accept
mov ecx, edi
call fcn.0040cde0
lea eax, [ebp - 0x484]
push eax
call fcn.0040ce80
mov ecx, eax
call fcn.0040ee10
cmp dword [ebp - 0x470], 0xf
lea eax, [ebp - 0x484]
mov byte [ebp - 4], 6
cmova eax, dword [ebp - 0x484]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFindExtensionA]
mov edx, eax
mov dword [ebp - 0x45c], 0
mov ecx, edx
mov dword [ebp - 0x458], 0
xorps xmm0, xmm0
movups xmmword [ebp - 0x46c], xmm0
lea esi, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40c170
sub ecx, esi
push ecx
push edx
lea ecx, [ebp - 0x46c]
call fcn.00403b90
cmp dword [ebp - 0x458], 0xf
lea ecx, [ebp - 0x46c]
mov edx, dword [ebp - 0x46c]
lea eax, [ebp - 0x46c]
cmova eax, edx
mov byte [ebp - 4], 7
cmova ecx, edx
mov dword [ebp - 0xa3c], eax
add ecx, dword [ebp - 0x45c]
lea esi, [ebp - 0x46c]
cmp dword [ebp - 0x458], 0xf
mov dword [ebp - 0xa40], ecx
cmova esi, edx
cmp esi, ecx
je 0x40c202
sub dword [ebp - 0xa3c], esi
mov edi, dword [ebp - 0xa3c]
nop dword [eax + eax]
movsx ax, byte [esi]
movzx eax, ax
push eax
call fcn.004cbeb5
mov byte [esi + edi], al
add esp, 4
inc esi
cmp esi, dword [ebp - 0xa40]
jne 0x40c1e0
mov edi, dword [ebp - 0x424]
lea eax, [ebp - 0x43c]
push eax
lea ecx, [ebp - 0x454]
call fcn.00402630
mov byte [ebp - 4], 8
call fcn.0040ce80
mov ecx, eax
call fcn.0040eca0
push eax
lea eax, [ebp - 0x4b4]
push eax
call fcn.00401890
add esp, 8
cmp dword [eax + 0x14], 0xf
mov ecx, eax
mov byte [ebp - 4], 9
jbe 0x40c242
mov ecx, dword [eax]
push dword [eax + 0x10]
push ecx
lea ecx, [ebp - 0x454]
call fcn.004024e0
lea ecx, [ebp - 0x4b4]
mov byte [ebp - 4], 8
call fcn.00403170
cmp dword [ebp - 0x458], 0xf
lea eax, [ebp - 0x46c]
push dword [ebp - 0x45c]
cmova eax, dword [ebp - 0x46c]
lea ecx, [ebp - 0x454]
push eax
call fcn.004024e0
mov byte [edi + 0x586], 0
call fcn.0040ce80
mov ecx, eax
call fcn.0040eca0
push eax
lea eax, [ebp - 0x4b4]
push eax
call fcn.00401890
add esp, 8
lea ecx, [edi + 0x554]
push eax
call fcn.00402570
lea ecx, [ebp - 0x4b4]
call fcn.00403170
push 0x104
lea eax, [ebp - 0x218]
push 0
push eax
call fcn.004bda10
push 0x104
lea eax, [ebp - 0x114]
push 0
push eax
call fcn.004bda10
push 0x104
lea eax, [ebp - 0x420]
push 0
push eax
call fcn.004bda10
push 0x104
lea eax, [ebp - 0x31c]
push 0
push eax
call fcn.004bda10
lea esi, [edi + 0x53c]
add esp, 0x30
cmp dword [esi + 0x14], 0xf
mov edx, esi
jbe 0x40c31f
mov edx, dword [esi]
lea eax, [edi + 0x554]
cmp dword [eax + 0x14], 0xf
lea ecx, [eax + 0x14]
mov dword [ebp - 0x424], ecx
jbe 0x40c336
mov eax, dword [eax]
push edx
push 0x104
lea ecx, [ebp - 0x218]
push ecx
push 0x50ae7e
push 0x4e7f24
push eax
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
cmp dword [esi + 0x14], 0xf
jbe 0x40c35c
mov esi, dword [esi]
mov ecx, dword [ebp - 0x424]
lea eax, [edi + 0x554]
cmp dword [ecx], 0xf
jbe 0x40c36f
mov eax, dword [eax]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
lea ecx, [ebp - 0x114]
push 0x104
push ecx
push 0x50ae7e
push 0x4e78b8
push eax
call esi
cmp dword [edi + 0x550], 0xf
lea ecx, [edi + 0x53c]
jbe 0x40c3a0
mov ecx, dword [ecx]
cmp dword [edi + 0x568], 0xf
lea eax, [edi + 0x554]
jbe 0x40c3b1
mov eax, dword [eax]
push ecx
push 0x104
lea ecx, [ebp - 0x420]
push ecx
push 0x50ae7e
push str.progress
push eax
call esi
cmp dword [edi + 0x550], 0xf
lea ecx, [edi + 0x53c]
jbe 0x40c3dc
mov ecx, dword [ecx]
cmp dword [edi + 0x568], 0xf
lea eax, [edi + 0x554]
jbe 0x40c3ed
mov eax, dword [eax]
push ecx
push 0x104
lea ecx, [ebp - 0x31c]
push ecx
push 0x50ae7e
push str.complete
push eax
call esi
lea ecx, [ebp - 0x114]
mov byte [ebp - 0xa35], 0
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40c417
sub ecx, edx
lea eax, [ebp - 0x454]
cmp dword [ebp - 0x440], 0xf
push ecx
cmova eax, dword [ebp - 0x454]
lea ecx, [ebp - 0x114]
push ecx
push dword [ebp - 0x444]
push eax
call fcn.00409270
add esp, 0x10
test eax, eax
jne 0x40c584
lea ecx, [ebp - 0x218]
lea edx, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40c460
sub ecx, edx
lea eax, [ebp - 0x484]
cmp dword [ebp - 0x470], 0xf
push ecx
cmova eax, dword [ebp - 0x484]
lea ecx, [ebp - 0x218]
push ecx
push dword [ebp - 0x474]
push eax
call fcn.00409270
add esp, 0x10
test eax, eax
jne 0x40c584
mov ecx, 0x4e7d54
lea eax, [ebp - 0x31c]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x40c4c7
test dl, dl
je 0x40c4c3
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x40c4c7
add eax, 2
add ecx, 2
test dl, dl
jne 0x40c4a7
xor eax, eax
jmp 0x40c4cc
sbb eax, eax
or eax, 1
test eax, eax
jne 0x40c72d
push 0x568
push eax
lea eax, [ebp - 0xa34]
push eax
call fcn.004bda10
add esp, 0xc
lea eax, [ebp - 0x424]
lea ecx, [ebp - 0xa34]
push eax
call fcn.00416cb0
push 0
push 0
push 0
push 0
push 0
push 0x100
push 0x10ce0000
push 0x4e7d0c
mov ecx, edi
mov byte [ebp - 4], 0xa
call dword [0x50b05c]
push eax
lea ecx, [ebp - 0xa34]
call dword [0x50b060]
lea ecx, [ebp - 0xa34]
call dword [0x50b068]
push 1
lea ecx, [ebp - 0xa34]
call fcn.00418030
push 0x4e7f34
lea ecx, [ebp - 0xa34]
call fcn.00418490
lea ecx, [ebp - 0xa34]
call dword [0x50b064]
cmp dword [ebp - 0x424], 1
lea ecx, [ebp - 0xa34]
jne 0x40c57b
call fcn.00416e10
jmp 0x40c8ef
mov byte [ebp - 4], 8
call fcn.00416e10
cmp dword [edi + 0x550], 0xf
lea eax, [edi + 0x53c]
jbe 0x40c595
mov eax, dword [eax]
cmp dword [ebp - 0x470], 0xf
lea edx, [ebp - 0x484]
lea ecx, [edi + 0x554]
cmova edx, dword [ebp - 0x484]
cmp dword [ecx + 0x14], 0xf
jbe 0x40c5b7
mov ecx, dword [ecx]
mov esi, dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringA]
push eax
push edx
push 0x4e7f24
push ecx
call esi
cmp dword [edi + 0x550], 0xf
lea eax, [edi + 0x53c]
jbe 0x40c5d8
mov eax, dword [eax]
cmp dword [ebp - 0x440], 0xf
lea edx, [ebp - 0x454]
lea ecx, [edi + 0x554]
cmova edx, dword [ebp - 0x454]
cmp dword [ecx + 0x14], 0xf
jbe 0x40c5fa
mov ecx, dword [ecx]
push eax
push edx
push 0x4e78b8
push ecx
call esi
cmp dword [ebp - 0x440], 0xf
lea edx, [ebp - 0x454]
lea ecx, [edi + 0x53c]
cmova edx, dword [ebp - 0x454]
cmp dword [ecx + 0x14], 0xf
jbe 0x40c626
mov ecx, dword [ecx]
cmp dword [edi + 0x568], 0xf
lea eax, [edi + 0x554]
jbe 0x40c637
mov eax, dword [eax]
push ecx
push edx
push str.progress
push eax
call esi
cmp dword [edi + 0x550], 0xf
lea ecx, [edi + 0x53c]
jbe 0x40c652
mov ecx, dword [ecx]
cmp dword [edi + 0x568], 0xf
lea eax, [edi + 0x554]
jbe 0x40c663
mov eax, dword [eax]
push ecx
push 0x4e7f88
push str.complete
push eax
call esi
cmp dword [ebp - 0x428], 0xf
lea eax, [ebp - 0x43c]
mov ecx, edi
cmova eax, dword [ebp - 0x43c]
push eax
call fcn.00409880
mov byte [edi + 0x588], 1
cmp dword [ebp - 0x428], 0xf
lea eax, [ebp - 0x43c]
cmova eax, dword [ebp - 0x43c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
jne 0x40c6d2
cmp dword [ebp - 0x428], 0xf
lea eax, [ebp - 0x43c]
push 0
cmova eax, dword [ebp - 0x43c]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExA]
push 0x34
call fcn.004bbaae
mov esi, eax
add esp, 4
test esi, esi
je 0x40c878
mov dword [esi + 0x28], 0
xorps xmm0, xmm0
mov dword [esi + 0x2c], 0
mov dword [esi + 0x30], 0
movups xmmword [esi], xmm0
mov dword [esi + 0x10], 0
mov dword [esi + 0x14], 0xf
mov byte [esi], 0
movups xmmword [esi + 0x18], xmm0
mov dword [esi + 0x28], 0
mov dword [esi + 0x2c], 0xf
mov byte [esi + 0x18], 0
jmp 0x40c87a
cmp byte [edi + 0x588], 0
jne 0x40c807
push 0x568
lea eax, [ebp - 0xa34]
mov byte [edi + 0x588], 1
push 0
push eax
call fcn.004bda10
add esp, 0xc
lea eax, [ebp - 0x424]
lea ecx, [ebp - 0xa34]
push eax
call fcn.00416cb0
push 0
push 0
push 0
push 0
push 0
push 0x100
push 0x10ce0000
push 0x4e7d0c
mov ecx, edi
mov byte [ebp - 4], 0xb
call dword [0x50b05c]
push eax
lea ecx, [ebp - 0xa34]
call dword [0x50b060]
lea ecx, [ebp - 0xa34]
call dword [0x50b068]
push 1
lea ecx, [ebp - 0xa34]
call fcn.00418030
push 0x4e7f64
lea ecx, [ebp - 0xa34]
call fcn.00418490
lea ecx, [ebp - 0xa34]
call dword [0x50b064]
movzx eax, byte [ebp - 0xa35]
mov ecx, 1
cmp dword [ebp - 0x424], ecx
mov byte [ebp - 4], 8
cmove eax, ecx
lea ecx, [ebp - 0xa34]
mov dword [ebp - 0xa40], eax
call fcn.00416e10
cmp byte [ebp - 0xa40], 0
jne 0x40c584
lea eax, [ebp - 0x4cc]
push eax
lea eax, [ebp - 0x114]
push eax
call fcn.004cdb9e
add esp, 8
test eax, eax
jne 0x40c694
mov eax, dword [ebp - 0x4b8]
mov dword [edi + 0x58c], eax
lea eax, [ebp - 0x420]
push eax
mov byte [edi + 0x587], 1
call fcn.004ccc7a
mov ecx, dword [edi + 0x51c]
add esp, 4
mov dword [edi + 0x590], eax
test ecx, ecx
je 0x40c694
test eax, eax
jle 0x40c694
cmp eax, 0x64
jge 0x40c694
push eax
call dword [0x50b08c]
jmp 0x40c694
xor esi, esi
lea eax, [ebp - 0x484]
mov ecx, esi
push eax
call fcn.00409700
lea eax, [ebp - 0x454]
push eax
lea ecx, [esi + 0x18]
call fcn.00409700
lea eax, [edi + 0x4b8]
push esi
lea ecx, [edi + 0x520]
mov dword [esi + 0x30], eax
call fcn.004138f0
mov ecx, dword [edi + 0x510]
mov byte [edi + 0x584], 1
test ecx, ecx
je 0x40c8c7
mov eax, dword [ecx]
push 0
call dword [eax + 0xec]
mov ecx, dword [edi + 0x514]
test ecx, ecx
je 0x40c8db
mov eax, dword [ecx]
push 0x4e7f8c
call dword [eax + 0x3c]
mov ecx, dword [edi + 0x518]
test ecx, ecx
je 0x40c8ef
mov eax, dword [ecx]
push 0x4e7f94
call dword [eax + 0x3c]
lea ecx, [ebp - 0x454]
call fcn.00403170
lea ecx, [ebp - 0x46c]
call fcn.00403170
lea ecx, [ebp - 0x484]
call fcn.00403170
mov ecx, dword [ebp - 0x428]
cmp ecx, 0xf
jbe 0x40c946
mov edx, dword [ebp - 0x43c]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40c93c
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40c987
push ecx
push edx
call fcn.004bbade
add esp, 8
lea ecx, [ebp - 0x49c]
mov dword [ebp - 0x42c], 0
mov dword [ebp - 0x428], 0xf
mov byte [ebp - 0x43c], 0
call fcn.00403110
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004bbaec
mov esp, ebp
pop ebp
ret
call fcn.004bff0f
int3