Function at 0x12850950
Capabilities:
Compare security identifiers
Get token membership

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
sub rsp, 0x70
mov qword [rsp + 0x30], 0xfffffffffffffffe
mov r12, rcx
xor r14d, r14d
mov dword [rsp + 0xb8], r14d
mov r13, r14
lea ecx, [r14 + 8]
call fcn.12958d80
mov qword [rsp + 0xc0], rax
mov qword [rsp + 0xc8], rax
test rax, rax
je 0x128509a1
lea rcx, [rsp + 0x38]
mov qword [rax], rcx
jmp 0x128509a4
mov rax, r14
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x50], r14
mov qword [rsp + 0x58], r14
mov qword [rsp + 0x60], r14
mov rbp, qword [0x129ada20]
xor r9d, r9d
lea r8, [rsp + 0x38]
lea edx, [r9 + 0xb]
mov rcx, r12
call fcn.1281ccd0
test eax, eax
jne 0x12850b16
xor edx, edx
lea rcx, [rsp + 0x38]
call fcn.1280ac30
mov ecx, r14d
mov esi, r14d
test rbp, rbp
je 0x12850a35
test rax, rax
je 0x12850a35
mov ecx, dword [rax]
test ecx, ecx
je 0x12850a30
lea rbx, [rax + 8]
mov rdi, rcx
shl rdi, 4
add rdi, rbx
cmp rbx, rdi
je 0x12850a30
mov rdx, qword [rbx]
mov rcx, rbp
call qword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
jne 0x12850a2b
add rbx, 0x10
cmp rbx, rdi
jne 0x12850a10
jmp 0x12850a30
mov esi, 1
mov ecx, 1
mov dword [rsp + 0xb8], esi
test ecx, ecx
je 0x12850b16
test esi, esi
je 0x12850a77
mov rcx, qword [rsp + 0x50]
test rcx, rcx
je 0x12850a57
call fcn.12958250
mov qword [rsp + 0x50], r14
mov qword [rsp + 0x58], r14
mov qword [rsp + 0x60], r14
mov rcx, qword [rsp + 0x38]
call fcn.12958250
xor eax, eax
jmp 0x12850cda
mov rbp, qword [0x129ada28]
xor edx, edx
lea rcx, [rsp + 0x38]
call fcn.1280ac30
mov ecx, r14d
mov esi, r14d
test rbp, rbp
je 0x12850ad8
test rax, rax
je 0x12850ad8
mov ecx, dword [rax]
test ecx, ecx
je 0x12850ad3
lea rbx, [rax + 8]
mov rdi, rcx
shl rdi, 4
add rdi, rbx
cmp rbx, rdi
je 0x12850ad3
mov rdx, qword [rbx]
mov rcx, rbp
call qword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
jne 0x12850ace
add rbx, 0x10
cmp rbx, rdi
jne 0x12850ab3
jmp 0x12850ad3
mov esi, 1
mov ecx, 1
mov dword [rsp + 0xb8], esi
test ecx, ecx
je 0x12850b16
test esi, esi
je 0x12850b16
mov rcx, qword [rsp + 0x50]
test rcx, rcx
je 0x12850af6
call fcn.12958250
mov qword [rsp + 0x50], r14
mov qword [rsp + 0x58], r14
mov qword [rsp + 0x60], r14
mov rcx, qword [rsp + 0x38]
call fcn.12958250
xor eax, eax
jmp 0x12850cda
mov rcx, qword [rsp + 0x50]
test rcx, rcx
je 0x12850b25
call fcn.12958250
mov qword [rsp + 0x50], r14
mov qword [rsp + 0x58], r14
mov qword [rsp + 0x60], r14
mov rcx, qword [rsp + 0x38]
call fcn.12958250
mov rbx, qword [0x129ada20]
lea r8, [rsp + 0xb8]
mov rdx, rbx
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_CheckTokenMembership]
test eax, eax
jne 0x12850bf6
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x51d
jne 0x12850cc3
test r12, r12
je 0x12850cc3
mov qword [rsp + 0xc0], r14
lea rax, [rsp + 0xc0]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 2
mov r9d, 2
xor r8d, r8d
mov edx, 0x2000000
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
jne 0x12850bbe
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x12850cc3
lea r8, [rsp + 0xb8]
mov rdx, rbx
mov rcx, qword [rsp + 0xc0]
call qword [sym.imp.ADVAPI32.dll_CheckTokenMembership]
test eax, eax
jne 0x12850bee
mov rcx, qword [rsp + 0xc0]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x12850cc3
mov r13, qword [rsp + 0xc0]
cmp dword [rsp + 0xb8], 0
jne 0x12850cc3
mov rbx, qword [0x129ada28]
test r13, r13
cmovne r12, r13
lea r8, [rsp + 0xb8]
mov rdx, rbx
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_CheckTokenMembership]
test eax, eax
jne 0x12850cc3
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x51d
jne 0x12850cc3
test r12, r12
je 0x12850cc3
mov qword [rsp + 0xc0], r14
lea rax, [rsp + 0xc0]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 2
mov r9d, 2
xor r8d, r8d
mov edx, 0x2000000
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
jne 0x12850c88
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x12850cc3
lea r8, [rsp + 0xb8]
mov rdx, rbx
mov rcx, qword [rsp + 0xc0]
call qword [sym.imp.ADVAPI32.dll_CheckTokenMembership]
test eax, eax
jne 0x12850cb5
mov rcx, qword [rsp + 0xc0]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x12850cc3
mov rcx, qword [rsp + 0xc0]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [rsp + 0xb8]
test r13, r13
je 0x12850cd8
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, ebx
add rsp, 0x70
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret