Function at 0x140131190
Capabilities:
Check if file exists
Create directory
Create process on windows
Extract resource via kernel32 functions
Get common file path
Get file attributes
Write and execute a file
Write file on windows

Disassembly:
push rdi
push r12
push r13
push r14
push r15
mov eax, 0x10190
call fcn.140181870
sub rsp, rax
mov qword [rsp + 0x90], 0xfffffffffffffffe
mov qword [rsp + 0x101c0], rbx
mov qword [rsp + 0x101c8], rbp
mov qword [rsp + 0x101d0], rsi
mov rax, qword [0x140210348]
xor rax, rsp
mov qword [rsp + 0x10180], rax
mov rax, qword [rcx + 0x10]
test rax, rax
je 0x1401318b4
bt dword [rax + 0xa8], 0x11
jae 0x1401318b4
call fcn.14013d07c
mov rdx, rax
xor ecx, ecx
test rax, rax
setne cl
test ecx, ecx
jne 0x140131217
mov ecx, 0x80004005
call fcn.140001c00
int3
mov rax, qword [rax]
mov rcx, rdx
call qword [rax + 0x18]
lea rbx, [rax + 0x18]
mov qword [rsp + 0x50], rbx
lea rdx, [0x14019cf88]
or rsi, 0xffffffffffffffff
test rdx, 0xffffffffffff0000
jne 0x140131263
movzx edi, dx
mov ecx, edi
call fcn.14013d654
test rax, rax
je 0x140131284
mov r8d, edi
mov rdx, rax
lea rcx, [rsp + 0x50]
call fcn.1400020e0
mov rbx, qword [rsp + 0x50]
jmp 0x140131284
xor eax, eax
mov rcx, rsi
mov rdi, rdx
repne scasw ax, word [rdi]
not rcx
lea r8d, [rcx - 1]
lea rcx, [rsp + 0x50]
call fcn.140002390
mov rbx, qword [rsp + 0x50]
lea rdx, [rsp + 0x180]
mov ecx, 0x7fff
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
xor eax, eax
mov rcx, rsi
lea rdi, [rsp + 0x180]
repne scasw ax, word [rdi]
not rcx
cmp word [rsp + rcx*2 + reloc.COMCTL32.dll_Ordinal_380], 0x5c
jne 0x1401312bd
mov word [rsp + rcx*2 + reloc.COMCTL32.dll_Ordinal_380], ax
lea rcx, [rsp + 0x180]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x1401312e0
xor edx, edx
lea rcx, [rsp + 0x180]
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea r8, str.RtkBtMnt.exe
mov edx, 0x7fff
lea rcx, [rsp + 0x180]
call fcn.14015e670
xor r9d, r9d
lea r8, str.ADRExtracted
lea rdx, str.General
lea rcx, [0x14022e890]
call fcn.14014ba50
mov edi, eax
mov r13d, 1
test eax, eax
jne 0x14013133f
mov r9d, r13d
lea r8, str.ADRExtracted
lea rdx, str.General
lea rcx, [0x14022e890]
call fcn.14014baf0
xor ebp, ebp
test edi, edi
sete bpl
lea rcx, [rsp + 0x180]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
cmove ebp, r13d
mov dword [rsp + 0x5c], ebp
xor eax, eax
mov rcx, rsi
lea rdi, [rsp + 0x180]
repne scasw ax, word [rdi]
not rcx
sub rcx, r13
mov rdi, rcx
test ecx, ecx
jne 0x1401313db
lea rdx, [rbx - 0x18]
mov rdi, qword [rdx]
cmp dword [rdx + 8], eax
je 0x140131463
cmp dword [rdx + 0x10], eax
jge 0x1401313ad
cmp dword [rbx - 0xc], eax
jge 0x1401313a2
mov ecx, 0x80070057
call fcn.140001c00
int3
mov dword [rbx - 0x10], eax
mov word [rbx], ax
jmp 0x140131463
mov eax, esi
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x1401313c4
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov rax, qword [rdi]
mov rcx, rdi
call qword [rax + 0x18]
lea rbx, [rax + 0x18]
mov qword [rsp + 0x50], rbx
jmp 0x140131463
mov ebp, dword [rbx - 0x10]
lea r12, [rsp + 0x180]
sub r12, rbx
sar r12, 1
mov ecx, r13d
sub ecx, dword [rbx - 8]
mov eax, dword [rbx - 0xc]
sub eax, edi
or eax, ecx
jge 0x14013140c
mov edx, edi
lea rcx, [rsp + 0x50]
call fcn.140001df0
mov rbx, qword [rsp + 0x50]
cmp r12, rbp
ja 0x14013142c
movsxd rax, edi
lea rbp, [rax + rax]
lea r8, [rbx + r12*2]
mov r9, rbp
mov rdx, rbp
mov rcx, rbx
call fcn.14015cf60
jmp 0x140131449
movsxd rax, edi
lea rbp, [rax + rax]
mov r9, rbp
lea r8, [rsp + 0x180]
mov rdx, rbp
mov rcx, rbx
call fcn.14015cd30
test edi, edi
js 0x1401318a9
cmp edi, dword [rbx - 0xc]
jg 0x1401318a9
mov dword [rbx - 0x10], edi
mov word [rbx + rbp], 0
xor eax, eax
mov rcx, rsi
lea r12, [0x1401b9d30]
mov rdi, r12
repne scasw ax, word [rdi]
not rcx
lea r15, [rcx - 1]
mov rbp, r12
sub rbp, rbx
sar rbp, 1
mov r14d, dword [rbx - 0x10]
lea edi, [r14 + rcx - 1]
mov edx, r13d
sub edx, dword [rbx - 8]
mov eax, dword [rbx - 0xc]
sub eax, edi
or eax, edx
jge 0x1401314ae
mov edx, edi
lea rcx, [rsp + 0x50]
call fcn.140001df0
mov rbx, qword [rsp + 0x50]
cmp rbp, r14
ja 0x1401314b7
lea r12, [rbx + rbp*2]
movsxd rdx, r15d
add rdx, rdx
lea rcx, [rbx + r14*2]
mov r9, rdx
mov r8, r12
call fcn.14015cd30
test edi, edi
js 0x14013189e
cmp edi, dword [rbx - 0xc]
jg 0x14013189e
mov dword [rbx - 0x10], edi
movsxd rax, edi
mov word [rbx + rax*2], 0
xor edx, edx
lea r8d, [rdx + 0x68]
lea rcx, [rsp + 0xa0]
call fcn.140160e90
mov dword [rsp + 0xa0], 0x68
xor eax, eax
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x68], rax
mov qword [rsp + 0x70], rax
lea rax, [rsp + 0x60]
mov qword [rsp + 0x48], rax
lea rax, [rsp + 0xa0]
mov qword [rsp + 0x40], rax
xor r14d, r14d
mov qword [rsp + 0x38], r14
mov qword [rsp + 0x30], r14
mov dword [rsp + 0x28], r14d
mov dword [rsp + 0x20], r14d
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
jne 0x140131563
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x140131587
or edx, 0xffffffff
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [rsp + 0x5c], r14d
je 0x1401316d6
call fcn.140153968
lea r8, str.Binary
mov edx, 0x143
mov rcx, qword [rax + 0x10]
call qword [sym.imp.KERNEL32.dll_FindResourceW]
mov rdi, rax
test rax, rax
jne 0x1401315d7
lea rdx, [rbx - 0x18]
lock xadd dword [rdx + 0x10], esi
add esi, 0xffffffff
test esi, esi
jg 0x1401318b4
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
jmp 0x1401318b4
call fcn.140153968
mov rdx, rdi
mov rcx, qword [rax + 0x10]
call qword [sym.imp.KERNEL32.dll_SizeofResource]
mov ebp, eax
test eax, eax
jne 0x140131611
lea rdx, [rbx - 0x18]
lock xadd dword [rdx + 0x10], esi
add esi, 0xffffffff
test esi, esi
jg 0x1401318b4
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
jmp 0x1401318b4
call fcn.140153968
mov rdx, rdi
mov rcx, qword [rax + 0x10]
call qword [sym.imp.KERNEL32.dll_LoadResource]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_LockResource]
mov r12, rax
test rax, rax
jne 0x140131656
lea rdx, [rbx - 0x18]
lock xadd dword [rdx + 0x10], esi
add esi, 0xffffffff
test esi, esi
jg 0x1401318b4
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
jmp 0x1401318b4
mov qword [rsp + 0x30], r14
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 2
xor r9d, r9d
mov edx, 0x40000000
lea r8d, [r9 + 2]
lea rcx, [rsp + 0x180]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
cmp rax, 0xffffffffffffffff
jne 0x1401316af
lea rdx, [rbx - 0x18]
lock xadd dword [rdx + 0x10], esi
add esi, eax
test esi, esi
jg 0x1401318b4
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
jmp 0x1401318b4
mov dword [rsp + 0x58], r14d
mov qword [rsp + 0x20], r14
lea r9, [rsp + 0x58]
mov r8d, ebp
mov rdx, r12
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov rcx, rsi
lea rdi, [rsp + 0x180]
repne scasw ax, word [rdi]
not rcx
sub rcx, r13
mov rdi, rcx
test ecx, ecx
jne 0x140131752
lea rdx, [rbx - 0x18]
mov rdi, qword [rdx]
cmp dword [rdx + 8], eax
je 0x1401317d8
cmp dword [rdx + 0x10], eax
jge 0x140131724
cmp dword [rbx - 0xc], eax
jge 0x140131718
mov ecx, 0x80070057
call fcn.140001c00
int3
mov dword [rbx - 0x10], r14d
mov word [rbx], ax
jmp 0x1401317d8
mov eax, esi
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x14013173b
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov rax, qword [rdi]
mov rcx, rdi
call qword [rax + 0x18]
lea rbx, [rax + 0x18]
mov qword [rsp + 0x50], rbx
jmp 0x1401317d8
mov ebp, dword [rbx - 0x10]
lea r12, [rsp + 0x180]
sub r12, rbx
sar r12, 1
sub r13d, dword [rbx - 8]
mov eax, dword [rbx - 0xc]
sub eax, ecx
or eax, r13d
jge 0x140131782
mov edx, ecx
lea rcx, [rsp + 0x50]
call fcn.140001df0
mov rbx, qword [rsp + 0x50]
cmp r12, rbp
ja 0x1401317a2
movsxd rax, edi
lea rbp, [rax + rax]
lea r8, [rbx + r12*2]
mov r9, rbp
mov rdx, rbp
mov rcx, rbx
call fcn.14015cf60
jmp 0x1401317bf
movsxd rax, edi
lea rbp, [rax + rax]
mov r9, rbp
lea r8, [rsp + 0x180]
mov rdx, rbp
mov rcx, rbx
call fcn.14015cd30
test edi, edi
js 0x140131893
cmp edi, dword [rbx - 0xc]
jg 0x140131893
mov dword [rbx - 0x10], edi
mov word [rbx + rbp], r14w
test rbx, rbx
je 0x140131878
xor edx, edx
lea r8d, [rdx + 0x68]
lea rcx, [rsp + 0x110]
call fcn.140160e90
mov dword [rsp + 0x110], 0x68
xor eax, eax
mov qword [rsp + 0x78], rax
mov qword [rsp + 0x80], rax
mov qword [rsp + 0x88], rax
lea rax, [rsp + 0x78]
mov qword [rsp + 0x48], rax
lea rax, [rsp + 0x110]
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x38], r14
mov qword [rsp + 0x30], r14
mov dword [rsp + 0x28], r14d
mov dword [rsp + 0x20], r14d
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
jne 0x14013185e
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x140131878
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x80]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop
lea rdx, [rbx - 0x18]
lock xadd dword [rdx + 0x10], esi
add esi, 0xffffffff
test esi, esi
jg 0x1401318b4
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
jmp 0x1401318b4
mov ecx, 0x80070057
call fcn.140001c00
int3
mov ecx, 0x80070057
call fcn.140001c00
int3
mov ecx, 0x80070057
call fcn.140001c00
nop
mov rcx, qword [rsp + 0x10180]
xor rcx, rsp
call fcn.14015d000
lea r11, [rsp + 0x10190]
mov rbx, qword [r11 + 0x30]
mov rbp, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret