Function at 0x100012778
Capabilities:
Check if file exists
Get file attributes
Query environment variable
Query or enumerate registry value

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
push rdi
sub rsp, 0x270
mov rax, qword [0x10001d1d0]
xor rax, rsp
mov qword [rsp + 0x260], rax
mov rsi, rcx
xor ebx, ebx
mov edi, ebx
mov rcx, rbx
mov qword [rsp + 0x38], rbx
mov dword [rsp + 0x34], ebx
cmp rsi, rbx
je 0x100012ac5
mov word [rsi], bx
lea rax, [rsp + 0x38]
mov qword [rsp + 0x20], rax
mov r9d, 0x20019
xor r8d, r8d
lea rdx, str.SoftwareMicrosoftWindows_NTCurrentVersionAeDebug
mov rcx, 0xffffffff80000002
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegOpenKeyExW]
cmp eax, ebx
jne 0x1000129e6
mov dword [rsp + 0x40], 0x208
lea rax, [rsp + 0x40]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x50]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x34]
xor r8d, r8d
lea rdx, str.BpidDebugger
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegQueryValueExW]
cmp eax, ebx
jne 0x1000129e6
mov eax, dword [rsp + 0x34]
sub eax, 1
je 0x100012964
cmp eax, 1
je 0x100012842
mov word [rsi], bx
jmp 0x1000129e6
mov r8d, 0x104
mov rdx, rsi
lea rcx, [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
cmp eax, ebx
je 0x100012915
lea rdx, str.ntsd
lea rcx, [rsp + 0x50]
call sub.msvcrt.dll_wcsstr
cmp rax, rbx
je 0x1000128d6
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov edi, ebx
cmp eax, 0xffffffff
setne dil
mov dword [rsp + 0x30], edi
cmp edi, ebx
jne 0x100012ac0
call sub.KERNEL32.dll_GetLastError
lea rcx, [0x10001d1e0]
mov r10, qword [0x10001d1e0]
cmp r10, rcx
je 0x10001290d
test byte [r10 + 0x1c], 8
je 0x10001290d
cmp byte [r10 + 0x19], 2
jb 0x10001290d
mov edx, 0xb
mov dword [rsp + 0x20], eax
mov r9, rsi
lea r8, [0x100016ca0]
mov rcx, qword [r10 + 0x10]
call fcn.10000a918
jmp 0x10001290d
lea rcx, [0x10001d1e0]
mov rax, qword [0x10001d1e0]
cmp rax, rcx
je 0x10001290d
test byte [rax + 0x1c], 8
je 0x10001290d
cmp byte [rax + 0x19], 2
jb 0x10001290d
mov edx, 0xc
mov r9, rsi
lea r8, [0x100016ca0]
mov rcx, qword [rax + 0x10]
call fcn.100003504
mov word [rsi], bx
jmp 0x1000129e6
call sub.KERNEL32.dll_GetLastError
lea rcx, [0x10001d1e0]
mov r10, qword [0x10001d1e0]
cmp r10, rcx
je 0x1000129e6
test byte [r10 + 0x1c], 8
je 0x1000129e6
cmp byte [r10 + 0x19], 2
jb 0x1000129e6
mov edx, 0xd
mov r9d, eax
lea r8, [0x100016ca0]
mov rcx, qword [r10 + 0x10]
call fcn.100001e70
jmp 0x1000129e6
lea rdx, str.ntsd
lea rcx, [rsp + 0x50]
call sub.msvcrt.dll_wcsstr
cmp rax, rbx
je 0x1000129aa
lea r8, [rsp + 0x50]
mov edx, 0x104
mov rcx, rsi
call fcn.100006764
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov edi, ebx
cmp eax, 0xffffffff
setne dil
mov dword [rsp + 0x30], edi
cmp edi, ebx
jne 0x100012ac0
lea rcx, [0x10001d1e0]
mov rax, qword [0x10001d1e0]
cmp rax, rcx
je 0x1000129e3
test byte [rax + 0x1c], 8
je 0x1000129e3
cmp byte [rax + 0x19], 2
jb 0x1000129e3
mov edx, 0xa
lea r9, [rsp + 0x50]
lea r8, [0x100016ca0]
mov rcx, qword [rax + 0x10]
call fcn.100003504
mov word [rsi], bx
mov r8d, 0x104
mov rdx, rsi
lea rcx, str._SystemRoot_Debuggers_ntsd.exe
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
cmp eax, 0x104
ja 0x100012a19
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov edi, ebx
cmp eax, 0xffffffff
setne dil
mov dword [rsp + 0x30], edi
cmp edi, ebx
jne 0x100012ac0
mov r8d, 0x104
mov rdx, rsi
lea rcx, str._SystemDrive_Debuggers_ntsd.exe
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
cmp eax, 0x104
ja 0x100012a54
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov edi, ebx
cmp eax, 0xffffffff
setne dil
mov dword [rsp + 0x30], edi
cmp edi, ebx
jne 0x100012ac0
lea r8, str.C:Debuggers_ntsd.exe
mov edx, 0x104
mov rcx, rsi
call fcn.100006764
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov edi, ebx
cmp eax, 0xffffffff
setne dil
mov dword [rsp + 0x30], edi
cmp edi, ebx
jne 0x100012ac0
mov r8d, 0x104
mov rdx, rsi
lea rcx, str._SystemRoot_System32_ntsd.exe
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
cmp eax, 0x104
ja 0x100012ac0
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov edi, ebx
cmp eax, 0xffffffff
setne dil
mov dword [rsp + 0x30], edi
mov rcx, qword [rsp + 0x38]
jmp 0x100012ac5
mov rcx, qword [rsp + 0x38]
cmp rcx, rbx
je 0x100012ad0
call qword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegCloseKey]
mov eax, edi
mov rcx, qword [rsp + 0x260]
xor rcx, rsp
call fcn.100001000
lea r11, [rsp + 0x270]
mov rbx, qword [r11 + 0x18]
mov rsi, qword [r11 + 0x20]
mov rsp, r11
pop rdi
ret