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

Disassembly:
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
push rbp
sub rsp, 0x438
mov rbp, rdx
mov r12, r9
mov r15, r8
mov r14, rcx
mov edi, 1
xor r13d, r13d
cmp qword [rbp], 3
je 0x140069a94
mov r8d, dword [r14 + 0x1b0]
cmp r8d, 0xfffffffc
je 0x140069a32
cmp r8d, 0xfffffffd
je 0x14006922b
cmp r8d, 0xfffffffe
jne 0x140069212
test byte [r14 + 0x24d], 4
je 0x1400692d0
jmp 0x140069aee
cmp r8d, 0xffffffff
jne 0x140069251
test byte [r14 + 0x24d], 4
je 0x1400692ae
jmp 0x140069adb
movzx eax, byte [r14 + 0x24d]
test al, 4
je 0x1400692f2
test byte [r14 + 0x244], 1
jne 0x1400692f2
jne 0x1400692d0
jne 0x1400692ae
mov rdx, qword [rbp + 8]
test rdx, rdx
je 0x1400694f3
mov r8d, 0x100
cmp dword [rbp + 0x10], 0x100
lea rcx, [rsp + 0x323]
mov qword [rsp + 0x430], rcx
cmovl r8d, dword [rbp + 0x10]
mov dword [rsp + 0x424], r8d
movsxd r8, r8d
call fcn.14009ef60
mov eax, dword [rsp + 0x424]
movsxd rax, eax
mov rbx, qword [rsp + 0x430]
mov byte [rbx + rax], 0
movsx edx, byte [rbx]
jmp 0x140069347
lea rcx, str.FOR_PRINT
call fcn.14003fb28
mov rbx, rax
mov qword [rsp + 0x430], rbx
test rbx, rbx
je 0x1400696cb
jmp 0x140069312
lea rcx, str.FOR_TYPE
call fcn.14003fb28
mov rbx, rax
mov qword [rsp + 0x430], rbx
test rbx, rbx
je 0x1400696f3
jmp 0x140069312
lea rcx, str.FOR_ACCEPT
call fcn.14003fb28
mov rbx, rax
mov qword [rsp + 0x430], rbx
test rbx, rbx
je 0x140069a0a
mov rdx, rbx
mov rcx, rdx
and rdx, 0xfffffffffffffff0
pxor xmm0, xmm0
pcmpeqb xmm0, xmmword [rdx]
pmovmskb eax, xmm0
and ecx, 0xf
shr eax, cl
bsf eax, eax
jne 0x14006933d
mov rax, rdx
add rdx, rcx
call fcn.14009ef90
mov dword [rsp + 0x424], eax
movsx edx, byte [rbx]
cmp edx, 0x20
jne 0x140069369
test eax, eax
jle 0x140069369
inc rbx
dec eax
mov qword [rsp + 0x430], rbx
mov dword [rsp + 0x424], eax
cmp byte [rbx], 0x20
je 0x14006934c
xor r8d, r8d
mov r10d, eax
mov r9d, eax
xor esi, esi
xor ecx, ecx
test eax, eax
jle 0x1400693aa
movsxd rdx, eax
add rdx, rbx
movsx r11d, byte [rcx + rdx - 1]
cmp r11d, 0x20
je 0x140069391
test r11d, r11d
jne 0x1400693aa
inc r8d
lea eax, [r9 + rsi - 1]
dec esi
dec rcx
mov dword [rsp + 0x424], eax
cmp r8d, r10d
jb 0x140069380
test eax, eax
jne 0x1400693f2
test byte [r14 + 0x24d], 4
je 0x1400693f2
mov rcx, r14
lea rdx, [rsp + 0x430]
lea r8, [rsp + 0x424]
call fcn.140069b10
test eax, eax
jne 0x1400693de
mov rbx, qword [rsp + 0x430]
jmp 0x1400693f2
add rsp, 0x438
pop rbp
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret
test edi, edi
je 0x14006947c
movsxd rax, dword [rsp + 0x424]
mov rcx, r14
mov rdx, rbx
mov byte [rbx + rax], 0
call fcn.14004d550
cmp eax, 0xffffffff
je 0x140069738
xor edi, edi
cmp dword [0x1400fc280], 0
jne 0x14006942a
cmp eax, 0xfffffffa
je 0x140069462
cmp eax, 1
je 0x140069462
test eax, eax
jne 0x140069440
mov ecx, 0xfffffff6
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
jmp 0x14006946d
cmp eax, 2
jne 0x140069452
mov ecx, 0xfffffff4
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
jmp 0x14006946d
mov rbx, qword [rsp + 0x430]
mov r13d, 1
jmp 0x14006947c
mov ecx, 0xfffffff5
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
mov qword [r14 + 0x178], rax
mov rbx, qword [rsp + 0x430]
mov rdx, r15
mov rcx, rbx
test cl, 3
je 0x14006949a
mov al, byte [rcx]
inc rcx
test al, al
mov byte [rdx], al
je 0x14006949f
inc rdx
test cl, 3
jne 0x140069487
call fcn.14009efc0
cmp dword [0x1400fc280], 0
je 0x1400694bc
test edi, edi
jne 0x1400694ca
cmp qword [r14 + 0x178], 0xffffffffffffffff
je 0x14006971b
jmp 0x1400694ca
test edi, edi
jne 0x1400694ca
cmp qword [r14 + 0x178], 0xffffffffffffffff
je 0x1400694cf
test r13d, r13d
je 0x1400694d9
mov dword [r12], 1
jmp 0x1400694dd
mov dword [r12], edi
xor eax, eax
add rsp, 0x438
pop rbp
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret
lea rdx, str.FORT_d
lea rcx, [rsp + 0x323]
call fcn.14002d710
lea rcx, [rsp + 0x323]
call fcn.14003fb28
mov rbx, rax
mov qword [rsp + 0x430], rbx
test rbx, rbx
jne 0x140069312
mov eax, dword [r14 + 0x1b0]
add eax, 4
cmp eax, 0xa
ja case.0x14006954d.1
movsxd rax, eax
lea rdx, [0x140000000]
mov rcx, qword [rdx + rax*8 + 0xb9500]
jmp rcx
mov ecx, 0xfffffff4
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
lea rbx, str.CONOUT_
mov qword [r14 + 0x178], rax
mov qword [rsp + 0x430], rbx
jmp 0x1400695b6
mov ecx, 0xfffffff5
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
lea rbx, str.CONOUT_
mov qword [r14 + 0x178], rax
mov qword [rsp + 0x430], rbx
jmp 0x1400695b6
mov ecx, 0xfffffff6
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
lea rbx, [0x1400b2c80]
mov qword [r14 + 0x178], rax
mov qword [rsp + 0x430], rbx
xor edi, edi
test rbx, rbx
jne 0x140069312
test byte [r14 + 0x24d], 4
jne 0x1400696ab
test byte [r14 + 0x245], 0x20
je 0x14006963b
mov rbx, qword [r14 + 0xb8]
mov rdx, rbx
mov qword [rsp + 0x430], rbx
mov rcx, rdx
and rdx, 0xfffffffffffffff0
pxor xmm0, xmm0
pcmpeqb xmm0, xmmword [rdx]
pmovmskb eax, xmm0
and ecx, 0xf
shr eax, cl
bsf eax, eax
jne 0x140069613
mov rax, rdx
add rdx, rcx
call fcn.14009ef90
mov rdx, qword [rbp]
mov dword [rsp + 0x424], eax
test rdx, rdx
je 0x140069633
mov qword [rbp], 0
movsx edx, byte [rbx]
jmp 0x140069347
movsx edx, byte [rbx]
jmp 0x140069347
lea rdx, str.fort._d
lea rcx, [rsp + 0x323]
mov r8d, dword [r14 + 0x1b0]
call fcn.14002d710
lea rdx, [rsp + 0x323]
mov rcx, rdx
and rdx, 0xfffffffffffffff0
pxor xmm0, xmm0
pcmpeqb xmm0, xmmword [rdx]
pmovmskb eax, xmm0
and ecx, 0xf
shr eax, cl
bsf eax, eax
jne 0x140069686
mov rax, rdx
add rdx, rcx
call fcn.14009ef90
lea rbx, [rsp + 0x323]
mov rcx, rbx
mov rdx, rbx
mov qword [rsp + 0x430], rdx
mov dword [rsp + 0x424], eax
movsx edx, byte [rcx]
jmp 0x140069347
xor eax, eax
lea rbx, [rsp + 0x323]
mov qword [rsp + 0x430], rbx
mov byte [rbx], al
mov dword [rsp + 0x424], eax
jmp 0x140069369
mov ecx, 0xfffffff5
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
lea rbx, str.CONOUT_
xor edi, edi
mov qword [r14 + 0x178], rax
mov qword [rsp + 0x430], rbx
jmp 0x140069312
mov ecx, 0xfffffff5
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
lea rbx, str.CONOUT_
xor edi, edi
mov qword [r14 + 0x178], rax
mov qword [rsp + 0x430], rbx
jmp 0x140069312
test r13d, r13d
jne 0x1400694cf
mov qword [r14 + 0x178], 0
mov dword [r12], edi
jmp 0x1400694dd
mov rdx, qword [rbp + 0x18]
test byte [r14 + 0x24d], 8
jne 0x140069751
test rdx, rdx
je 0x140069842
jmp 0x14006975a
test rdx, rdx
je 0x1400699db
mov rax, qword [rbp + 0x20]
mov ebx, eax
cmp ebx, 0xff
jle 0x140069781
mov eax, reloc.LMGR10.dll_Ordinal_43
add rsp, 0x438
pop rbp
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret
movsxd rsi, eax
lea rcx, [rsp + 0x222]
mov r8, rsi
call fcn.14009ef60
lea rdx, [rsp + 0x222]
mov byte [rsp + rsi + 0x222], 0
jmp 0x140069981
test ebx, ebx
jg 0x1400697b1
xor esi, esi
jmp 0x1400697c2
movsxd rbx, ebx
xor esi, esi
mov eax, 1
cmp byte [rdx + rbx], 0x5c
cmovne esi, eax
cmp qword [rbp], 3
je 0x140069893
mov eax, esi
add eax, dword [rsp + 0x424]
add eax, ebx
cmp eax, 0x100
jle 0x1400697f8
mov eax, reloc.LMGR10.dll_Ordinal_43
add rsp, 0x438
pop rbp
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret
movsxd rbx, ebx
mov rcx, r15
mov r8, rbx
call fcn.14009ef60
test esi, esi
je 0x14006980f
mov byte [rbx + r15], 0x5c
movsxd r8, dword [rsp + 0x424]
mov rdx, qword [rsp + 0x430]
lea rcx, [r15 + rsi]
add rcx, rbx
call fcn.14009ef60
movsxd rax, dword [rsp + 0x424]
add rbx, rsi
add rax, r15
mov byte [rbx + rax], 0
jmp 0x14006949f
mov rcx, qword [rsp + 0x430]
mov edx, 0x101
lea r8, [rsp + 0x222]
lea r9, [rsp + 0x428]
call qword [sym.imp.KERNEL32.dll_GetFullPathNameA]
test eax, eax
je 0x14006988a
mov eax, eax
cmp rax, 0x101
jae 0x14006988a
mov dword [rsp + 0x424], eax
lea rdx, [rsp + 0x222]
mov qword [rsp + 0x430], rdx
xor edx, edx
xor ebx, ebx
jmp 0x1400697ad
test byte [r14 + 0x245], 0x20
jne 0x1400697cd
mov rax, qword [rbp + 0x18]
test rax, rax
je 0x140069901
mov rcx, rdx
lea rbx, [rsp + 0x121]
lea rdx, [0x1400b9910]
xor r8d, r8d
mov r9, rbx
call qword [sym.imp.KERNEL32.dll_GetTempFileNameA]
test byte [r14 + 0x24d], 8
lea rcx, [rsp + 0x123]
mov rdx, r15
cmove rcx, rbx
test cl, 3
je 0x1400698f7
mov al, byte [rcx]
inc rcx
test al, al
mov byte [rdx], al
je 0x1400698fc
inc rdx
test cl, 3
jne 0x1400698e4
call fcn.14009efc0
jmp 0x14006949f
test byte [r14 + 0x24d], 8
je 0x14006991c
mov byte [rsp + 0x20], 0x2e
lea rdx, [rsp + 0x20]
mov byte [rsp + 0x21], 0
jmp 0x1400698aa
lea rcx, str.FORT_TMPDIR
call fcn.14003fb28
test rax, rax
je 0x14006995c
mov rcx, rax
lea rdx, [rsp + 0x20]
test cl, 3
je 0x14006994d
mov al, byte [rcx]
inc rcx
test al, al
mov byte [rdx], al
je 0x140069952
inc rdx
test cl, 3
jne 0x14006993a
call fcn.14009efc0
lea rdx, [rsp + 0x20]
jmp 0x1400698aa
mov ecx, 0x100
lea rdx, [rsp + 0x20]
call qword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
lea rdx, [rsp + 0x20]
mov eax, 0
cmove rdx, rax
jmp 0x1400698aa
cmp byte [rsp + 0x222], 0x20
jne 0x14006999c
test ebx, ebx
jle 0x140069999
inc rdx
dec ebx
cmp byte [rdx], 0x20
je 0x14006998b
movsxd rsi, ebx
xor r10d, r10d
xor r9d, r9d
test ebx, ebx
jle 0x1400697ad
mov eax, esi
lea r8, [rdx + rsi]
movsx r11d, byte [r9 + r8 - 1]
cmp r11d, 0x20
je 0x1400699c5
test r11d, r11d
jne 0x1400697a9
lea ebx, [rax - 1]
sub ebx, r10d
inc r10
dec r9
cmp r10, rsi
jb 0x1400699b0
jmp 0x1400697a9
cmp qword [rbp], 3
je 0x1400699ef
mov rbx, qword [rsp + 0x430]
jmp 0x14006947c
test byte [r14 + 0x245], 0x20
je 0x140069842
mov rbx, qword [rsp + 0x430]
jmp 0x14006947c
mov ecx, 0xfffffff6
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
lea rbx, [0x1400b2c80]
xor edi, edi
mov qword [r14 + 0x178], rax
mov qword [rsp + 0x430], rbx
jmp 0x140069312
movzx eax, byte [r14 + 0x24d]
test al, 4
je 0x140069a4c
test byte [r14 + 0x244], 1
je 0x140069233
lea rcx, str.FOR_READ
call fcn.14003fb28
mov rbx, rax
mov qword [rsp + 0x430], rbx
test rbx, rbx
jne 0x140069312
mov ecx, 0xfffffff6
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
lea rbx, [0x1400b2c80]
xor edi, edi
mov qword [r14 + 0x178], rax
mov qword [rsp + 0x430], rbx
jmp 0x140069312
test byte [r14 + 0x245], 0x20
jne 0x1400691e2
lea rdx, str.SCRATCH
lea rcx, [rsp + 0x323]
call fcn.14002d710
mov dword [rsp + 0x424], 7
lea rbx, [rsp + 0x323]
mov qword [rsp + 0x430], rbx
mov eax, 7
jmp 0x140069402
test byte [r14 + 0x244], 1
jne 0x1400692ae
jmp 0x140069251
test byte [r14 + 0x244], 1
jne 0x1400692d0
jmp 0x14006924f