Function at 0x403e10
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:
sub esp, 0x420
mov eax, dword [0x41e040]
xor eax, esp
mov dword [esp + 0x41c], eax
push ebx
push ebp
mov ebp, dword [esp + 0x42c]
push esi
push edi
lea eax, [esp + 0x1c]
xor edi, edi
xor ecx, ecx
mov ebx, 0x200
mov dword [esp + 0x18], eax
mov dword [esp + 0x41c], ebx
mov dword [esp + 0x420], edi
mov word [esp + 0x1c], cx
mov dword [esp + 0x10], edi
call fcn.004080a6
mov edx, dword [ebp + 0xc]
push edx
push 0x1000
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
je 0x4040fb
cmp esi, edi
jne 0x403e7e
mov esi, 0xdeadbeef
mov eax, dword [ebp + 0xc]
push eax
push esi
push 0x41a8a0
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
test eax, eax
je 0x4040fb
mov esi, dword [ebp + 0x224]
cmp esi, edi
je 0x403ec2
mov eax, dword [esi]
lea ecx, [esi + 4]
cmp eax, ecx
je 0x403eb3
push eax
call fcn.00407d02
add esp, 4
push esi
call fcn.00407d02
add esp, 4
mov dword [ebp + 0x224], edi
push 0x40c
call fcn.00407e77
mov esi, eax
add esp, 4
cmp esi, edi
je 0x403ef6
mov ecx, dword [ebp + 0xc]
lea eax, [esi + 4]
xor edx, edx
push ecx
mov dword [esi], eax
mov dword [esi + 0x404], ebx
mov dword [esi + 0x408], edi
mov word [eax], dx
call fcn.00404800
jmp 0x403ef8
xor esi, esi
mov dword [ebp + 0x224], esi
cmp esi, edi
jne 0x403f0c
push str.Cannot_get_alloc_m_pszWorkFolder_n
jmp 0x404100
mov edx, dword [ebp + 0xc]
mov eax, edx
lea ebx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x403f14
sub eax, ebx
sar eax, 1
cmp word [edx + eax*2 - 2], 0x5c
je 0x403f35
push 0x419414
call fcn.00404800
mov edx, dword [ebp + 0x224]
mov eax, dword [edx]
mov esi, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
push eax
call esi
cmp eax, 0xffffffff
je 0x403f66
test al, 0x10
je 0x403f57
push ebp
call fcn.004042f0
jmp 0x403f66
mov ecx, dword [ebp + 0x224]
mov edx, dword [ecx]
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov eax, dword [ebp + 0x224]
mov ecx, dword [eax]
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
je 0x4040ea
mov edx, dword [ebp + 0x224]
mov eax, dword [edx]
push eax
call esi
cmp eax, 0xffffffff
je 0x4040ea
push str.CABFILE
push 0x41a980
push edi
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov dword [esp + 0x14], eax
cmp eax, edi
jne 0x403fb5
push str.Cannot_find_CABFILE_n
jmp 0x404100
push eax
push edi
call dword [sym.imp.KERNEL32.dll_LoadResource]
cmp eax, edi
jne 0x403fe4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.LoadResource_error____X._n
call fcn.00407fcb
mov eax, dword [esp + 0x20]
lea edx, [esp + 0x24]
add esp, 8
cmp eax, edx
jmp 0x404112
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov ebx, eax
cmp ebx, edi
jne 0x40400a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.LockResource_error____X._n
call fcn.00407fcb
add esp, 8
jmp 0x404108
mov edx, dword [ebp + 0x224]
mov eax, dword [edx]
push eax
lea esi, [esp + 0x1c]
call fcn.00404800
push str.ePOPolicyMigration.cab
call fcn.00404800
sub esp, 0x40c
mov edi, esp
mov ecx, 0x103
push 0x41a440
rep movsd dword es:[edi], dword [esi]
call fcn.00407fcb
mov ecx, dword [esp + 0x428]
add esp, 0x410
push 0
push 0x80
push 2
push 0
push 0
push 0xc0000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x40407d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.CreateFile_error____X._n
jmp 0x403fcd
mov eax, dword [esp + 0x14]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push 0
lea ecx, [esp + 0x14]
push ecx
push eax
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esp + 0x18]
push ebp
push 0x404140
push 0
push edx
call dword [sym.imp.SETUPAPI.dll_SetupIterateCabinetW]
test eax, eax
setne bl
test bl, bl
jne 0x4040d1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetupIterateCabinet_error____X._n
call fcn.00407fcb
add esp, 8
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x1c]
cmp eax, ecx
je 0x4040e6
push eax
call fcn.00407d02
add esp, 4
mov al, bl
jmp 0x40411f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Cannot_create_work_folder__error:__X._n
jmp 0x403fcd
push str.Cannot_get_temp_path_n
call fcn.00407fcb
add esp, 4
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x1c]
cmp eax, ecx
je 0x40411d
push eax
call fcn.00407d02
add esp, 4
xor al, al
mov ecx, dword [esp + 0x42c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00407bfa
add esp, 0x420
ret 4