Function at 0x140012690
Capabilities:
Check mutex on windows
Create directory
Get common file path

Disassembly:
mov rax, rsp
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rax - 0x428]
sub rsp, 0x500
mov qword [rbp - 0x68], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov r12, r9
mov r13, r8
mov rsi, rdx
mov r14, rcx
xor ebx, ebx
mov dword [rsp + 0x50], ebx
xor edx, edx
mov r8d, 0x208
add rcx, 0x18
call fcn.14003dad0
mov r8, r12
mov rdx, r13
mov rcx, r14
call fcn.1400139f0
mov dword [r14 + 0x220], eax
lea eax, [rax + rax*4]
lea eax, [rax*2 + 1]
mov dword [r14 + 0x224], eax
lea r15d, [rbx + 1]
cmp byte [r14 + 0x240], bl
jne 0x14001296a
xor edx, edx
mov r8d, 0x208
lea rcx, [rbp - 0x20]
call fcn.14003dad0
lea rax, [rbp - 0x20]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
mov edx, 0x801a
xor ecx, ecx
call qword [sym.imp.SHELL32.dll_SHGetFolderPathW]
mov r15d, eax
test eax, eax
js 0x140012a37
mov edx, 0x104
lea rcx, [rbp - 0x20]
nop dword [rax]
cmp word [rcx], bx
je 0x14001276f
add rcx, 2
sub rdx, 1
jne 0x140012760
mov ebx, 0x80070057
mov ecx, ebx
test rdx, rdx
mov r8d, 0
cmovne ecx, r8d
je 0x14001278f
mov eax, 0x104
sub rax, rdx
jmp 0x140012792
mov rax, r8
test ecx, ecx
js 0x1400127f3
mov edx, 0x104
sub rdx, rax
lea rcx, [rbp - 0x20]
lea rcx, [rcx + rax*2]
je 0x1400127e4
add rax, 0x7ffffefa
add rax, rdx
lea r9, str.hpqLog
sub r9, rcx
nop dword [rax + rax]
test rax, rax
je 0x1400127e1
movzx r8d, word [r9 + rcx]
test r8w, r8w
je 0x1400127e1
mov word [rcx], r8w
add rcx, 2
dec rax
sub rdx, 1
jne 0x1400127c0
xor r8d, r8d
lea rax, [rcx - 2]
test rdx, rdx
cmovne rax, rcx
mov word [rax], r8w
xor edx, edx
lea rcx, [rbp - 0x20]
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x140012824
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
je 0x140012824
test eax, eax
jg 0x140012819
mov r15d, eax
jmp 0x140012824
movzx r15d, ax
or r15d, 0x80070000
test r15d, r15d
js 0x140012a35
mov ecx, 0x104
lea rax, [rbp - 0x20]
cmp word [rax], 0
je 0x140012846
add rax, 2
sub rcx, 1
jne 0x140012836
mov edx, ebx
test rcx, rcx
mov r8d, 0
cmovne edx, r8d
je 0x140012861
mov eax, 0x104
sub rax, rcx
jmp 0x140012864
mov rax, r8
test edx, edx
js 0x1400128c3
mov edx, 0x104
sub rdx, rax
lea rcx, [rbp - 0x20]
lea rcx, [rcx + rax*2]
je 0x1400128b4
add rax, 0x7ffffefa
add rax, rdx
lea r9, [0x140079560]
sub r9, rcx
nop dword [rax]
test rax, rax
je 0x1400128b1
movzx r8d, word [r9 + rcx]
test r8w, r8w
je 0x1400128b1
mov word [rcx], r8w
add rcx, 2
dec rax
sub rdx, 1
jne 0x140012890
xor r8d, r8d
lea rax, [rcx - 2]
test rdx, rdx
cmovne rax, rcx
mov word [rax], r8w
mov rcx, rsi
call fcn.140007530
mov r9, rax
mov edx, 0x104
lea rcx, [rbp - 0x20]
cmp word [rcx], 0
je 0x1400128e7
add rcx, 2
sub rdx, 1
jne 0x1400128d7
test rdx, rdx
mov eax, 0
cmovne ebx, eax
je 0x1400128fc
mov eax, 0x104
sub rax, rdx
test ebx, ebx
js 0x140012951
mov r8d, 0x104
sub r8, rax
lea rcx, [rbp - 0x20]
lea rcx, [rcx + rax*2]
je 0x14001293f
add rax, 0x7ffffefa
add rax, r8
sub r9, rcx
nop
test rax, rax
je 0x14001293f
movzx edx, word [r9 + rcx]
test dx, dx
je 0x14001293f
mov word [rcx], dx
add rcx, 2
dec rax
sub r8, 1
jne 0x140012920
lea rax, [rcx - 2]
test r8, r8
cmovne rax, rcx
xor ebx, ebx
mov word [rax], bx
jmp 0x140012953
xor ebx, ebx
lea r8, [rbp - 0x20]
mov edx, 0x104
lea rcx, [r14 + 0x18]
call fcn.140047ce8
jmp 0x140012a40
mov rcx, rsi
call fcn.140007530
mov r8, rax
mov edx, 0x104
lea rcx, [r14 + 0x18]
call fcn.140047ce8
lea rdx, [r14 + 0x18]
lea rcx, [rsp + 0x78]
call fcn.140005160
nop
lea rcx, [rsp + 0x78]
call fcn.140007530
mov rcx, rax
mov qword [rsp + 0x40], rbx
mov qword [rsp + 0x38], rbx
mov qword [rsp + 0x30], rbx
mov qword [rsp + 0x28], rbx
mov qword [rsp + 0x20], 0x100
lea r9, [rbp - 0x20]
mov r8d, 3
lea rdx, [rbp + 0x430]
call fcn.140048838
mov ebx, eax
test eax, eax
jne 0x140012a27
xor eax, eax
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rax
lea r9, [rbp - 0x20]
lea r8, [rbp + 0x430]
mov edx, 0x104
lea rcx, [rbp + 0x1f0]
call fcn.140048b04
mov ebx, eax
test eax, eax
jne 0x140012a27
xor r8d, r8d
lea rdx, [rbp + 0x1f0]
xor ecx, ecx
call qword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
mov ebx, eax
cmp eax, 0xb7
mov eax, 0
cmove ebx, eax
lea rcx, [rsp + 0x78]
call fcn.140005110
test ebx, ebx
je 0x140012a3e
xor ebx, ebx
mov word [r14 + 0x18], bx
jmp 0x140012a40
xor ebx, ebx
lea rcx, [rbp - 0x60]
call fcn.14000af20
nop
cmp word [r14 + 0x18], 0
je 0x140012a67
lea rdx, [r14 + 0x18]
lea rcx, [rbp - 0x40]
call fcn.140005160
nop
mov ebx, 1
jmp 0x140012ad5
lea rdx, [rbp + 0x430]
lea rcx, [rsp + 0x78]
call fcn.1400051e0
lea rcx, [rsp + 0x78]
call fcn.140005520
mov qword [rax], 7
lea rcx, [rsp + 0x78]
call fcn.1400051d0
mov word [rbp + 0x430], bx
mov qword [rax + 0x10], rbx
cmp qword [rax + 0x18], 8
jb 0x140012aa8
mov rax, qword [rax]
lea rdx, [rbp + 0x430]
mov rcx, rax
call fcn.1400029a0
or r9, 0xffffffffffffffff
xor r8d, r8d
mov rdx, rsi
lea rcx, [rsp + 0x78]
call fcn.140005530
lea rax, [rsp + 0x78]
mov ebx, 2
mov dword [rsp + 0x50], ebx
mov rdx, rax
lea rcx, [rsp + 0x58]
call fcn.140007880
nop
test bl, 2
je 0x140012afe
and ebx, 0xfffffffd
mov dword [rsp + 0x50], ebx
lea rcx, [rsp + 0x78]
call fcn.140005110
nop
test bl, 1
je 0x140012b13
and ebx, 0xfffffffe
mov dword [rsp + 0x50], ebx
lea rcx, [rbp - 0x40]
call fcn.140005110
mov r9d, 1
xor r8d, r8d
lea rdx, [0x140079400]
lea rcx, [rsp + 0x58]
call fcn.1400154e0
test eax, eax
jle 0x140012bd8
inc eax
movsxd rsi, eax
lea rcx, [rsp + 0x58]
call fcn.1400051c0
mov rdi, qword [rax]
cmp rdi, rsi
ja 0x140012b7e
lea rcx, [rsp + 0x58]
call fcn.1400051d0
xor edi, edi
mov word [rbp + 0x430], di
mov qword [rax + 0x10], rdi
cmp qword [rax + 0x18], 8
jb 0x140012b6d
mov rax, qword [rax]
lea rdx, [rbp + 0x430]
mov rcx, rax
call fcn.1400029a0
jmp 0x140012bda
test rsi, rsi
je 0x140012bd8
lea rcx, [rsp + 0x58]
call fcn.1400051d0
mov rbx, rax
cmp qword [rax + 0x18], 8
jb 0x140012b9c
mov rcx, qword [rax]
jmp 0x140012b9f
mov rcx, rbx
sub rdi, rsi
je 0x140012bb1
lea r8, [rdi + rdi]
lea rdx, [rcx + rsi*2]
call fcn.14003cdf0
xor eax, eax
mov word [rbp + 0x430], ax
mov qword [rbx + 0x10], rdi
cmp qword [rbx + 0x18], 8
jb 0x140012bc8
mov rbx, qword [rbx]
lea rcx, [rbx + rdi*2]
lea rdx, [rbp + 0x430]
call fcn.1400029a0
xor edi, edi
mov ebx, edi
nop dword [rax]
movsxd r8, ebx
mov r9d, 1
lea rdx, [0x140079560]
lea rcx, [rsp + 0x58]
call fcn.1400154e0
mov rbx, rax
test eax, eax
js 0x140012c10
movsxd rdx, eax
lea rcx, [rsp + 0x58]
call fcn.140014cf0
jmp 0x140012be0
lea r8, [rsp + 0x58]
lea rdx, str.Global_
lea rcx, [rbp - 0x40]
call fcn.1400162f0
nop
mov rdx, rax
lea rcx, [rbp - 0x60]
call fcn.140014ee0
nop
lea rcx, [rbp - 0x40]
call fcn.140005110
lea rcx, [rbp - 0x60]
call fcn.140007530
mov r8, rax
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateMutexW]
mov qword [r14 + 0x238], rax
test r15d, r15d
js 0x140012d22
mov rcx, r14
call fcn.140012de0
test eax, eax
je 0x140012d22
mov rcx, r14
call fcn.140013070
test al, al
jne 0x140012c88
mov dl, 1
mov rcx, r14
call fcn.140013140
mov r8, r12
mov rdx, r13
mov rcx, r14
call fcn.140013b20
cmp byte [r14 + 0x228], 0
je 0x140012ce6
mov ecx, 0x50
call fcn.14001ce60
mov rbx, rax
mov qword [rbp + 0x430], rax
mov qword [rax], rdi
mov qword [rax + 8], rdi
xor r8d, r8d
xor edx, edx
call fcn.1400161d0
mov qword [rbx], rax
mov qword [rbx + 0x10], r14
mov byte [rbx + 0x18], 0
mov qword [rbx + 0x20], rdi
lea rcx, [rbx + 0x28]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
nop
mov qword [r14 + 0x248], rbx
mov rcx, qword [r14 + 0x230]
test rcx, rcx
je 0x140012d22
cmp qword [r14 + 0x238], 0
je 0x140012d22
call fcn.1400438f4
mov rcx, qword [r14 + 0x230]
call fcn.1400436d4
mov qword [r14 + 0x230], rdi
mov rcx, qword [r14 + 0x238]
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
nop
lea rcx, [rsp + 0x58]
call fcn.140005110
nop
lea rcx, [rbp - 0x60]
call fcn.140005110
lea r11, [rsp + 0x500]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret