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

Disassembly:
sub esp, 0x17c
mov eax, dword [0x10033a60]
xor eax, esp
mov dword [esp + 0x178], eax
push esi
call fcn.100094af
push eax
lea ecx, [esp + 8]
call fcn.1000a2b7
call fcn.1000c5d9
xor esi, esi
cmp eax, esi
jne 0x100091a9
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 + 0x7c], si
mov word [esp + 0x7e], si
call fcn.10008a50
add esp, 4
push 0x104
lea edx, [esp + 0x80]
push edx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
push str.RtlExUpd.dll
lea eax, [esp + 0x80]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea ecx, [esp + 0x7c]
push ecx
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
cmp dword [esp + 0x3c], esi
mov ebx, eax
jne 0x1000921f
cmp dword [esp + 0x40], esi
jne 0x1000921f
push str.SETUPSERVICE_WIN8
push 0xbc8
jmp 0x10009229
push 0x1002ab4c
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 0x10009362
test ebp, ebp
je 0x10009362
cmp dword [esp + 0x20], 0
je 0x10009362
test eax, eax
je 0x10009362
push 0x104
lea edx, [esp + 0x84]
push edx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
push 0x1002ab2c
lea eax, [esp + 0x84]
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 + 0x98]
push ecx
call edi
mov esi, eax
cmp esi, 0xffffffff
je 0x100092de
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 0x10009338
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea eax, [esp + 0x98]
push eax
call edi
mov esi, eax
cmp esi, 0xffffffff
je 0x10009338
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 0x10009338
push ebx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
lea ecx, [esp + 0x18]
call fcn.10004fe0
jmp 0x10009385
push ebx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
lea ecx, [esp + 0x18]
call fcn.10004fe0
cmp dword [esp + 0x14], 0
je 0x1000935b
mov edx, dword [esp + 0x10]
push edx
push 0
call fcn.10009a5a
mov eax, 1
jmp 0x1000939a
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 0x10009385
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp dword [esp + 0x14], 0
je 0x10009398
mov ecx, dword [esp + 0x10]
push ecx
push 0
call fcn.10009a5a
xor eax, eax
mov ecx, dword [esp + 0x188]
pop ebp
pop edi
pop ebx
pop esi
xor ecx, esp
call fcn.1001524a
add esp, 0x17c
ret