Function at 0x404057
Capabilities:
Check if file exists
Extract resource via kernel32 functions
Get common file path
Get disk size
Query environment variable
Set current directory
Set environment variable
Write file on windows

Disassembly:
mov eax, 0x412b4d
call fcn.00407f50
mov eax, 0x11398
call fcn.00408220
mov eax, dword [0x4196d0]
push ebx
push esi
push edi
push str.XGSetup
mov esi, str.XGSetup4977CF33_F562_4700_A74F_6717CCB3FF0C
xor ebx, ebx
push esi
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x112f8], ebx
call dword [sym.imp.USER32.dll_FindWindowW]
mov edi, eax
cmp edi, ebx
je 0x4040ab
push edi
call dword [sym.imp.USER32.dll_SetForegroundWindow]
push edi
call dword [sym.imp.USER32.dll_BringWindowToTop]
or eax, 0xffffffff
jmp 0x404a91
push ebx
call dword [sym.imp.ole32.dll_CoInitialize]
xor eax, eax
mov word [ebp - 0x12f4], bx
mov ecx, 0x81
lea edi, [ebp - 0x12f2]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x12f4]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea eax, [ebp - 0x11310]
push eax
lea eax, [ebp - 0x1139c]
push eax
lea eax, [ebp - 0x113a4]
push eax
lea eax, [ebp - 0x12f4]
push eax
call dword [sym.imp.KERNEL32.dll_GetDiskFreeSpaceExW]
cmp eax, 1
jne 0x40412c
cmp dword [ebp - 0x1130c], ebx
ja 0x40412c
jb 0x404119
cmp dword [ebp - 0x11310], 0xc800000
jae 0x40412c
push 0x413a34
call fcn.00401223
pop ecx
push 0xfffffffffffffffe
pop eax
jmp 0x404a91
push 0x413a2c
call fcn.00402f13
xor edi, edi
inc edi
cmp eax, edi
pop ecx
je 0x404153
push str._silent
call fcn.00402f13
cmp eax, edi
pop ecx
mov dword [ebp - 0x112fc], ebx
jne 0x404159
mov dword [ebp - 0x112fc], edi
push dword [ebp - 0x112fc]
xor eax, eax
mov word [ebp - 0x4c], bx
lea edi, [ebp - 0x4a]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x4c]
push 0x41343c
push eax
call fcn.00407a15
add esp, 0xc
lea eax, [ebp - 0x4c]
push eax
push str.INSTALL_TYPE
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
cmp dword [ebp - 0x112fc], ebx
je 0x4041a7
push 0x80
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_SetPriorityClass]
mov edx, dword [ebp + 8]
push 0xb
pop ecx
xor eax, eax
lea edi, [ebp - 0x1133c]
rep stosd dword es:[edi], eax
mov edi, 0x7f00
push edi
push ebx
mov dword [0x41ab30], edx
mov dword [ebp - 0x11340], 0x30
mov dword [ebp - 0x1133c], 3
mov dword [ebp - 0x11338], 0x403bf6
mov dword [ebp - 0x11334], ebx
mov dword [ebp - 0x11330], ebx
mov dword [ebp - 0x1132c], edx
call dword [sym.imp.USER32.dll_LoadIconW]
push edi
push ebx
mov dword [ebp - 0x11328], eax
call dword [sym.imp.USER32.dll_LoadCursorW]
push ebx
mov dword [ebp - 0x11324], eax
call dword [sym.imp.GDI32.dll_GetStockObject]
mov dword [ebp - 0x11320], eax
mov eax, dword [ebp - 0x11328]
mov dword [ebp - 0x11314], eax
lea eax, [ebp - 0x11340]
push eax
mov dword [ebp - 0x1131c], ebx
mov dword [ebp - 0x11318], esi
call dword [sym.imp.USER32.dll_RegisterClassExW]
test ax, ax
jne 0x40424c
push 0x413a0c
jmp 0x40427f
push ebx
push dword [ebp + 8]
mov eax, 0x80000000
push ebx
push ebx
push eax
push eax
push eax
push eax
push 0xcf0000
push 0x4139fc
push esi
push 0x300
call dword [sym.imp.USER32.dll_CreateWindowExW]
cmp eax, ebx
mov dword [0x41ab34], eax
jne 0x40428d
push 0x4139ec
call fcn.00401223
xor eax, eax
pop ecx
inc eax
jmp 0x404a91
lea eax, [ebp - 0x2c]
push ebx
push eax
call fcn.0040307a
pop ecx
pop ecx
mov dword [ebp - 4], ebx
mov esi, dword [ebp - 0x18]
dec esi
push esi
lea ecx, [ebp - 0x2c]
call fcn.00401606
cmp word [eax], 0x5c
jne 0x4042bb
push esi
lea ecx, [ebp - 0x2c]
call fcn.00401606
mov word [eax], bx
cmp dword [ebp - 0x14], 8
mov eax, dword [ebp - 0x28]
jae 0x4042c7
lea eax, [ebp - 0x28]
push eax
push 0x4132ac
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
push 0xa
pop ecx
mov esi, str._CommonProgramFiles_
lea edi, [ebp - 0xac]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
xor eax, eax
mov word [ebp - 0x8cc], bx
mov ecx, 0x81
lea edi, [ebp - 0x8ca]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0x104
lea eax, [ebp - 0x8cc]
push eax
lea eax, [ebp - 0xac]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
cmp eax, ebx
jbe 0x40436f
lea eax, [ebp - 0x8cc]
push eax
lea ecx, [ebp - 0x11378]
call fcn.004024da
mov edi, eax
mov byte [ebp - 4], 1
xor esi, esi
lea eax, [ebp - 0xac]
inc esi
push eax
lea ecx, [ebp - 0x1135c]
mov dword [ebp - 0x112f8], esi
call fcn.004024da
mov dword [ebp - 4], 2
push edi
mov ecx, eax
mov dword [ebp - 0x112f8], 3
call fcn.00401834
test eax, eax
je 0x404372
mov byte [ebp + 0xb], bl
jmp 0x404376
xor esi, esi
inc esi
mov byte [ebp + 0xb], 1
mov dword [ebp - 4], esi
test byte [ebp - 0x112f8], 2
je 0x404396
and dword [ebp - 0x112f8], 0xfffffffd
push ebx
push esi
lea ecx, [ebp - 0x1135c]
call fcn.0040163e
mov dword [ebp - 4], ebx
test byte [ebp - 0x112f8], 1
je 0x4043b6
and dword [ebp - 0x112f8], 0xfffffffe
push ebx
push esi
lea ecx, [ebp - 0x11378]
call fcn.0040163e
cmp byte [ebp + 0xb], bl
je 0x4043cb
push str.C:Program_FilesCommon_Files
push str.CommonProgramFiles
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
push 0x104
lea eax, [ebp - 0x8cc]
push eax
lea eax, [ebp - 0xac]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov esi, str._windir_
lea edi, [ebp - 0x60]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
xor eax, eax
mov word [ebp - 0xcdc], bx
mov ecx, 0x81
lea edi, [ebp - 0xcda]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0x104
lea eax, [ebp - 0xcdc]
push eax
lea eax, [ebp - 0x60]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
cmp eax, ebx
jbe 0x40446d
lea eax, [ebp - 0xcdc]
push eax
lea ecx, [ebp - 0x1135c]
call fcn.004024da
mov edi, eax
mov byte [ebp - 4], 3
push 4
pop esi
or dword [ebp - 0x112f8], esi
lea eax, [ebp - 0x60]
push eax
lea ecx, [ebp - 0x11378]
call fcn.004024da
mov dword [ebp - 4], esi
or dword [ebp - 0x112f8], 8
push edi
mov ecx, eax
call fcn.00401834
test eax, eax
mov byte [ebp + 0xb], bl
jne 0x404471
mov byte [ebp + 0xb], 1
mov dword [ebp - 4], 3
test byte [ebp - 0x112f8], 8
je 0x404496
and dword [ebp - 0x112f8], 0xfffffff7
push ebx
push 1
lea ecx, [ebp - 0x11378]
call fcn.0040163e
mov dword [ebp - 4], ebx
test byte [ebp - 0x112f8], 4
je 0x4044b7
and dword [ebp - 0x112f8], 0xfffffffb
push ebx
push 1
lea ecx, [ebp - 0x1135c]
call fcn.0040163e
cmp byte [ebp + 0xb], bl
je 0x4044cc
push str.C:windows
push str.windir
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
push 0x104
lea eax, [ebp - 0xcdc]
push eax
lea eax, [ebp - 0x60]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push 7
pop ecx
mov esi, str._LocalAppdata_
lea edi, [ebp - 0x80]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
xor eax, eax
mov word [ebp - 0x10ec], bx
mov ecx, 0x81
lea edi, [ebp - 0x10ea]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0x104
lea eax, [ebp - 0x10ec]
push eax
lea eax, [ebp - 0x80]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
cmp eax, ebx
jbe 0x40456e
lea eax, [ebp - 0x10ec]
push eax
lea ecx, [ebp - 0x1135c]
call fcn.004024da
mov esi, eax
mov byte [ebp - 4], 5
or dword [ebp - 0x112f8], 0x10
lea eax, [ebp - 0x80]
push eax
lea ecx, [ebp - 0x11378]
call fcn.004024da
mov dword [ebp - 4], 6
or dword [ebp - 0x112f8], 0x20
push esi
mov ecx, eax
call fcn.00401834
test eax, eax
mov byte [ebp + 0xb], bl
jne 0x404572
mov byte [ebp + 0xb], 1
mov dword [ebp - 4], 5
test byte [ebp - 0x112f8], 0x20
je 0x404597
and dword [ebp - 0x112f8], 0xffffffdf
push ebx
push 1
lea ecx, [ebp - 0x11378]
call fcn.0040163e
mov dword [ebp - 4], ebx
test byte [ebp - 0x112f8], 0x10
je 0x4045b8
and dword [ebp - 0x112f8], 0xffffffef
push ebx
push 1
lea ecx, [ebp - 0x1135c]
call fcn.0040163e
cmp byte [ebp + 0xb], bl
je 0x4045d5
cmp dword [ebp - 0x14], 8
mov eax, dword [ebp - 0x28]
jae 0x4045c9
lea eax, [ebp - 0x28]
push eax
push str.LocalAppdata
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
push 0x104
lea eax, [ebp - 0x10ec]
push eax
lea eax, [ebp - 0x80]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov esi, str._temp_
lea edi, [ebp - 0x3c]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
xor eax, eax
mov word [ebp - 0x4bc], bx
mov ecx, 0x81
lea edi, [ebp - 0x4ba]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0x104
lea eax, [ebp - 0x4bc]
push eax
lea eax, [ebp - 0x3c]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
lea eax, [ebp - 0x4bc]
test eax, eax
jbe 0x404686
push eax
lea ecx, [ebp - 0x1135c]
call fcn.004024da
mov esi, eax
mov byte [ebp - 4], 7
or dword [ebp - 0x112f8], 0x40
lea eax, [ebp - 0x3c]
push eax
lea ecx, [ebp - 0x11378]
call fcn.004024da
mov dword [ebp - 4], 8
or byte [ebp - 0x112f8], 0x80
push esi
mov ecx, eax
call fcn.00401834
test eax, eax
je 0x404686
lea eax, [ebp - 0x4bc]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
mov byte [ebp + 0xb], bl
jne 0x40468a
mov byte [ebp + 0xb], 1
mov dword [ebp - 4], 7
test byte [ebp - 0x112f8], 0x80
je 0x4046af
and byte [ebp - 0x112f8], 0x7f
push ebx
push 1
lea ecx, [ebp - 0x11378]
call fcn.0040163e
mov dword [ebp - 4], ebx
test byte [ebp - 0x112f8], 0x40
je 0x4046c9
push ebx
push 1
lea ecx, [ebp - 0x1135c]
call fcn.0040163e
cmp byte [ebp + 0xb], bl
je 0x4046f0
lea eax, [ebp - 0x4bc]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
push 0x4138b0
push str.temp
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
push 0x104
lea eax, [ebp - 0x4bc]
push eax
lea eax, [ebp - 0x3c]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push 0x4138ac
push str.IS_LITE
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
xor eax, eax
mov word [ebp - 0x2b4], bx
mov ecx, 0x81
lea edi, [ebp - 0x2b2]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x2b4]
push eax
call fcn.00403c7b
cmp eax, 1
pop ecx
jne 0x404a72
lea eax, [ebp - 0x2b4]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
xor eax, eax
mov word [ebp - 0x112f4], bx
mov ecx, 0x3fff
lea edi, [ebp - 0x112f2]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov esi, 0x8000
push esi
lea eax, [ebp - 0x112f4]
push eax
mov edi, str.Path
push edi
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea eax, [ebp - 0x2b4]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveExtensionW]
lea eax, [ebp - 0x2b4]
push eax
lea eax, [ebp - 0x112f4]
push eax
push str._s__s
push esi
push eax
call fcn.00408483
add esp, 0x14
lea eax, [ebp - 0x112f4]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov dword [ebp - 0x112fc], 0x41ab44
mov dword [ebp + 8], str..zlib1.dll
mov dword [ebp - 0x11300], ebx
mov esi, 0x208
xor eax, eax
mov word [ebp - 0xad4], bx
mov ecx, 0x81
lea edi, [ebp - 0xad2]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x2b4]
push eax
lea eax, [ebp - 0xad4]
push eax
call fcn.004079f9
pop ecx
pop ecx
push dword [ebp + 8]
lea eax, [ebp - 0xad4]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp - 0xad4]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
cmp eax, ebx
je 0x404a20
mov ecx, dword [ebp - 0x112fc]
add dword [ebp - 0x11300], esi
add dword [ebp + 8], esi
add dword [ebp - 0x112fc], 4
cmp dword [ebp - 0x11300], 0x1248
mov dword [ecx], eax
jb 0x4047d6
xor eax, eax
mov word [ebp - 0x6c4], bx
mov ecx, 0x81
lea edi, [ebp - 0x6c2]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x2b4]
push eax
lea eax, [ebp - 0x6c4]
push eax
call fcn.004079f9
pop ecx
pop ecx
push str..XmpSetupMap.ini
lea eax, [ebp - 0x6c4]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
xor ecx, ecx
mov eax, 0x413868
cmp ecx, eax
je 0x404998
lea ecx, [ebp - 0x6c4]
test ecx, ecx
je 0x404998
push eax
push 0x6b
push ebx
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov edi, eax
cmp edi, ebx
je 0x404998
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_SizeofResource]
cmp eax, ebx
mov dword [ebp + 8], eax
je 0x404998
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov esi, eax
cmp esi, ebx
mov dword [ebp - 0x11304], esi
je 0x404998
push esi
call dword [sym.imp.KERNEL32.dll_LockResource]
cmp eax, ebx
mov dword [ebp - 0x11308], eax
je 0x404998
push ebx
push 0x80
push 2
push ebx
push 1
push 0x40000000
lea eax, [ebp - 0x6c4]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [ebp - 0x112fc], eax
je 0x404933
push ebx
push ebx
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x404936
push esi
jmp 0x404992
xor edi, edi
cmp dword [ebp + 8], ebx
jbe 0x404980
mov esi, 0xfa000
mov eax, dword [ebp + 8]
sub eax, edi
cmp eax, esi
jbe 0x40494d
mov eax, esi
push ebx
lea ecx, [ebp - 0x11300]
push ecx
push eax
mov eax, dword [ebp - 0x11308]
add eax, edi
push eax
push dword [ebp - 0x112fc]
mov dword [ebp - 0x11300], ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x404980
add edi, dword [ebp - 0x11300]
cmp edi, dword [ebp + 8]
jb 0x404942
push dword [ebp - 0x112fc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x11304]
call dword [sym.imp.KERNEL32.dll_FreeResource]
call fcn.00401241
xor eax, eax
mov word [ebp - 0xee4], bx
mov ecx, 0x81
lea edi, [ebp - 0xee2]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x2b4]
push eax
lea eax, [ebp - 0xee4]
push eax
call fcn.004079f9
pop ecx
pop ecx
push str..SetupReal.dll
lea eax, [ebp - 0xee4]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp - 0xee4]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
cmp eax, ebx
mov dword [0x41ab38], eax
je 0x404a20
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.StartUI
push eax
call esi
push str.EndUI
push dword [0x41ab38]
mov dword [0x41ab3c], eax
call esi
mov dword [0x41ab40], eax
mov eax, dword [0x41ab3c]
cmp eax, ebx
jne 0x404a27
push 0x413800
jmp 0x404a77
push dword [ebp + 0x10]
lea ecx, [ebp - 0x2b4]
push dword [0x41ab34]
push ecx
call eax
mov esi, dword [sym.imp.USER32.dll_GetMessageW]
add esp, 0xc
jmp 0x404a5e
lea eax, [ebp - 0x11394]
push eax
call dword [sym.imp.USER32.dll_TranslateMessage]
lea eax, [ebp - 0x11394]
push eax
call dword [sym.imp.USER32.dll_DispatchMessageW]
push ebx
push ebx
lea eax, [ebp - 0x11394]
push ebx
push eax
call esi
test eax, eax
jne 0x404a44
xor esi, esi
jmp 0x404a80
push 0x4137c8
call fcn.00401223
pop ecx
push 0xfffffffffffffffd
pop esi
or dword [ebp - 4], 0xffffffff
push ebx
push 1
lea ecx, [ebp - 0x2c]
call fcn.0040163e
mov eax, esi
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x10]
pop ebx
call fcn.0040763c
leave
ret 0x10