Function at 0x140001230
Capabilities:
Check if file exists
Get common file path
Get file attributes
Read file on windows

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
lea rbp, [rsp - 0x220]
sub rsp, 0x320
mov rax, qword [section..data]
xor rax, rsp
mov qword [rbp + 0x210], rax
lea rdx, [rbp + 0x100]
mov ecx, 0x105
call qword [sym.imp.KERNEL32.dll_GetTempPathA]
lea rax, str.red2affinity_addr.txt
mov edx, 0x105
lea r9, [rbp + 0x100]
mov qword [rsp + 0x20], rax
lea r8, str._s_s
lea rcx, [rbp - 0x10]
call fcn.140001010
lea rcx, [rbp - 0x10]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x1400012c5
mov r9d, 0x10
lea r8, str.Red2Affinity
lea rdx, str.Red2Affinity_is_not_running
xor ecx, ecx
call qword [sym.imp.USER32.dll_MessageBoxA]
mov eax, 1
jmp 0x1400016d9
mov qword [rsp + 0x340], r12
lea rcx, [rbp - 0x10]
xor r12d, r12d
xor r9d, r9d
mov qword [rsp + 0x30], r12
xor r8d, r8d
mov dword [rsp + 0x28], 0x80
mov edx, 0x80000000
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileA]
lea r9, [rsp + 0x40]
mov dword [rsp + 0x40], r12d
mov rcx, rax
mov qword [rsp + 0x20], r12
mov r8d, 0x40
lea rdx, [rbp - 0x50]
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x140001352
mov r9d, 0x30
lea r8, str.Red2Affinity
lea rdx, str.Failed_to_read_internal_file._Close_Red2Affinity_from_Task_Manager.
xor ecx, ecx
call qword [sym.imp.USER32.dll_MessageBoxA]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 1
jmp 0x1400016d1
mov qword [rsp + 0x330], rsi
mov rcx, rbx
mov qword [rsp + 0x338], rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xorps xmm0, xmm0
mov qword [rsp + 0x58], r12
movups xmmword [rsp + 0x48], xmm0
mov qword [rsp + 0x60], r12
lea rax, [rbp - 0x50]
mov r8, 0xffffffffffffffff
nop dword [rax + rax]
inc r8
cmp byte [rax + r8], r12b
jne 0x140001390
lea rdx, [rbp - 0x50]
lea rcx, [rsp + 0x48]
call fcn.140001730
cmp qword [rsp + 0x60], 0xf
lea rbx, [rsp + 0x48]
mov rsi, qword [rsp + 0x58]
cmova rbx, qword [rsp + 0x48]
cmp rsi, 1
jb 0x140001404
lea rdi, [rsi + rbx]
mov edx, 0x3b
mov r8, rdi
mov rcx, rbx
sub r8, rbx
call fcn.140011880
test rax, rax
je 0x140001404
nop
cmp byte [rax], 0x3b
je 0x14000156b
inc rax
mov r8, rdi
sub r8, rax
mov rcx, rax
mov edx, 0x3b
call fcn.140011880
test rax, rax
jne 0x1400013e0
mov rax, 0xffffffffffffffff
cmp rsi, rax
mov qword [rsp + 0x78], r12
xorps xmm0, xmm0
mov qword [rbp - 0x80], r12
cmovb rax, rsi
lea rdx, [rsp + 0x48]
cmp qword [rsp + 0x60], 0xf
lea rcx, [rsp + 0x68]
mov r8, rax
cmova rdx, qword [rsp + 0x48]
movups xmmword [rsp + 0x68], xmm0
call fcn.140001730
cmp qword [rsp + 0x60], 0xf
lea rdi, [rsp + 0x48]
mov rsi, qword [rsp + 0x58]
cmova rdi, qword [rsp + 0x48]
cmp rsi, 1
jb 0x1400014a4
lea rbx, [rsi + rdi]
mov edx, 0x3b
mov r8, rbx
mov rcx, rdi
sub r8, rdi
call fcn.140011880
mov rcx, rax
test rax, rax
je 0x1400014a4
nop dword [rax]
cmp byte [rcx], 0x3b
je 0x140001573
inc rcx
mov r8, rbx
sub r8, rcx
mov edx, 0x3b
call fcn.140011880
mov rcx, rax
test rax, rax
jne 0x140001480
mov rcx, 0xffffffffffffffff
mov r8d, dword [rsp + 0x40]
xorps xmm0, xmm0
sub r8, qword [rsp + 0x78]
xorps xmm1, xmm1
dec r8
inc rcx
movups xmmword [rbp - 0x78], xmm0
movdqu xmmword [rbp - 0x68], xmm1
cmp rsi, rcx
jb 0x1400016ff
sub rsi, rcx
lea rdx, [rsp + 0x48]
cmp rsi, r8
cmovb r8, rsi
cmp qword [rsp + 0x60], 0xf
cmova rdx, qword [rsp + 0x48]
add rdx, rcx
lea rcx, [rbp - 0x78]
call fcn.140001730
cmp qword [rbp - 0x60], 0xf
lea rcx, [rbp - 0x78]
mov r8d, 0x10
cmova rcx, qword [rbp - 0x78]
xor edx, edx
call fcn.1400039fc
cmp qword [rbp - 0x80], 0xf
lea rcx, [rsp + 0x68]
mov rsi, rax
cmova rcx, qword [rsp + 0x68]
call fcn.140004e74
mov r8d, eax
xor edx, edx
mov ecx, 0x1020
call qword [sym.imp.KERNEL32.dll_OpenProcess]
mov rdi, rax
mov ebx, 1
test rax, rax
jne 0x14000157b
mov r9d, 0x30
lea r8, str.Red2Affinity
lea rdx, str.Failed_to_open_Red2Affinity_process._Close_Red2Affinity_from_Task_Manager.
xor ecx, ecx
call qword [sym.imp.USER32.dll_MessageBoxA]
jmp 0x1400015ec
sub rax, rbx
jmp 0x14000140b
sub rcx, rdi
jmp 0x1400014ab
mov r9, rbx
mov byte [rsp + 0x44], r12b
lea r8, [rsp + 0x44]
mov qword [rsp + 0x20], r12
mov rdx, rsi
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x1400015c4
mov r9d, 0x30
lea r8, str.Red2Affinity
lea rdx, str.Failed_to_write_to_Red2Affinity_process._Close_Red2Affinity_from_Task_Manager.
xor ecx, ecx
call qword [sym.imp.USER32.dll_MessageBoxA]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1400015ec
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov r9d, 0x40
lea r8, str.Red2Affinity
lea rdx, str.Red2Affinity_will_be_turned_off_now.
xor ecx, ecx
call qword [sym.imp.USER32.dll_MessageBoxA]
mov ebx, r12d
mov rdx, qword [rbp - 0x60]
cmp rdx, 0xf
jbe 0x140001627
mov rcx, qword [rbp - 0x78]
inc rdx
mov rax, rcx
cmp rdx, 0x1000
jb 0x140001622
mov rcx, qword [rcx - 8]
add rdx, 0x27
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x1400016f9
call fcn.140001a4c
mov rdx, qword [rbp - 0x80]
movdqa xmm0, xmmword [0x14001a3f0]
mov byte [rbp - 0x78], r12b
movdqu xmmword [rbp - 0x68], xmm0
cmp rdx, 0xf
jbe 0x140001674
mov rcx, qword [rsp + 0x68]
inc rdx
mov rax, rcx
cmp rdx, 0x1000
jb 0x14000166f
mov rcx, qword [rcx - 8]
add rdx, 0x27
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x1400016f9
call fcn.140001a4c
mov rdx, qword [rsp + 0x60]
mov qword [rsp + 0x78], r12
mov qword [rbp - 0x80], 0xf
mov byte [rsp + 0x68], r12b
cmp rdx, 0xf
jbe 0x1400016bf
mov rcx, qword [rsp + 0x48]
inc rdx
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400016ba
mov rcx, qword [rcx - 8]
add rdx, 0x27
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x1400016f9
call fcn.140001a4c
mov rdi, qword [rsp + 0x338]
mov eax, ebx
mov rsi, qword [rsp + 0x330]
mov r12, qword [rsp + 0x340]
mov rcx, qword [rbp + 0x210]
xor rcx, rsp
call fcn.1400019f0
mov rbx, qword [rsp + 0x348]
add rsp, 0x320
pop rbp
ret
call fcn.1400050d4
int3
call fcn.140001710
int3