Function at 0x14039eb00
Capabilities:
Get common file path
Identify system language via api
Query environment variable

Disassembly:
jmp 0x14039eb00
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
mov eax, 0x41b8
call fcn.140001e38
sub rsp, rax
mov rsi, r9
mov rdi, r8
mov r14, rdx
mov rbx, rcx
mov r13, qword [rsp + 0x4228]
mov rax, qword [0x14056a550]
xor rax, rsp
mov qword [rsp + 0x41b0], rax
mov dword [rsp + 0x74], 0
mov dword [r13], 0
lea r8, [rsp + 0x58]
mov ecx, 0x1001
mov edx, 1
call fcn.140003765
mov ebp, eax
test eax, eax
jne 0x14039f0b3
lea r8, [rsp + 0x60]
mov ecx, 0x1001
mov edx, 1
call fcn.140003765
test eax, eax
je 0x14039eb96
mov ebp, eax
mov rcx, qword [rsp + 0x58]
call fcn.140001b0e
jmp 0x14039f0b3
lea r8, [rsp + 0x68]
mov ecx, 0x1001
mov edx, 1
call fcn.140003765
test eax, eax
je 0x14039ebc9
mov ebp, eax
mov rcx, qword [rsp + 0x58]
call fcn.140001b0e
mov rcx, qword [rsp + 0x60]
call fcn.140001b0e
jmp 0x14039f0b3
mov r9d, dword [rsp + 0x4220]
cmp qword [r14], 3
mov qword [rsp + 0x50], rsi
jne 0x14039ec2c
test byte [rbx + 0x291], 0x20
jne 0x14039ec2c
cmp qword [r14 + 8], 0
je 0x14039ebf8
mov ecx, 0x212
xor edx, edx
call fcn.140004539
mov rcx, qword [rsp + 0x68]
lea rdx, str.SCRATCH
mov r8d, 0x1000
call fcn.1400020b3
mov rax, qword [rsp + 0x68]
mov qword [rsp + 0x78], rax
mov dword [rsp + 0x74], 7
mov r12d, 7
jmp 0x14039ef2e
mov r8d, dword [rbx + 0x1e0]
lea eax, [r8 + 4]
cmp eax, 3
ja case.default.0x14039ec4a
lea rcx, [0x14039f654]
movsxd rax, dword [rcx + rax*4]
add rax, rcx
jmp rax
lea rcx, str.FOR_READ
jmp 0x14039ec76
mov dl, 1
xor eax, eax
xor ecx, ecx
jmp 0x14039ec7a
lea rcx, str.FOR_ACCEPT
jmp 0x14039ec76
lea rcx, str.FOR_TYPE
jmp 0x14039ec76
lea rcx, str.FOR_PRINT
mov al, 1
xor edx, edx
test byte [rbx + 0x299], 4
jne 0x14039ecd0
test dl, dl
jne 0x14039ecd8
mov ebp, r9d
mov rdx, qword [rsp + 0x60]
mov r8d, 0x1001
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov r12d, eax
lea eax, [r12 - 1]
cmp eax, 0xfff
jbe 0x14039ed5d
mov rcx, rbx
call fcn.14039fb50
mov r15, rax
mov qword [rsp + 0x78], rax
mov rcx, rax
call fcn.140003463
mov r12, rax
xor edx, edx
jmp 0x14039ed6c
test byte [rbx + 0x290], al
jne 0x14039ec87
mov rdx, qword [r14 + 8]
test rdx, rdx
je 0x14039ed0c
mov eax, dword [r14 + 0x10]
cmp byte [rdx], 0x20
jne 0x14039ed7e
test eax, eax
jle 0x14039ed7e
cmp byte [rdx + 1], 0x20
lea rdx, [rdx + 1]
lea esi, [rax - 1]
jne 0x14039ed80
cmp eax, 1
mov eax, esi
ja 0x14039ecf6
jmp 0x14039ed80
mov ebp, r9d
mov rcx, qword [rsp + 0x68]
lea rdx, str.FORT_d
call fcn.140005b05
mov r15, qword [rsp + 0x60]
mov rcx, qword [rsp + 0x68]
mov rdx, r15
mov r8d, 0x1001
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov r12d, eax
lea eax, [r12 - 1]
cmp eax, 0x1000
jb 0x14039ed5d
test r15, r15
je 0x14039ed51
mov byte [r15], 0
test r12d, r12d
mov r12d, eax
je 0x14039eff3
mov r15, qword [rsp + 0x60]
mov qword [rsp + 0x78], r15
mov edx, 1
mov dword [rsp + 0x74], r12d
xor esi, esi
cmp byte [r15], 0x20
je 0x14039edf0
jmp 0x14039ee22
mov esi, eax
test esi, esi
jle 0x14039eda9
mov eax, esi
inc rax
lea ecx, [rsi - 1]
movzx r8d, byte [rdx + rcx]
test r8b, 0xdf
jne 0x14039eda9
dec rax
mov esi, ecx
cmp rax, 1
jg 0x14039ed89
mov ebp, r9d
xor esi, esi
jmp 0x14039edac
mov ebp, r9d
cmp esi, 0x1000
mov r12d, 0x1000
cmovl r12d, esi
mov dword [rsp + 0x74], r12d
mov rcx, qword [rsp + 0x68]
movsxd r15, r12d
mov r8, r15
call fcn.14000419c
mov rax, qword [rsp + 0x68]
mov byte [rax + r15], 0
mov r15, qword [rsp + 0x68]
mov qword [rsp + 0x78], r15
mov edx, 1
cmp byte [r15], 0x20
jne 0x14039ee22
test r12d, r12d
jle 0x14039ee22
inc r15
nop dword [rax + rax]
mov qword [rsp + 0x78], r15
lea eax, [r12 - 1]
cmp byte [r15], 0x20
lea r15, [r15 + 1]
jne 0x14039ee1d
cmp r12d, 1
mov r12d, eax
ja 0x14039ee00
dec r15
jmp 0x14039ee25
mov eax, r12d
mov dword [rsp + 0x74], eax
test eax, eax
mov r12d, ebp
jle 0x14039ee5b
lea ecx, [rax - 1]
add r15, rcx
nop word cs:[rax + rax]
movzx ecx, byte [r15]
test cl, 0xdf
jne 0x14039eea7
dec eax
mov dword [rsp + 0x74], eax
mov ecx, eax
inc ecx
dec r15
cmp ecx, 1
ja 0x14039ee40
test eax, eax
jne 0x14039eea7
test byte [rbx + 0x299], 4
je 0x14039eea7
mov ebp, edx
lea rdx, [rsp + 0x78]
lea r8, [rsp + 0x74]
mov rcx, rbx
call fcn.14039fbc0
mov edx, ebp
test eax, eax
je 0x14039eea7
mov ebp, eax
mov rcx, qword [rsp + 0x60]
call fcn.140001b0e
mov rcx, qword [rsp + 0x58]
call fcn.140001b0e
mov rcx, qword [rsp + 0x68]
call fcn.140001b0e
jmp 0x14039f0b3
test r12d, r12d
je 0x14039eeb6
cmp esi, 0x1001
jge 0x14039eef4
jmp 0x14039ef1c
mov ebp, edx
mov rcx, qword [rsp + 0x78]
lea rdx, [0x14052dca0]
mov r8d, 4
call fcn.140005222
test eax, eax
je 0x14039eed9
mov eax, dword [r13]
jmp 0x14039eee6
mov dword [r13], 1
mov eax, 1
mov edx, ebp
test eax, eax
je 0x14039ef1c
cmp esi, 0x1000
jle 0x14039ef1c
mov rcx, qword [rsp + 0x60]
call fcn.140001b0e
mov rcx, qword [rsp + 0x58]
call fcn.140001b0e
mov rcx, qword [rsp + 0x68]
call fcn.140001b0e
mov ebp, 0x311
jmp 0x14039f0b3
test edx, edx
je 0x14039f025
mov rax, qword [rsp + 0x78]
mov r12d, dword [rsp + 0x74]
movsxd rcx, r12d
mov byte [rax + rcx], 0
mov rdx, qword [rsp + 0x78]
mov rcx, rbx
call fcn.140001eba
cmp eax, 0xffffffff
je 0x14039ef82
mov ecx, 0xfffffff5
cmp eax, 1
je 0x14039f018
cmp eax, 0xfffffffa
jne 0x14039ef67
cmp dword [0x1407108a8], 0
je 0x14039f018
test eax, eax
je 0x14039f013
cmp eax, 2
jne 0x14039f0d9
mov ecx, 0xfffffff4
jmp 0x14039f018
xor r15d, r15d
mov esi, 1
mov bpl, 1
cmp dword [r13], 0
jne 0x14039f02c
mov dword [rsp + 0x4c], r12d
test byte [rbx + 0x299], 8
mov r15, qword [r14 + 0x18]
jne 0x14039efb4
test r15, r15
jne 0x14039efbd
jmp 0x14039f185
test r15, r15
je 0x14039f162
mov eax, dword [r14 + 0x20]
cmp byte [r15], 0x20
jne 0x14039f0eb
test eax, eax
jle 0x14039f0eb
cmp byte [r15 + 1], 0x20
lea r15, [r15 + 1]
lea r12d, [rax - 1]
jne 0x14039f0ee
cmp eax, 1
mov eax, r12d
ja 0x14039efd3
jmp 0x14039f0ee
mov rcx, rbx
call fcn.14039fb50
mov qword [rsp + 0x78], rax
test rax, rax
je 0x14039f204
mov r15, rax
xor esi, esi
jmp 0x14039f577
mov ecx, 0xfffffff6
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
mov qword [rbx + 0x1a0], rax
xor ebp, ebp
xor esi, esi
xor r15d, r15d
xor r12d, r12d
mov rdx, qword [rsp + 0x78]
mov rcx, rdi
call fcn.140002ae5
cmp dword [0x1407108a8], 0
je 0x14039f05a
test bpl, bpl
jne 0x14039f05a
cmp qword [rbx + 0x1a0], 0xffffffffffffffff
setne al
or al, r15b
je 0x14039f061
test bpl, bpl
je 0x14039f06f
jmp 0x14039f079
mov qword [rbx + 0x1a0], 0
xor r12d, r12d
cmp qword [rbx + 0x1a0], 0xffffffffffffffff
je 0x14039f087
mov eax, 1
test r12d, r12d
jne 0x14039f08c
mov eax, esi
jmp 0x14039f08c
mov eax, 1
mov rcx, qword [rsp + 0x50]
mov dword [rcx], eax
mov rcx, qword [rsp + 0x60]
call fcn.140001b0e
mov rcx, qword [rsp + 0x58]
call fcn.140001b0e
mov rcx, qword [rsp + 0x68]
call fcn.140001b0e
xor ebp, ebp
mov rcx, qword [rsp + 0x41b0]
xor rcx, rsp
call fcn.140003706
mov eax, ebp
add rsp, 0x41b8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov r12d, 1
mov r15b, 1
xor ebp, ebp
xor esi, esi
jmp 0x14039f02f
mov r12d, eax
test r12d, r12d
jle 0x14039f117
mov eax, r12d
inc rax
lea ecx, [r12 - 1]
movzx edx, byte [r15 + rcx]
test dl, 0xdf
jne 0x14039f117
dec rax
mov r12d, ecx
cmp rax, 1
jg 0x14039f0f9
xor r12d, r12d
cmp dword [rsp + 0x4220], 0
je 0x14039f133
cmp r12d, 0x1000
jge 0x14039eef4
jmp 0x14039f250
lea rdx, [0x14052dca0]
mov r8d, 4
mov rcx, r15
call fcn.140005222
test eax, eax
je 0x14039f23b
cmp r12d, 0x104
jl 0x14039f250
jmp 0x14039f537
xor r15d, r15d
cmp qword [r14], 3
jne 0x14039f02c
xor r15d, r15d
test byte [rbx + 0x291], 0x20
mov r12d, 0
jne 0x14039f02f
call qword [sym.imp.KERNEL32.dll_GetUserDefaultLangID]
movzx eax, ax
cmp eax, 0x411
je 0x14039f1a9
call qword [sym.imp.KERNEL32.dll_GetSystemDefaultLangID]
movzx eax, ax
cmp eax, 0x411
jne 0x14039f396
mov r8, qword [rsp + 0x78]
lea r15, [rsp + 0x21a0]
mov qword [rsp + 0x20], r15
mov dword [rsp + 0x28], 0x1001
xor ecx, ecx
mov edx, 1
mov r9d, 0xffffffff
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea r8, [rsp + 0x190]
mov rcx, r15
mov edx, 0x1001
xor r9d, r9d
call qword [sym.imp.KERNEL32.dll_GetFullPathNameW]
cmp eax, 0x2002
jb 0x14039f2d2
mov ebp, 0x311
jmp 0x14039f0b3
test byte [rbx + 0x299], 4
jne 0x14039f37f
test byte [rbx + 0x291], 0x20
jne 0x14039f55f
mov r8d, dword [rbx + 0x1e0]
mov rcx, qword [rsp + 0x68]
lea rdx, str.fort._d
call fcn.140005b05
jmp 0x14039f387
mov dword [r13], 1
cmp r12d, 0x1000
jge 0x14039eef4
mov rcx, qword [rsp + 0x58]
movsxd rbp, r12d
mov rdx, r15
mov r8, rbp
call fcn.14000419c
mov rax, qword [rsp + 0x58]
mov byte [rax + rbp], 0
mov r15, qword [rsp + 0x58]
test r15, r15
je 0x14039f3ed
cmp byte [r15], 0x20
jne 0x14039f2a0
test r12d, r12d
jle 0x14039f2a0
cmp byte [r15 + 1], 0x20
lea r15, [r15 + 1]
lea eax, [r12 - 1]
jne 0x14039f2a3
cmp r12d, 1
mov r12d, eax
ja 0x14039f285
jmp 0x14039f2a3
mov eax, r12d
test eax, eax
jle 0x14039f2ca
mov ecx, eax
inc rcx
lea edx, [rax - 1]
movzx r8d, byte [r15 + rdx]
test r8b, 0xdf
jne 0x14039f2ca
dec rcx
mov eax, edx
cmp rcx, 1
jg 0x14039f2ac
jmp 0x14039f3e8
mov r12d, eax
jmp 0x14039f3f0
mov r15d, eax
lea esi, [r15 - 1]
cmp esi, 0xfff
ja 0x14039f3e5
mov rax, qword [rsp + 0x58]
xorps xmm0, xmm0
movups xmmword [rsp + 0x30], xmm0
mov qword [rsp + 0x20], rax
mov dword [rsp + 0x28], 0x1000
lea r8, [rsp + 0x190]
xor ecx, ecx
xor edx, edx
mov r9d, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov eax, dword [rsp + 0x4c]
not eax
add eax, r15d
test eax, eax
jle 0x14039f3e5
mov rax, qword [rsp + 0x58]
sub esi, dword [rsp + 0x4c]
cmp esi, 2
jb 0x14039f35b
mov rcx, rsi
shr rcx, 1
xor edx, edx
cmp byte [rax + rdx*2], 0
js 0x14039f3e5
cmp byte [rax + rdx*2 + 1], 0
js 0x14039f3e5
inc rdx
cmp rcx, rdx
jne 0x14039f33e
mov ecx, esi
and ecx, 0xfffffffe
cmp rcx, rsi
jae 0x14039f36b
cmp byte [rax + rcx], 0
js 0x14039f3e5
mov qword [rsp + 0x78], rax
mov dword [rsp + 0x74], r15d
mov eax, r15d
mov dword [rsp + 0x4c], r15d
jmp 0x14039f3e5
mov rax, qword [rsp + 0x68]
mov byte [rax], 0
mov r15, qword [rsp + 0x68]
mov qword [rsp + 0x78], r15
jmp 0x14039f572
mov r8, qword [rsp + 0x58]
mov rcx, qword [rsp + 0x78]
xor r12d, r12d
mov edx, 0x1001
xor r9d, r9d
call qword [sym.imp.KERNEL32.dll_GetFullPathNameA]
mov ebp, 0x311
cmp eax, 0x1000
ja 0x14039f0b3
mov esi, eax
test eax, eax
je 0x14039f3ed
mov r8d, esi
mov r15, qword [rsp + 0x58]
mov rcx, r15
mov edx, 0x3f
call fcn.1400045ed
test rax, rax
je 0x14039f59d
xor r15d, r15d
xor r12d, r12d
jmp 0x14039f3f0
xor r15d, r15d
cmp qword [r14], 3
jne 0x14039f47c
test byte [rbx + 0x291], 0x20
jne 0x14039f47c
lea rcx, str.FORT_TMPDIR
lea rdx, [rsp + 0x80]
mov r8d, 0x105
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
lea edx, [rax - 1]
mov ecx, 1
cmp edx, 0x104
jb 0x14039f438
mov ecx, eax
mov byte [rsp + 0x80], 0
cmp qword [r14 + 0x18], 0
jne 0x14039f5d1
test byte [rbx + 0x299], 8
jne 0x14039f589
test rcx, rcx
je 0x14039f5b2
lea r15, [rsp + 0x190]
lea rdx, [rsp + 0x80]
mov r8d, 0x104
mov rcx, r15
call fcn.1400020b3
jmp 0x14039f5d1
test r15, r15
je 0x14039f495
cmp dword [r13], 0
je 0x14039f499
movsxd rax, r12d
cmp byte [r15 + rax], 0x5c
sete al
jmp 0x14039f4ae
mov al, 1
jmp 0x14039f4b0
movsxd rax, r12d
movzx eax, byte [rax + r15 - 1]
cmp al, 0x2f
sete cl
cmp al, 0x5c
sete al
or al, cl
xor al, 1
test r12d, r12d
setg cl
and cl, al
movzx esi, cl
cmp dword [rsp + 0x4220], 0
jne 0x14039f4cc
cmp dword [r13], 0
je 0x14039f528
lea eax, [r12 + rsi]
add eax, dword [rsp + 0x4c]
cmp eax, 0x1001
jge 0x14039eef4
movsxd rbx, r12d
mov rcx, rdi
mov rdx, r15
mov r8, rbx
call fcn.14000419c
test esi, esi
je 0x14039f4f8
mov byte [rdi + rbx], 0x5c
add rbx, rdi
mov ecx, esi
add rcx, rbx
mov rdx, qword [rsp + 0x78]
mov ebx, dword [rsp + 0x4c]
movsxd r8, ebx
call fcn.14000419c
add r12d, esi
add r12d, ebx
movsxd rax, r12d
mov byte [rdi + rax], 0
mov esi, 1
jmp 0x14039f083
lea eax, [r12 + rsi]
add eax, dword [rsp + 0x4c]
cmp eax, 0x105
jl 0x14039f4df
mov rcx, qword [rsp + 0x60]
call fcn.140001b0e
mov rcx, qword [rsp + 0x58]
call fcn.140001b0e
mov rcx, qword [rsp + 0x68]
call fcn.140001b0e
mov ebp, 0x302
jmp 0x14039f0b3
mov r15, qword [rbx + 0xd0]
mov qword [rsp + 0x78], r15
mov qword [r14], 0
mov esi, 1
mov rcx, r15
call fcn.140003463
mov r12, rax
mov edx, esi
jmp 0x14039ed6c
lea r15, [rsp + 0x190]
mov word [rsp + 0x190], 0x2e
jmp 0x14039f5d1
mov qword [rsp + 0x78], r15
mov dword [rsp + 0x74], esi
xor r15d, r15d
mov dword [rsp + 0x4c], esi
jmp 0x14039f3e8
lea r14, [rsp + 0x190]
mov ecx, 0x104
mov rdx, r14
call qword [sym.imp.KERNEL32.dll_GetTempPathA]
xor r15d, r15d
test eax, eax
cmovne r15, r14
lea r14, [rsp + 0x21a0]
mov r8d, 0x105
mov rcx, r14
xor edx, edx
call fcn.1400020b8
lea rdx, [0x14052ddcb]
mov rcx, r15
xor r8d, r8d
mov r9, r14
call qword [sym.imp.KERNEL32.dll_GetTempFileNameA]
test eax, eax
je 0x14039f62b
test dword [rbx + 0x298], 0x800
lea rdx, [rsp + 0x21a2]
cmove rdx, r14
mov rcx, rdi
call fcn.140002ae5
mov esi, 1
jmp 0x14039f083
mov rcx, qword [rsp + 0x60]
call fcn.140001b0e
mov rcx, qword [rsp + 0x58]
call fcn.140001b0e
mov rcx, qword [rsp + 0x68]
call fcn.140001b0e
mov ebp, 0x2b
jmp 0x14039f0b3