Function at 0x140003420
Capabilities:
Create directory
Query environment variable
Set file attributes

Disassembly:
mov qword [rsp + 0x18], rbx
mov qword [rsp + 0x20], rsi
push rbp
push rdi
push r14
lea rbp, [rsp - 0xf70]
mov eax, 0x1070
call fcn.14000a4c0
sub rsp, rax
mov rax, qword [0x14002e010]
xor rax, rsp
mov qword [rbp + 0xf60], rax
mov rdi, rdx
mov rsi, rcx
mov qword [rsp + 0x48], rdx
xor r14d, r14d
mov dword [rsp + 0x20], r14d
mov qword [rdx], r14
mov qword [rdx + 0x10], r14
mov qword [rdx + 0x18], 7
mov word [rdx], r14w
mov dword [rsp + 0x20], 1
mov edx, 0x400
mov rcx, rdi
call fcn.140004830
mov qword [rdi + 0x10], r14
mov rax, qword [rsi + 0x48]
mov ebx, dword [rax + 0x10]
lea r8d, [r14 + 4]
lea rdx, [0x14000b9d8]
mov rcx, rdi
call fcn.140004380
test ebx, ebx
jne 0x140003528
mov rax, qword [rsi + 0x48]
mov rdx, qword [rax + 0x28]
cmp word [rdx], bx
jne 0x140003578
xor edx, edx
mov r8d, 0x800
lea rcx, [rsp + 0x60]
call sub.VCRUNTIME140.dll_memset
mov r8d, 0x400
lea rdx, [rsp + 0x60]
lea rcx, str._programdata_BDLogging
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
lea rdx, str._programdata_
lea rcx, [rsp + 0x60]
call qword [sym.imp.VCRUNTIME140.dll_wcsstr]
test rax, rax
je 0x140003521
mov word [rsp + 0x60], r14w
mov r8d, 0x400
lea rdx, [rsp + 0x60]
lea rcx, str._ALLUSERSPROFILE_Application_DataBDLogging
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
lea rdx, [rsp + 0x60]
jmp 0x140003578
mov qword [rsp + 0x50], r14
mov r8d, 4
lea rdx, [rsp + 0x50]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea rdx, [rsp + 0x50]
mov rcx, rdi
call fcn.140004500
lea rdx, str.ProgramData
mov rcx, rdi
call fcn.140004500
mov rcx, rdi
cmp qword [rdi + 0x18], 8
jb 0x140003569
mov rcx, qword [rdi]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea rdx, str.BDLogging
mov rcx, rdi
call fcn.140004500
mov rcx, rdi
cmp qword [rdi + 0x18], 8
jb 0x14000358d
mov rcx, qword [rdi]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov rcx, rdi
cmp qword [rdi + 0x18], 8
jb 0x1400035a2
mov rcx, qword [rdi]
mov edx, 0x2000
call qword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov rax, rdi
mov rdx, qword [rdi + 0x18]
cmp rdx, 8
jb 0x1400035bd
mov rax, qword [rdi]
mov rcx, qword [rdi + 0x10]
mov ebx, 0x5c
cmp word [rax + rcx*2 - 2], bx
je 0x1400035f6
cmp rcx, rdx
jae 0x1400035eb
lea rax, [rcx + 1]
mov qword [rdi + 0x10], rax
mov rax, rdi
cmp rdx, 8
jb 0x1400035e6
mov rax, qword [rdi]
mov dword [rax + rcx*2], ebx
jmp 0x1400035f6
mov r9d, ebx
mov rcx, rdi
call fcn.1400049a0
lea rdx, str.CstLogs
mov rcx, rdi
call fcn.140004500
mov rax, rdi
mov rdx, qword [rdi + 0x18]
cmp rdx, 8
jb 0x140003615
mov rax, qword [rdi]
mov rcx, qword [rdi + 0x10]
cmp word [rax + rcx*2 - 2], bx
je 0x140003649
cmp rcx, rdx
jae 0x14000363e
lea rax, [rcx + 1]
mov qword [rdi + 0x10], rax
mov rax, rdi
cmp rdx, 8
jb 0x140003639
mov rax, qword [rdi]
mov dword [rax + rcx*2], ebx
jmp 0x140003649
mov r9d, ebx
mov rcx, rdi
call fcn.1400049a0
mov rcx, rdi
cmp qword [rdi + 0x18], 8
jb 0x140003656
mov rcx, qword [rdi]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov rcx, rdi
cmp qword [rdi + 0x18], 8
jb 0x14000366b
mov rcx, qword [rdi]
mov edx, 0x2000
call qword [sym.imp.KERNEL32.dll_SetFileAttributesW]
xor edx, edx
mov r8d, 0x1000
lea rcx, [rsp + 0x60]
call sub.VCRUNTIME140.dll_memset
mov r8d, 0x800
lea rdx, [rsp + 0x60]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov edx, ebx
lea rcx, [rsp + 0x60]
call qword [sym.imp.VCRUNTIME140.dll_wcsrchr]
test rax, rax
je 0x1400036b3
add rax, 2
jmp 0x1400036b8
lea rax, [rsp + 0x60]
mov qword [rsp + 0x28], r14
mov qword [rsp + 0x38], r14
mov qword [rsp + 0x40], 7
mov word [rsp + 0x28], r14w
mov r8, 0xffffffffffffffff
nop dword [rax + rax]
inc r8
cmp word [rax + r8*2], 0
jne 0x1400036e0
mov rdx, rax
lea rcx, [rsp + 0x28]
call fcn.140004380
mov dword [rsp + 0x20], 3
lea r8, [rsp + 0x28]
cmp qword [rsp + 0x40], 8
cmovae r8, qword [rsp + 0x28]
mov rdx, rdi
call fcn.140002c00
nop
mov rdx, qword [rsp + 0x40]
cmp rdx, 8
jb 0x14000375f
lea rdx, [rdx*2 + 2]
mov rcx, qword [rsp + 0x28]
mov rax, rcx
cmp rdx, 0x1000
jb 0x14000375a
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x14000375a
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140009330
lea rdx, [rsp + 0x28]
call fcn.140002990
nop
cmp qword [rax + 0x18], 8
jb 0x140003774
mov rax, qword [rax]
mov r8, rax
mov rdx, rdi
call fcn.140002c00
nop
mov rdx, qword [rsp + 0x40]
cmp rdx, 8
jb 0x1400037c5
lea rdx, [rdx*2 + 2]
mov rcx, qword [rsp + 0x28]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400037c0
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x1400037c0
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140009330
mov rax, rdi
mov rcx, qword [rbp + 0xf60]
xor rcx, rsp
call fcn.140009310
lea r11, [rsp + 0x1070]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x38]
mov rsp, r11
pop r14
pop rdi
pop rbp
ret