Function at 0x40ae25
Capabilities:
Compare security identifiers

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
mov eax, dword [0x41e098]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
lea ecx, [ebp - 0xc]
push ebx
push esi
or dword [ebp - 0xc], 0xffffffff
xor edx, edx
push edi
push ecx
push edx
push edx
push edx
push edx
push edx
push edx
mov dword [ebp - 0x30], eax
mov edi, edx
mov eax, dword [ebp + 0xc]
mov esi, edx
push 4
push eax
mov dword [ebp - 8], edx
mov dword [ebp - 0x14], 1
mov dword [ebp - 0x20], edx
mov dword [ebp - 0x1c], edx
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x10], edx
mov dword [ebp - 0x2c], edx
mov dword [ebp - 0x18], edx
call dword [sym.imp.ADVAPI32.dll_CreateRestrictedToken]
mov ebx, eax
test ebx, ebx
je 0x40b0c1
push 0x2000
push dword [ebp - 0xc]
call fcn.0040bae3
mov ebx, eax
test ebx, ebx
je 0x40b0c1
lea eax, [ebp - 8]
push eax
push esi
push esi
push 1
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor ebx, ebx
cmp eax, 0x7a
sete bl
jne 0x40b0a3
push dword [ebp - 8]
lea ecx, [ebp - 0x24]
call fcn.004093b4
test al, al
jne 0x40aee2
push 8
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov edi, dword [ebp - 0x24]
jmp 0x40b0a3
mov edi, dword [ebp - 0x24]
lea eax, [ebp - 8]
push eax
push dword [ebp - 8]
push edi
push 1
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
mov ebx, eax
test ebx, ebx
je 0x40b0c1
mov eax, dword [edi]
push 4
mov dword [ebp - 0x20], eax
lea eax, [ebp - 0x20]
push eax
push 4
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.dll_SetTokenInformation]
mov ebx, eax
test ebx, ebx
je 0x40b0c1
lea eax, [ebp - 8]
push eax
push 0
push 0
push 6
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor ebx, ebx
cmp eax, 0x7a
sete bl
jne 0x40b0a3
push dword [ebp - 8]
lea ecx, [ebp - 0x28]
call fcn.004093b4
test al, al
jne 0x40af68
push 8
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov esi, dword [ebp - 0x28]
jmp 0x40b0a3
mov esi, dword [ebp - 0x28]
lea eax, [ebp - 8]
push eax
push dword [ebp - 8]
push esi
push 6
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
mov ebx, eax
test ebx, ebx
je 0x40b0c1
lea eax, [ebp - 0x10]
push eax
xor eax, eax
push eax
push eax
push eax
push eax
push eax
push eax
push 0x220
push 0x20
push 2
push section..data
call dword [sym.imp.ADVAPI32.dll_AllocateAndInitializeSid]
mov ebx, eax
test ebx, ebx
je 0x40b0c1
mov eax, dword [esi]
movzx eax, word [eax + 2]
mov dword [ebp - 8], eax
push dword [edi]
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov ecx, dword [ebp - 8]
add ecx, 0xc
add eax, ecx
lea ecx, [ebp - 0x2c]
push eax
mov dword [ebp - 8], eax
call fcn.004093b4
test al, al
jne 0x40afe8
push 8
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x40b0a3
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x1c], eax
mov ecx, dword [esi]
movzx ecx, byte [ecx]
push ecx
push dword [ebp - 8]
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
mov ebx, eax
test ebx, ebx
je 0x40b0b3
mov eax, dword [esi]
push dword [edi]
push 0x10000000
movzx eax, byte [eax]
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
mov ebx, eax
test ebx, ebx
je 0x40b0b3
lea eax, [ebp - 0x18]
xor ebx, ebx
push eax
push ebx
jmp 0x40b065
mov eax, dword [ebp - 0x18]
add eax, 8
push eax
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
jne 0x40b05f
mov ecx, dword [ebp - 0x18]
movzx eax, word [ecx + 2]
push eax
mov eax, dword [esi]
push ecx
push 0
movzx eax, byte [eax]
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.ADVAPI32.dll_AddAce]
lea eax, [ebp - 0x18]
inc ebx
push eax
push ebx
push dword [esi]
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
jne 0x40b031
mov eax, dword [ebp - 8]
add eax, 4
push eax
mov dword [ebp - 8], eax
lea eax, [ebp - 0x1c]
push eax
push 6
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.dll_SetTokenInformation]
mov ebx, eax
test ebx, ebx
je 0x40b0b3
push 4
lea eax, [ebp - 0x14]
push eax
push 0x18
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.dll_SetTokenInformation]
mov ebx, eax
test ebx, ebx
je 0x40b0b3
mov ecx, dword [ebp - 0x30]
mov eax, dword [ebp - 0xc]
or dword [ebp - 0xc], 0xffffffff
mov dword [ecx], eax
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x40b0c1
push eax
call sub.msvcrt.dll_free
pop ecx
cmp dword [ebp - 0x10], 0
je 0x40b0d4
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_FreeSid]
and dword [ebp - 0x10], 0
test esi, esi
je 0x40b0df
push esi
call sub.msvcrt.dll_free
pop ecx
test edi, edi
je 0x40b0ea
push edi
call sub.msvcrt.dll_free
pop ecx
cmp dword [ebp - 0xc], 0xffffffff
je 0x40b0f9
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004130e2
leave
ret 8