Function at 0x6861ab50
Capabilities:
Get common file path

Disassembly:
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x678
test rcx, rcx
mov rbx, rcx
je 0x6861a482
call sym.libglib_2.0_0.dll_g_path_is_absolute
test eax, eax
jne 0x6861a206
mov edx, 0x5c
mov rcx, rbx
call sub.msvcrt.dll_strchr
test rax, rax
je 0x6861a250
mov edx, 8
mov rcx, rbx
call sym.libglib_2.0_0.dll_g_file_test_utf8
test eax, eax
je 0x6861a470
mov edx, 4
mov rcx, rbx
call sym.libglib_2.0_0.dll_g_file_test_utf8
test eax, eax
jne 0x6861a470
mov rcx, rbx
call sym.libglib_2.0_0.dll_g_strdup
add rsp, 0x678
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
mov edx, 0x2f
mov rcx, rbx
call sub.msvcrt.dll_strchr
test rax, rax
jne 0x6861a206
lea rcx, str.PATH
xor esi, esi
call sym.libglib_2.0_0.dll_g_getenv_utf8
xor ecx, ecx
mov r13, rax
mov r8d, 0x104
lea rdx, [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
sub eax, 1
cmp eax, 0x102
jbe 0x6861a53f
mov edx, 0x104
lea rcx, [rsp + 0x250]
xor r12d, r12d
call qword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
sub eax, 1
cmp eax, 0x102
jbe 0x6861a516
mov edx, 0x104
lea rcx, [rsp + 0x460]
xor edi, edi
call qword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
sub eax, 1
cmp eax, 0x102
jbe 0x6861a4ed
xor ebp, ebp
test rsi, rsi
je 0x6861a2f5
mov rcx, rsi
call sym.libglib_2.0_0.dll_g_path_get_dirname
mov rcx, rsi
mov rbp, rax
call sym.libglib_2.0_0.dll_g_free
mov rcx, r13
call sym.libglib_2.0_0.dll_g_strdup
test rdi, rdi
mov rsi, rax
mov r13, rax
je 0x6861a330
lea rdx, [0x686b3dd6]
xor r9d, r9d
mov r8, rax
mov rcx, rdi
call sym.libglib_2.0_0.dll_g_strconcat
mov rcx, r13
mov rsi, rax
call sym.libglib_2.0_0.dll_g_free
mov rcx, rdi
call sym.libglib_2.0_0.dll_g_free
test r12, r12
mov rdi, rsi
je 0x6861a360
lea rdx, [0x686b3dd6]
xor r9d, r9d
mov r8, rsi
mov rcx, r12
call sym.libglib_2.0_0.dll_g_strconcat
mov rcx, rsi
mov rdi, rax
call sym.libglib_2.0_0.dll_g_free
mov rcx, r12
call sym.libglib_2.0_0.dll_g_free
lea rcx, [0x686b3dd8]
xor r8d, r8d
mov rdx, rdi
call sym.libglib_2.0_0.dll_g_strconcat
mov rcx, rdi
mov r12, rax
call sym.libglib_2.0_0.dll_g_free
test rbp, rbp
mov rsi, r12
je 0x6861a3ad
lea rdx, [0x686b3dd6]
xor r9d, r9d
mov r8, r12
mov rcx, rbp
call sym.libglib_2.0_0.dll_g_strconcat
mov rcx, r12
mov rsi, rax
call sym.libglib_2.0_0.dll_g_free
mov rcx, rbp
call sym.libglib_2.0_0.dll_g_free
mov rcx, rbx
call sub.msvcrt.dll_strlen
mov rcx, rsi
lea rbp, [rax + 1]
call sub.msvcrt.dll_strlen
lea r13, [rax + 1]
mov r12, rax
lea rcx, [r13 + rbp]
call sym.libglib_2.0_0.dll_g_malloc
mov rdi, rax
lea rcx, [rax + r13]
mov rdx, rbx
mov r8, rbp
add r12, rdi
call sub.msvcrt.dll_memcpy
mov byte [r12], 0x5c
mov rdx, rsi
nop
movzx r9d, byte [rdx]
mov rbx, rdx
test r9b, r9b
je 0x6861a4ae
cmp r9b, 0x3b
jne 0x6861a416
jmp 0x6861a4ae
cmp r9b, 0x3b
je 0x6861a423
add rbx, 1
movzx r9d, byte [rbx]
test r9b, r9b
jne 0x6861a410
cmp rdx, rbx
je 0x6861a4ae
mov r8, rbx
mov rcx, r12
sub r8, rdx
sub rcx, r8
call sub.msvcrt.dll_memcpy
mov rbp, rax
mov edx, 8
mov rcx, rbp
call sym.libglib_2.0_0.dll_g_file_test_utf8
test eax, eax
jne 0x6861a4b5
cmp byte [rbx], 0
lea rdx, [rbx + 1]
jne 0x6861a3f0
mov rcx, rdi
call sym.libglib_2.0_0.dll_g_free
mov rcx, rsi
call sym.libglib_2.0_0.dll_g_free
nop word [rax + rax]
xor eax, eax
add rsp, 0x678
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
lea r8, str.program___NULL
lea rdx, str.inner_find_program_in_path
lea rcx, [0x686b3deb]
call sym.libglib_2.0_0.dll_g_return_if_fail_warning
xor eax, eax
add rsp, 0x678
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
lea rbp, [r12 + 1]
jmp 0x6861a440
mov edx, 4
mov rcx, rbp
call sym.libglib_2.0_0.dll_g_file_test_utf8
test eax, eax
jne 0x6861a451
mov rcx, rbp
call sym.libglib_2.0_0.dll_g_strdup
mov rcx, rdi
mov qword [rsp + 0x38], rax
call sym.libglib_2.0_0.dll_g_free
mov rcx, rsi
call sym.libglib_2.0_0.dll_g_free
mov rax, qword [rsp + 0x38]
jmp 0x6861a238
lea rcx, [rsp + 0x460]
mov qword [rsp + 0x20], 0
xor r9d, r9d
xor r8d, r8d
mov edx, 0xffffffff
call sym.libglib_2.0_0.dll_g_utf16_to_utf8
mov rdi, rax
jmp 0x6861a2db
lea rcx, [rsp + 0x250]
mov qword [rsp + 0x20], 0
xor r9d, r9d
xor r8d, r8d
mov edx, 0xffffffff
call sym.libglib_2.0_0.dll_g_utf16_to_utf8
mov r12, rax
jmp 0x6861a2b8
lea rcx, [rsp + 0x40]
mov qword [rsp + 0x20], 0
xor r9d, r9d
xor r8d, r8d
mov edx, 0xffffffff
call sym.libglib_2.0_0.dll_g_utf16_to_utf8
mov rsi, rax
jmp 0x6861a294
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x28
mov edx, 0x2e
mov r13, rcx
call sub.msvcrt.dll_strrchr
test rax, rax
mov rbx, rax
je 0x6861ab8b
mov edx, 0x5c
mov rcx, rax
call sub.msvcrt.dll_strchr
test rax, rax
je 0x6861ac77
mov rcx, r13
call sub.msvcrt.dll_strlen
lea rcx, str.PATHEXT
movsxd rbp, eax
call sym.libglib_2.0_0.dll_g_getenv_utf8
lea rdx, str..exe_.cmd_.bat_.com
lea rcx, [0x686b3dd6]
mov r8, rax
xor r9d, r9d
call sym.libglib_2.0_0.dll_g_build_path
mov r14, rax
mov rdi, rax
movzx eax, byte [rdi]
mov rbx, rdi
test al, al
je 0x6861ac6f
cmp al, 0x3b
jne 0x6861abe6
jmp 0x6861ac6f
cmp r9b, 0x3b
je 0x6861abf3
add rbx, 1
movzx r9d, byte [rbx]
test r9b, r9b
jne 0x6861abe0
mov r12, rbx
sub r12, rdi
mov r15, r12
add r12, rbp
lea rcx, [r12 + 1]
call sym.libglib_2.0_0.dll_g_malloc
mov r8, rbp
mov rsi, rax
mov rdx, r13
mov rcx, rax
call sub.msvcrt.dll_memcpy
lea rcx, [rsi + rbp]
mov r8, r15
mov rdx, rdi
call sub.msvcrt.dll_memcpy
mov rcx, rsi
mov byte [rsi + r12], 0
call 0x6861a1d0
mov rcx, rsi
mov r12, rax
call sym.libglib_2.0_0.dll_g_free
test r12, r12
jne 0x6861ac53
cmp byte [rbx], 0
lea rdi, [rbx + 1]
jne 0x6861abc1
mov rcx, r14
call sym.libglib_2.0_0.dll_g_free
mov rax, r12
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
xor r15d, r15d
xor r12d, r12d
jmp 0x6861abfc
mov edx, 0x2f
mov rcx, rbx
call sub.msvcrt.dll_strchr
test rax, rax
jne 0x6861ab8b
mov rcx, r13
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
jmp 0x6861a1d0