Function at 0x140040450
Capabilities:
Get common file path
Query environment variable

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push rdi
push r15
sub rsp, 0x430
mov rax, qword [0x14049b9c0]
xor rax, rsp
mov qword [rsp + 0x420], rax
xor r15d, r15d
mov edx, 0x40
mov edi, r15d
mov rbp, rcx
call fcn.14003fc00
mov rbx, rax
test rax, rax
je 0x14004072b
xorps xmm0, xmm0
mov qword [rsp + 0x458], rsi
movups xmmword [rax], xmm0
mov edx, 0x200
lea rcx, [rsp + 0x220]
movups xmmword [rax + 0x10], xmm0
mov qword [rsp + 0x460], r14
movups xmmword [rax + 0x20], xmm0
movups xmmword [rax + 0x30], xmm0
call qword [sym.imp.KERNEL32.dll_GetSystemWindowsDirectoryA]
mov r14d, 1
test eax, eax
je 0x14004050d
lea rdx, [rsp + 0x220]
lea rcx, [rsp + 0x20]
call fcn.1400479d0
mov r8, rax
lea rdx, [rsp + 0x20]
mov rcx, rbp
call fcn.140040030
test rax, rax
jne 0x1400404fc
mov edi, r14d
jmp 0x14004050d
mov r8d, 8
mov rdx, rbx
mov rcx, rax
call fcn.140048580
mov edx, 0x200
lea rcx, [rsp + 0x220]
call qword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
test eax, eax
je 0x140040566
lea rdx, [rsp + 0x220]
lea rcx, [rsp + 0x20]
call fcn.1400479d0
mov r8, rax
lea rdx, [rsp + 0x20]
mov rcx, rbp
call fcn.140040030
test rax, rax
jne 0x140040550
mov eax, r14d
jmp 0x140040564
mov r8d, 8
mov rdx, rbx
mov rcx, rax
call fcn.140048580
mov eax, r15d
add edi, eax
lea rdx, [0x1400aa108]
lea rcx, [rsp + 0x20]
call fcn.1400479d0
mov r8, rax
lea rdx, [rsp + 0x20]
mov rcx, rbp
call fcn.140040030
test rax, rax
jne 0x140040591
mov eax, r14d
jmp 0x1400405a5
mov r8d, 8
mov rdx, rbx
mov rcx, rax
call fcn.140048580
mov eax, r15d
mov r8d, 0x200
lea rdx, [rsp + 0x220]
xor ecx, ecx
add edi, eax
mov rsi, r15
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
je 0x1400406a2
lea rcx, [rsp + 0x220]
call fcn.140074010
lea rcx, [rsp + 0x220]
cmp rax, rcx
jbe 0x140040605
cmp byte [rax], 0x5c
jne 0x1400405ef
test rsi, rsi
jne 0x140040601
mov rsi, rax
dec rax
lea rcx, [rsp + 0x220]
cmp rax, rcx
ja 0x1400405e2
jmp 0x140040605
mov byte [rax + 1], r15b
lea rdx, [rsp + 0x220]
lea rcx, [rsp + 0x20]
call fcn.1400479d0
mov r8, rax
lea rdx, [rsp + 0x20]
mov rcx, rbp
call fcn.140040030
test rax, rax
jne 0x140040631
mov eax, r14d
jmp 0x140040645
mov r8d, 8
mov rdx, rbx
mov rcx, rax
call fcn.140048580
mov eax, r15d
lea r8, str._data
mov edx, 0x200
lea rcx, [rsp + 0x220]
add edi, eax
call sub.api_ms_win_crt_string_l1_1_0.dll_strcat_s
lea rdx, [rsp + 0x220]
lea rcx, [rsp + 0x20]
call fcn.1400479d0
mov r8, rax
lea rdx, [rsp + 0x20]
mov rcx, rbp
call fcn.140040030
test rax, rax
jne 0x14004068c
mov eax, r14d
jmp 0x1400406a0
mov r8d, 8
mov rdx, rbx
mov rcx, rax
call fcn.140048580
mov eax, r15d
add edi, eax
lea rcx, str.MARIADB_HOME
call sub.api_ms_win_crt_environment_l1_1_0.dll_getenv
mov rsi, qword [rsp + 0x458]
test rax, rax
jne 0x1400406cc
lea rcx, str.MYSQL_HOME
call sub.api_ms_win_crt_environment_l1_1_0.dll_getenv
test rax, rax
je 0x1400406dc
mov r8, rbx
mov rdx, rax
mov rcx, rbp
call fcn.140040390
add edi, eax
lea rdx, [0x140096c7a]
lea rcx, [rsp + 0x20]
call fcn.1400479d0
mov r8, rax
lea rdx, [rsp + 0x20]
mov rcx, rbp
call fcn.140040030
test rax, rax
je 0x140040716
mov r8d, 8
mov rdx, rbx
mov rcx, rax
call fcn.140048580
mov r14d, r15d
lea eax, [r14 + rdi]
mov r14, qword [rsp + 0x460]
test eax, eax
cmovg rbx, r15
mov rax, rbx
mov rcx, qword [rsp + 0x420]
xor rcx, rsp
call fcn.14008e500
mov rbx, qword [rsp + 0x468]
add rsp, 0x430
pop r15
pop rdi
pop rbp
ret