Function at 0x40cf80
Capabilities:
Check if file exists
Create directory
Extract resource via kernel32 functions
Get common file path
Get file attributes

Disassembly:
push 0x250
mov eax, 0x4ae0fc
call fcn.0046c4ba
mov edi, ecx
push str.InitUIStrings...
lea ecx, [ebp - 0x224]
mov dword [ebp - 0x230], edi
call fcn.00402829
xor esi, esi
lea edx, [ebp - 0x224]
push esi
push 2
pop ecx
mov dword [ebp - 4], esi
call fcn.00414d4f
or dword [ebp - 4], 0xffffffff
pop ecx
mov ecx, dword [ebp - 0x224]
lea ecx, [ecx - 0x10]
call fcn.00402e64
cmp dword [0x51b2f8], esi
je 0x40d0f7
push dword [edi + 0x10c]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40d0be
lea esi, [edi + 0x198]
mov eax, dword [esi]
sub eax, 0x10
push eax
call fcn.00402d9f
add eax, 0x10
pop ecx
mov dword [ebp - 0x224], eax
xor ebx, ebx
inc ebx
mov dword [ebp - 4], ebx
cmp dword [eax - 0xc], 0
jne 0x40d052
lea eax, [ebp - 0x224]
push eax
lea ecx, [edi + 0x580]
call fcn.00417523
mov eax, dword [ebp - 0x224]
cmp dword [eax - 0xc], 0
jne 0x40d044
push 0x4d1bf4
lea ecx, [ebp - 0x224]
call fcn.0040286d
lea eax, [ebp - 0x224]
mov ecx, esi
push eax
call fcn.00402e14
push str.re_initializing_strings_with_langauge:
lea ecx, [ebp - 0x22c]
call fcn.00402829
push 0
lea eax, [ebp - 0x224]
mov byte [ebp - 4], 2
push eax
push 2
lea edx, [ebp - 0x22c]
pop ecx
call fcn.00414600
pop ecx
pop ecx
mov byte [ebp - 4], bl
mov ecx, dword [ebp - 0x22c]
lea ecx, [ecx - 0x10]
call fcn.00402e64
lea eax, [ebp - 0x224]
push eax
lea eax, [edi + 0x10c]
push eax
lea ecx, [edi + 0x514]
call fcn.00415a5a
mov ecx, dword [ebp - 0x224]
add ecx, 0xfffffff0
call fcn.00402e64
mov eax, ebx
jmp 0x40d776
push str.Missing_ArmUI.ini__will_extract_again
lea ecx, [ebp - 0x224]
call fcn.00402829
push esi
push 2
lea edx, [ebp - 0x224]
mov dword [ebp - 4], 3
pop ecx
call fcn.00414d4f
or dword [ebp - 4], 0xffffffff
pop ecx
mov ecx, dword [ebp - 0x224]
lea ecx, [ecx - 0x10]
call fcn.00402e64
xor ebx, ebx
inc ebx
mov dword [0x51b2f8], ebx
call fcn.00452601
push eax
lea ecx, [ebp - 0x22c]
call fcn.00402899
mov dword [ebp - 4], 4
call fcn.004425f1
test eax, eax
je 0x40d181
push 0x105
lea eax, [ebp - 0x220]
push esi
push eax
call fcn.00484bc0
add esp, 0xc
lea eax, [ebp - 0x220]
push eax
push esi
push esi
push 0x24
push esi
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
test eax, eax
js 0x40d181
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x22c]
call fcn.0040286d
push str.Temp
lea ecx, [ebp - 0x22c]
call fcn.0040259d
lea ecx, [ebp - 0x22c]
call fcn.00441e9d
test eax, eax
je 0x40d3bf
lea ecx, [ebp - 0x22c]
call fcn.00402a6b
mov esi, 0x104
lea ecx, [ebp - 0x22c]
push esi
call fcn.00402bd2
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
push 0xffffffffffffffff
lea ecx, [ebp - 0x22c]
mov esi, eax
call fcn.0040ae39
test esi, esi
jne 0x40d3bf
push str.GetTempPath_failed:
lea ecx, [ebp - 0x224]
call fcn.00402829
mov byte [ebp - 4], 5
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 2
lea edx, [ebp - 0x224]
pop ecx
call fcn.00414d4f
pop ecx
mov byte [ebp - 4], 4
mov ecx, dword [ebp - 0x224]
lea ecx, [ecx - 0x10]
call fcn.00402e64
lea ecx, [ebp - 0x22c]
call fcn.00402a6b
push 0x208
lea eax, [ebp - 0x220]
push esi
push eax
call fcn.00484bc0
add esp, 0xc
lea eax, [ebp - 0x220]
push eax
push esi
push esi
push 0x8023
push esi
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
mov esi, eax
test esi, esi
jns 0x40d2c9
push str.SHGetFolderPath_CSIDL_COMMON_APPDATA_failed:
lea ecx, [ebp - 0x224]
call fcn.00402829
push esi
push 2
lea edx, [ebp - 0x224]
mov byte [ebp - 4], 6
pop ecx
call fcn.00414d4f
pop ecx
mov byte [ebp - 4], 4
mov ecx, dword [ebp - 0x224]
lea ecx, [ecx - 0x10]
call fcn.00402e64
push 0x4d1bf4
lea ecx, [ebp - 0x230]
call fcn.00402829
push str.C:WindowsTempArmUI.ini
lea ecx, [ebp - 0x224]
mov byte [ebp - 4], 7
call fcn.00402829
lea eax, [ebp - 0x230]
mov byte [ebp - 4], 8
push eax
lea eax, [ebp - 0x224]
push eax
lea ecx, [edi + 0x514]
call fcn.00415a5a
mov ecx, dword [ebp - 0x224]
mov edi, eax
add ecx, 0xfffffff0
call fcn.00402e64
mov ecx, dword [ebp - 0x230]
jmp 0x40d3ac
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x22c]
call fcn.0040286d
push 0x4d2a60
lea ecx, [ebp - 0x22c]
call fcn.0040259d
mov esi, dword [ebp - 0x22c]
push 0
push esi
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
mov dword [ebp - 0x228], eax
cmp eax, 0xa1
je 0x40d312
cmp eax, 3
jne 0x40d3c5
push str.SHCreateDirectoryEx___failed:
lea ecx, [ebp - 0x230]
call fcn.00402829
mov byte [ebp - 4], 9
lea eax, [ebp - 0x22c]
push dword [ebp - 0x228]
lea edx, [ebp - 0x230]
push eax
push 2
pop ecx
call fcn.00414600
pop ecx
pop ecx
mov byte [ebp - 4], 4
mov ecx, dword [ebp - 0x230]
lea ecx, [ecx - 0x10]
call fcn.00402e64
push 0x4d1bf4
lea ecx, [ebp - 0x228]
call fcn.00402829
push str.C:WindowsTempArmUI.ini
lea ecx, [ebp - 0x234]
mov byte [ebp - 4], 0xa
call fcn.00402829
lea eax, [ebp - 0x228]
mov byte [ebp - 4], 0xb
push eax
lea eax, [ebp - 0x234]
push eax
lea ecx, [edi + 0x514]
call fcn.00415a5a
mov ecx, dword [ebp - 0x234]
mov edi, eax
add ecx, 0xfffffff0
call fcn.00402e64
mov ecx, dword [ebp - 0x228]
add ecx, 0xfffffff0
call fcn.00402e64
mov esi, dword [ebp - 0x22c]
jmp 0x40d634
mov esi, dword [ebp - 0x22c]
push 0x5c
push esi
call fcn.00485294
pop ecx
pop ecx
mov ecx, eax
test ecx, ecx
je 0x40d3fc
sub ecx, esi
sar ecx, 1
cmp ecx, 0xffffffff
je 0x40d3fc
mov eax, dword [esi - 0xc]
dec eax
cmp ecx, eax
je 0x40d3fc
push 0x4d1898
lea ecx, [ebp - 0x22c]
call fcn.0040259d
mov esi, dword [ebp - 0x22c]
push str.ArmUI.ini
lea eax, [ebp - 0x22c]
push eax
lea eax, [ebp - 0x228]
push eax
call fcn.00402459
add esp, 0xc
lea ecx, [edi + 0x10c]
mov byte [ebp - 4], 0xc
push eax
call fcn.00402e14
mov byte [ebp - 4], 4
mov ecx, dword [ebp - 0x228]
lea ecx, [ecx - 0x10]
call fcn.00402e64
mov eax, dword [edi + 0x198]
sub eax, 0x10
push eax
call fcn.00402d9f
add eax, 0x10
pop ecx
mov dword [ebp - 0x224], eax
mov byte [ebp - 4], 0xd
cmp dword [eax - 0xc], 0
jne 0x40d49c
lea eax, [ebp - 0x224]
push eax
lea ecx, [edi + 0x580]
call fcn.00417523
mov eax, dword [ebp - 0x224]
cmp dword [eax - 0xc], 0
jne 0x40d48a
push 0x4d1bf4
lea ecx, [ebp - 0x224]
call fcn.0040286d
lea eax, [ebp - 0x224]
push eax
lea ecx, [edi + 0x198]
call fcn.00402e14
push str.ARM_UI_INI
push 0x83
push 0
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov dword [ebp - 0x228], eax
test eax, eax
jne 0x40d517
push str.FindResource_failed:
lea ecx, [ebp - 0x228]
call fcn.00402829
mov byte [ebp - 4], 0xe
push 0
lea ecx, [edi + 0x10c]
push ecx
push 2
lea edx, [ebp - 0x228]
pop ecx
call fcn.00414600
pop ecx
pop ecx
mov byte [ebp - 4], 0xd
mov ecx, dword [ebp - 0x228]
lea ecx, [ecx - 0x10]
call fcn.00402e64
lea eax, [ebp - 0x224]
push eax
lea eax, [edi + 0x10c]
push eax
lea ecx, [edi + 0x514]
call fcn.00415a5a
mov edi, eax
jmp 0x40d626
push eax
push 0
call dword [sym.imp.KERNEL32.dll_LoadResource]
test eax, eax
jne 0x40d53a
push str.LoadResource_failed:
lea ecx, [ebp - 0x228]
call fcn.00402829
mov byte [ebp - 4], 0xf
jmp 0x40d4cc
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
push dword [ebp - 0x228]
mov dword [ebp - 0x234], eax
push 0
call dword [sym.imp.KERNEL32.dll_SizeofResource]
lea ecx, [edi + 0x10c]
mov dword [ebp - 0x228], eax
call fcn.00446984
lea ecx, [ebp - 0x25c]
call fcn.00452700
push 0
push 0xffffffffffffffff
push 0
lea ecx, [ebp - 0x248]
mov byte [ebp - 4], 0x10
call fcn.004026c3
lea eax, [ebp - 0x248]
mov byte [ebp - 4], 0x11
push eax
push 0x1021
push dword [edi + 0x10c]
lea ecx, [ebp - 0x25c]
call fcn.00452c70
test eax, eax
jne 0x40d643
push str.Open_file_failed:
lea ecx, [ebp - 0x228]
call fcn.00402829
push 0
lea ebx, [edi + 0x10c]
mov byte [ebp - 4], 0x12
push ebx
push 2
lea edx, [ebp - 0x228]
pop ecx
call fcn.00414600
pop ecx
pop ecx
mov byte [ebp - 4], 0x11
mov ecx, dword [ebp - 0x228]
lea ecx, [ecx - 0x10]
call fcn.00402e64
lea eax, [ebp - 0x224]
push eax
push ebx
lea ecx, [edi + 0x514]
call fcn.00415a5a
mov ecx, dword [ebp - 0x238]
mov edi, eax
add ecx, 0xfffffff0
mov dword [ebp - method.CFileException.virtual_0], vtable.CFileException.0
call fcn.00402e64
lea ecx, [ebp - 0x25c]
call fcn.00452730
mov ecx, dword [ebp - 0x224]
add ecx, 0xfffffff0
call fcn.00402e64
lea ecx, [esi - 0x10]
call fcn.00402e64
mov eax, edi
jmp 0x40d776
mov byte [ebp - 4], 0x13
lea ecx, [ebp - 0x25c]
push dword [ebp - 0x228]
push dword [ebp - 0x234]
call fcn.00453040
lea ecx, [ebp - 0x25c]
mov dword [ebp - 4], 0x11
call fcn.004529c0
lea eax, [ebp - 0x224]
push eax
lea eax, [edi + 0x10c]
push eax
lea ecx, [edi + 0x514]
call fcn.00415a5a
mov ecx, dword [ebp - 0x238]
mov dword [ebp - method.CFileException.virtual_0], vtable.CFileException.0
lea ecx, [ecx - 0x10]
call fcn.00402e64
lea ecx, [ebp - 0x25c]
call fcn.00452730
mov ecx, dword [ebp - 0x224]
lea ecx, [ecx - 0x10]
call fcn.00402e64
lea ecx, [esi - 0x10]
jmp 0x40d0b2
call fcn.0046c407
ret