Function at 0x403c7b
Capabilities:
Check if file exists
Extract resource via kernel32 functions
Get common file path
Get file version info
Set environment variable
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x8bc]
sub esp, 0x93c
mov eax, dword [0x4196d0]
push esi
mov dword [ebp + 0x8b8], eax
xor esi, esi
xor eax, eax
cmp dword [ebp + 0x8c4], esi
je 0x403f45
push ebx
push edi
mov edx, 0x81
mov word [ebp + 0x6b0], si
mov ecx, edx
lea edi, [ebp + 0x6b2]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
xor eax, eax
mov word [ebp - 0x68], si
mov ecx, edx
lea edi, [ebp - 0x66]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
xor eax, eax
mov word [ebp + 0x1a0], si
mov ecx, edx
lea edi, [ebp + 0x1a2]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp + 0x6b0]
push eax
mov edi, 0x104
push edi
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
jbe 0x403f41
push edi
lea eax, [ebp - 0x68]
push eax
push dword [0x41ab30]
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jbe 0x403f41
mov ebx, dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
lea eax, [ebp - 0x68]
push eax
call ebx
cmp eax, esi
mov dword [ebp - 0x6c], eax
je 0x403f41
push edi
lea eax, [ebp - 0x68]
push eax
lea eax, [ebp + 0x1a0]
push eax
call fcn.00408446
add esp, 0xc
push dword [ebp - 0x6c]
call dword [sym.imp.SHLWAPI.dll_PathRemoveExtensionW]
lea eax, [ebp + 0x1a0]
push eax
call ebx
push dword [ebp - 0x6c]
mov ebx, dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp + 0x6b0]
push eax
call ebx
lea eax, [ebp + 0x6b0]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
lea eax, [ebp + 0x6b0]
push eax
call fcn.00403846
pop ecx
push 0x3f
pop ecx
xor eax, eax
lea edi, [ebp + 0x5b2]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x70]
push eax
lea eax, [ebp + 0x1a0]
push eax
mov word [ebp + 0x5b0], si
mov dword [ebp - 0x70], esi
call sub.VERSION.dll_GetFileVersionInfoSizeW
mov edi, eax
cmp edi, esi
jbe 0x403e27
lea eax, [edi + edi + 2]
push eax
call fcn.0040627b
cmp eax, esi
pop ecx
mov dword [ebp - 0x6c], eax
je 0x403e27
push eax
push edi
push dword [ebp - 0x70]
lea eax, [ebp + 0x1a0]
push eax
call sub.VERSION.dll_GetFileVersionInfoW
test eax, eax
je 0x403e1e
lea eax, [ebp - 0x74]
push eax
lea eax, [ebp - 0x78]
push eax
push 0x413780
push dword [ebp - 0x6c]
mov dword [ebp - 0x74], esi
call sub.VERSION.dll_VerQueryValueW
test eax, eax
je 0x403e1e
mov eax, dword [ebp - 0x78]
movzx ecx, word [eax + 0xc]
push ecx
movzx ecx, word [eax + 0xe]
push ecx
movzx ecx, word [eax + 8]
movzx eax, word [eax + 0xa]
push ecx
push eax
lea eax, [ebp + 0x5b0]
push str._d._d._d._d
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x18
push dword [ebp - 0x6c]
call fcn.00407f6f
pop ecx
lea eax, [ebp + 0x5b0]
push eax
lea eax, [ebp + 0x6b0]
push eax
call ebx
lea eax, [ebp + 0x6b0]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
lea eax, [ebp + 0x6b0]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x403e6b
lea eax, [ebp + 0x6b0]
push eax
push esi
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
test eax, eax
jne 0x403f41
xor eax, eax
mov word [ebp + 0x3a8], si
mov ecx, 0x81
lea edi, [ebp + 0x3aa]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp + 0x6b0]
push eax
lea eax, [ebp + 0x3a8]
push eax
call fcn.004079f9
pop ecx
pop ecx
push str..SetupUI.cab
lea eax, [ebp + 0x3a8]
push eax
call ebx
xor ecx, ecx
mov eax, 0x413784
cmp ecx, eax
je 0x403fb0
lea ecx, [ebp + 0x3a8]
test ecx, ecx
je 0x403fb0
push eax
push 0x68
push esi
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov edi, eax
cmp edi, esi
je 0x403f41
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SizeofResource]
cmp eax, esi
mov dword [ebp - 0x6c], eax
je 0x403f41
push edi
push esi
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov edi, eax
cmp edi, esi
mov dword [ebp - 0x7c], edi
je 0x403f41
push edi
call dword [sym.imp.KERNEL32.dll_LockResource]
cmp eax, esi
mov dword [ebp - 0x80], eax
je 0x403f41
push esi
push 0x80
push 2
xor eax, eax
inc eax
push esi
push eax
mov dword [ebp - 0x74], eax
push 0x40000000
lea eax, [ebp + 0x3a8]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [ebp - 0x78], eax
je 0x403f3a
push esi
push esi
push esi
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x403f59
push edi
call dword [sym.imp.KERNEL32.dll_FreeResource]
xor eax, eax
pop edi
pop ebx
mov ecx, dword [ebp + 0x8b8]
pop esi
call fcn.0040763c
add ebp, 0x8bc
leave
ret
xor edi, edi
cmp dword [ebp - 0x6c], esi
jbe 0x403f99
mov ebx, 0xfa000
mov eax, dword [ebp - 0x6c]
sub eax, edi
cmp eax, ebx
jbe 0x403f70
mov eax, ebx
push esi
lea ecx, [ebp - 0x70]
push ecx
push eax
mov eax, dword [ebp - 0x80]
add eax, edi
push eax
push dword [ebp - 0x78]
mov dword [ebp - 0x70], esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x403f96
add edi, dword [ebp - 0x70]
cmp edi, dword [ebp - 0x6c]
jb 0x403f65
jmp 0x403f99
mov dword [ebp - 0x74], esi
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x7c]
call dword [sym.imp.KERNEL32.dll_FreeResource]
mov eax, dword [ebp - 0x74]
jmp 0x403fb2
xor eax, eax
cmp eax, esi
je 0x403f41
lea eax, [ebp + 0x6b0]
push eax
push dword [ebp + 0x8c4]
call fcn.004079f9
pop ecx
pop ecx
push dword [ebp + 0x8c4]
call dword [sym.imp.SHLWAPI.dll_PathRemoveExtensionW]
push dword [ebp + 0x8c4]
push str.installworkdir
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
lea eax, [ebp + 0x6b0]
push eax
lea eax, [ebp + 0x3a8]
push eax
call fcn.00403954
pop ecx
pop ecx
jmp 0x403f43