Function at 0x402101
Capabilities:
Check if file exists
Create directory
Delete file
Extract resource via kernel32 functions
Get common file path
Get file attributes
Write file on windows

Disassembly:
mov eax, 0x41e95e
call fcn.0041e140
sub esp, 0x41c
mov eax, dword [0x429e98]
push ebx
push esi
push edi
mov ebx, ecx
xor edi, edi
push edi
lea ecx, [ebp - 0x41c]
mov dword [ebp - 0x10], eax
call fcn.004019d5
mov dword [ebp - 4], edi
mov dword [ebp - 0x420], edi
call sub.msvcrt.dll_rand
push dword [ebx + 0xc]
mov esi, eax
push 0x1000
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
je 0x4023a6
cmp esi, edi
jne 0x40215b
mov esi, 0xdeadbeef
mov eax, dword [ebx + 0xc]
push eax
push esi
push 0x420a2c
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
test eax, eax
je 0x4023a6
mov ecx, dword [ebx + 0x224]
cmp ecx, edi
je 0x40218b
push 1
call fcn.00401980
mov dword [ebx + 0x224], edi
push 0x40c
call fcn.0041c61a
cmp eax, edi
pop ecx
je 0x4021a6
push dword [ebx + 0xc]
mov ecx, eax
call fcn.004019d5
jmp 0x4021a8
xor eax, eax
cmp eax, edi
mov dword [ebx + 0x224], eax
jne 0x4021bc
push str.Cannot_get_alloc_m_pszWorkFolder_n
jmp 0x4023ab
push dword [ebx + 0xc]
call sub.msvcrt.dll_wcslen
pop ecx
mov ecx, dword [ebx + 0xc]
cmp word [ecx + eax*2 - 2], 0x5c
je 0x4021e0
mov ecx, dword [ebx + 0x224]
push 0x42056c
call fcn.004016e0
mov eax, dword [ebx + 0x224]
push dword [eax]
mov esi, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
call esi
cmp eax, 0xffffffff
je 0x402210
test al, 0x10
je 0x402202
mov ecx, ebx
call fcn.00401cd4
jmp 0x402210
mov eax, dword [ebx + 0x224]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov eax, dword [ebx + 0x224]
push edi
push dword [eax]
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
je 0x402392
mov eax, dword [ebx + 0x224]
push dword [eax]
call esi
cmp eax, 0xffffffff
je 0x402392
push str.CABFILE
push 0x4209d0
push edi
call dword [sym.imp.KERNEL32.dll_FindResourceW]
cmp eax, edi
mov dword [ebp - 0x428], eax
jne 0x40225f
push str.Cannot_find_CABFILE_n
jmp 0x4023ab
push eax
push edi
call dword [sym.imp.KERNEL32.dll_LoadResource]
cmp eax, edi
jne 0x40227c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.LoadResource_error____X._n
jmp 0x40239e
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
cmp eax, edi
mov dword [ebp - 0x424], eax
jne 0x40229e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.LockResource_error____X._n
jmp 0x40239e
mov eax, dword [ebx + 0x224]
push dword [eax]
lea ecx, [ebp - 0x41c]
call fcn.004016e0
push str.ePOPolicyMigration.cab
lea ecx, [ebp - 0x41c]
call fcn.004016e0
sub esp, 0x40c
mov edi, esp
mov ecx, 0x103
lea esi, [ebp - 0x41c]
push 0x420904
rep movsd dword es:[edi], dword [esi]
call sub.msvcrt.dll_wprintf
add esp, 0x410
xor esi, esi
push esi
push 0x80
push 2
push esi
push esi
push 0xc0000000
push dword [ebp - 0x41c]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x40231b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.CreateFile_error____X._n
jmp 0x40239e
push dword [ebp - 0x428]
push esi
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push esi
lea ecx, [ebp - 0x420]
push ecx
push eax
push dword [ebp - 0x424]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
push 0x401c51
push esi
push dword [ebp - 0x41c]
call dword [sym.imp.SETUPAPI.dll_SetupIterateCabinetW]
test eax, eax
setne bl
test bl, bl
jne 0x402374
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetupIterateCabinet_error____X._n
call sub.msvcrt.dll_wprintf
pop ecx
pop ecx
lea eax, [ebp - 0x418]
cmp dword [ebp - 0x41c], eax
je 0x40238e
push dword [ebp - 0x41c]
call fcn.0041e106
pop ecx
mov al, bl
jmp 0x4023cd
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Cannot_create_work_folder__error:__X._n
call sub.msvcrt.dll_wprintf
pop ecx
jmp 0x4023b0
push str.Cannot_get_temp_path_n
call sub.msvcrt.dll_wprintf
lea eax, [ebp - 0x418]
cmp dword [ebp - 0x41c], eax
pop ecx
je 0x4023cb
push dword [ebp - 0x41c]
call fcn.0041e106
pop ecx
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x10]
call fcn.0041e7f6
pop edi
pop esi
pop ebx
leave
ret