Function at 0x100166220
Capabilities:
Compare security identifiers

Disassembly:
mov r11, rsp
mov qword [r11 + 0x10], rbx
mov qword [r11 + 0x18], rsi
push rdi
push r14
push r15
sub rsp, 0xa0
mov rax, qword [0x10022f440]
xor rax, rsp
mov qword [rsp + 0x98], rax
mov rsi, rcx
xor r15d, r15d
mov qword [r11 - 0x50], r15
mov dword [r11 - 0x58], r15d
mov r14d, r15d
mov qword [r11 - 0x30], r15
mov qword [r11 - 0x48], r15
mov edi, r15d
mov qword [r11 - 0x38], r15
mov dword [r11 - 0x28], edi
mov word [r11 - 0x24], 0x500
test rcx, rcx
jne 0x100166281
lea eax, [rcx + 0x57]
jmp 0x1001664f1
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov rcx, rax
lea r9, [rsp + 0x68]
mov edx, 8
lea r8d, [rdx - 7]
call qword [sym.imp.ADVAPI32.dll_OpenThreadToken]
test eax, eax
jne 0x1001662df
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
cmp eax, 0x3f0
jne 0x1001664b3
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rcx, rax
lea r8, [rsp + 0x68]
mov edx, 8
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x1001662df
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
jmp 0x1001664b3
mov dword [rsp + 0x60], r15d
lea rax, [rsp + 0x60]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
lea edx, [r9 + 1]
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
jne 0x100166318
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
cmp eax, 0x7a
jne 0x1001664b3
mov ebx, dword [rsp + 0x60]
mov ecx, ebx
call qword [sym.imp.MSVCR100.dll_malloc]
mov r14, rax
mov qword [rsp + 0x88], rax
test rax, rax
jne 0x10016633c
lea ebx, [rax + 0xe]
jmp 0x1001664b3
lea rax, [rsp + 0x60]
mov qword [rsp + 0x20], rax
mov r9d, ebx
mov r8, r14
mov edx, 1
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
jne 0x10016636d
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
jmp 0x1001664b3
mov rdx, qword [r14]
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
je 0x100166385
mov ebx, r15d
jmp 0x1001664b3
lea rax, [rsp + 0x70]
mov qword [rsp + 0x50], rax
mov dword [rsp + 0x48], r15d
mov dword [rsp + 0x40], r15d
mov dword [rsp + 0x38], r15d
mov dword [rsp + 0x30], r15d
mov dword [rsp + 0x28], r15d
mov dword [rsp + 0x20], r15d
mov r9d, 0x220
mov r8d, 0x20
mov dl, 2
lea rcx, [rsp + 0x90]
call qword [sym.imp.ADVAPI32.dll_AllocateAndInitializeSid]
test eax, eax
jne 0x1001663da
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
jmp 0x1001664b3
mov rdx, qword [rsp + 0x70]
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
je 0x1001664b0
mov dword [rsp + 0x60], r15d
lea rax, [rsp + 0x60]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
lea edx, [r9 + 2]
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
jne 0x100166429
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
cmp eax, 0x7a
jne 0x1001664b3
mov ebx, dword [rsp + 0x60]
mov ecx, ebx
call qword [sym.imp.MSVCR100.dll_malloc]
mov rdi, rax
mov qword [rsp + 0x80], rax
test rax, rax
jne 0x10016644a
lea ebx, [rax + 0xe]
jmp 0x1001664b3
lea rax, [rsp + 0x60]
mov qword [rsp + 0x20], rax
mov r9d, ebx
mov r8, rdi
mov edx, 2
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
jne 0x100166478
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
jmp 0x1001664b3
mov ebx, r15d
mov dword [rsp + 0x78], ebx
cmp ebx, dword [rdi]
jae 0x1001664b0
mov esi, ebx
add rsi, rsi
mov rdx, qword [rdi + rsi*8 + 8]
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
je 0x1001664ac
test byte [rdi + rsi*8 + 0x10], 4
mov ebx, 0xffffffff
cmovne ebx, r15d
jmp 0x1001664b3
inc ebx
jmp 0x10016647b
or ebx, 0xffffffff
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x1001664c3
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test r14, r14
je 0x1001664d1
mov rcx, r14
call qword [sym.imp.MSVCR100.dll_free]
mov rcx, qword [rsp + 0x70]
test rcx, rcx
je 0x1001664e1
call qword [sym.imp.ADVAPI32.dll_FreeSid]
test rdi, rdi
je 0x1001664ef
mov rcx, rdi
call qword [sym.imp.MSVCR100.dll_free]
mov eax, ebx
mov rcx, qword [rsp + 0x98]
xor rcx, rsp
call fcn.10005f420
lea r11, [rsp + 0xa0]
mov rbx, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x30]
mov rsp, r11
pop r15
pop r14
pop rdi
ret