Function at 0x100050f0
Capabilities:
Extract resource via kernel32 functions
Get common file path
Get file size
Write file on windows

Disassembly:
sub esp, 0x160
mov eax, dword [0x1002da4c]
xor eax, esp
mov dword [esp + 0x15c], eax
push esi
call fcn.10006288
push eax
lea ecx, [esp + 8]
call fcn.100070af
call fcn.10009412
xor esi, esi
cmp eax, esi
jne 0x10005129
push 0x80004005
call fcn.10001090
mov edx, dword [eax]
push ebx
mov ecx, eax
mov eax, dword [edx + 0xc]
push edi
call eax
mov edi, eax
lea ecx, [esp + 0x24]
add edi, 0x10
push ecx
mov dword [esp + 0x18], edi
mov word [esp + 0x60], si
mov word [esp + 0x62], si
call sym.RtlExUpd.dll_cm_GetOSInfo
add esp, 4
push 0x104
lea edx, [esp + 0x64]
push edx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
push str.RtlExUpd.dll
lea eax, [esp + 0x64]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea ecx, [esp + 0x60]
push ecx
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
cmp dword [esp + 0x3c], esi
mov ebx, eax
jne 0x10005199
cmp dword [esp + 0x40], esi
jne 0x10005199
push str.SETUPSERVICE_WIN8
push 0xbc8
jmp 0x100051a3
push 0x10024828
push 0xbc7
push ebx
call dword [sym.imp.KERNEL32.dll_FindResourceA]
push ebp
mov esi, eax
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov ebp, eax
push ebp
call dword [sym.imp.KERNEL32.dll_LockResource]
push esi
push ebx
mov dword [esp + 0x28], eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
test esi, esi
mov dword [esp + 0x1c], eax
je 0x100052d0
test ebp, ebp
je 0x100052d0
cmp dword [esp + 0x20], 0
je 0x100052d0
test eax, eax
je 0x100052d0
push 0x104
lea edx, [esp + 0x68]
push edx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
push 0x10024808
lea eax, [esp + 0x68]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileA]
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
lea ecx, [esp + 0x7c]
push ecx
call edi
mov esi, eax
cmp esi, 0xffffffff
je 0x1000524f
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push esi
mov ebp, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp ebp, dword [esp + 0x1c]
je 0x100052a6
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea eax, [esp + 0x7c]
push eax
call edi
mov esi, eax
cmp esi, 0xffffffff
je 0x100052a6
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x20]
push 0
lea ecx, [esp + 0x28]
push ecx
push edx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
mov edi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test edi, edi
jne 0x100052a6
push ebx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
lea ecx, [esp + 0x18]
call fcn.10002bd0
jmp 0x100052f3
push ebx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
lea ecx, [esp + 0x18]
call fcn.10002bd0
cmp dword [esp + 0x14], 0
je 0x100052c9
mov edx, dword [esp + 0x10]
push edx
push 0
call fcn.10006852
mov eax, 1
jmp 0x10005308
push ebx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
lea eax, [edi - 0x10]
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x100052f3
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp dword [esp + 0x14], 0
je 0x10005306
mov ecx, dword [esp + 0x10]
push ecx
push 0
call fcn.10006852
xor eax, eax
mov ecx, dword [esp + 0x16c]
pop ebp
pop edi
pop ebx
pop esi
xor ecx, esp
call fcn.100116bf
add esp, 0x160
ret