Function at 0x140118d80
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.140167340
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 [0x1401ea158]
xor rax, rsp
mov qword [rsp + 0x10180], rax
mov rax, qword [rcx + 0x10]
test rax, rax
je 0x1401194a4
bt dword [rax + 0xa8], 0x11
jae 0x1401194a4
call fcn.14012a060
mov rdx, rax
xor ecx, ecx
test rax, rax
setne cl
test ecx, ecx
jne 0x140118e07
mov ecx, 0x80004005
call fcn.140002cb0
int3
mov rax, qword [rax]
mov rcx, rdx
call qword [rax + 0x18]
lea rbx, [rax + 0x18]
mov qword [rsp + 0x50], rbx
lea rdx, [0x14017f438]
or rsi, 0xffffffffffffffff
test rdx, 0xffffffffffff0000
jne 0x140118e53
movzx edi, dx
mov ecx, edi
call fcn.140138f84
test rax, rax
je 0x140118e74
mov r8d, edi
mov rdx, rax
lea rcx, [rsp + 0x50]
call fcn.140004c30
mov rbx, qword [rsp + 0x50]
jmp 0x140118e74
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.140003210
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 0x140118ead
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 0x140118ed0
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.140146a50
xor r9d, r9d
lea r8, str.ADRExtracted
lea rdx, str.General
lea rcx, [0x140206e90]
call fcn.1401386a8
mov edi, eax
mov r13d, 1
test eax, eax
jne 0x140118f2f
mov r9d, r13d
lea r8, str.ADRExtracted
lea rdx, str.General
lea rcx, [0x140206e90]
call fcn.140138748
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 0x140118fcb
lea rdx, [rbx - 0x18]
mov rdi, qword [rdx]
cmp dword [rdx + 8], eax
je 0x140119053
cmp dword [rdx + 0x10], eax
jge 0x140118f9d
cmp dword [rbx - 0xc], eax
jge 0x140118f92
mov ecx, 0x80070057
call fcn.140002cb0
int3
mov dword [rbx - 0x10], eax
mov word [rbx], ax
jmp 0x140119053
mov eax, esi
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x140118fb4
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 0x140119053
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 0x140118ffc
mov edx, edi
lea rcx, [rsp + 0x50]
call fcn.140002cd0
mov rbx, qword [rsp + 0x50]
cmp r12, rbp
ja 0x14011901c
movsxd rax, edi
lea rbp, [rax + rax]
lea r8, [rbx + r12*2]
mov r9, rbp
mov rdx, rbp
mov rcx, rbx
call fcn.140144e50
jmp 0x140119039
movsxd rax, edi
lea rbp, [rax + rax]
mov r9, rbp
lea r8, [rsp + 0x180]
mov rdx, rbp
mov rcx, rbx
call fcn.140144ee0
test edi, edi
js 0x140119499
cmp edi, dword [rbx - 0xc]
jg 0x140119499
mov dword [rbx - 0x10], edi
mov word [rbx + rbp], 0
xor eax, eax
mov rcx, rsi
lea r12, [0x1401999e8]
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 0x14011909e
mov edx, edi
lea rcx, [rsp + 0x50]
call fcn.140002cd0
mov rbx, qword [rsp + 0x50]
cmp rbp, r14
ja 0x1401190a7
lea r12, [rbx + rbp*2]
movsxd rdx, r15d
add rdx, rdx
lea rcx, [rbx + r14*2]
mov r9, rdx
mov r8, r12
call fcn.140144ee0
test edi, edi
js 0x14011948e
cmp edi, dword [rbx - 0xc]
jg 0x14011948e
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.140148fe0
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 0x140119153
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x140119177
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 0x1401192c6
call fcn.14013c798
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 0x1401191c7
lea rdx, [rbx - 0x18]
lock xadd dword [rdx + 0x10], esi
add esi, 0xffffffff
test esi, esi
jg 0x1401194a4
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
jmp 0x1401194a4
call fcn.14013c798
mov rdx, rdi
mov rcx, qword [rax + 0x10]
call qword [sym.imp.KERNEL32.dll_SizeofResource]
mov ebp, eax
test eax, eax
jne 0x140119201
lea rdx, [rbx - 0x18]
lock xadd dword [rdx + 0x10], esi
add esi, 0xffffffff
test esi, esi
jg 0x1401194a4
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
jmp 0x1401194a4
call fcn.14013c798
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 0x140119246
lea rdx, [rbx - 0x18]
lock xadd dword [rdx + 0x10], esi
add esi, 0xffffffff
test esi, esi
jg 0x1401194a4
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
jmp 0x1401194a4
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 0x14011929f
lea rdx, [rbx - 0x18]
lock xadd dword [rdx + 0x10], esi
add esi, eax
test esi, esi
jg 0x1401194a4
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
jmp 0x1401194a4
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 0x140119342
lea rdx, [rbx - 0x18]
mov rdi, qword [rdx]
cmp dword [rdx + 8], eax
je 0x1401193c8
cmp dword [rdx + 0x10], eax
jge 0x140119314
cmp dword [rbx - 0xc], eax
jge 0x140119308
mov ecx, 0x80070057
call fcn.140002cb0
int3
mov dword [rbx - 0x10], r14d
mov word [rbx], ax
jmp 0x1401193c8
mov eax, esi
lock xadd dword [rdx + 0x10], eax
add eax, 0xffffffff
test eax, eax
jg 0x14011932b
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 0x1401193c8
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 0x140119372
mov edx, ecx
lea rcx, [rsp + 0x50]
call fcn.140002cd0
mov rbx, qword [rsp + 0x50]
cmp r12, rbp
ja 0x140119392
movsxd rax, edi
lea rbp, [rax + rax]
lea r8, [rbx + r12*2]
mov r9, rbp
mov rdx, rbp
mov rcx, rbx
call fcn.140144e50
jmp 0x1401193af
movsxd rax, edi
lea rbp, [rax + rax]
mov r9, rbp
lea r8, [rsp + 0x180]
mov rdx, rbp
mov rcx, rbx
call fcn.140144ee0
test edi, edi
js 0x140119483
cmp edi, dword [rbx - 0xc]
jg 0x140119483
mov dword [rbx - 0x10], edi
mov word [rbx + rbp], r14w
test rbx, rbx
je 0x140119468
xor edx, edx
lea r8d, [rdx + 0x68]
lea rcx, [rsp + 0x110]
call fcn.140148fe0
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 0x14011944e
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x140119468
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 0x1401194a4
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
jmp 0x1401194a4
mov ecx, 0x80070057
call fcn.140002cb0
int3
mov ecx, 0x80070057
call fcn.140002cb0
int3
mov ecx, 0x80070057
call fcn.140002cb0
nop
mov rcx, qword [rsp + 0x10180]
xor rcx, rsp
call fcn.140144dc0
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