Function at 0x105cdfb
Capabilities:
Compare security identifiers

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x20
push ebx
push esi
push edi
lea eax, [ebp - 8]
push eax
push dword [ebp + 0xc]
xor ebx, ebx
mov dword [ebp - 4], ebx
mov dword [ebp - 8], ebx
mov dword [ebp - 0x10], ebx
call sub.ADVAPI32.dll_ConvertStringSidToSidW
mov esi, eax
cmp esi, ebx
je 0x105cfe2
lea eax, [ebp - 0x10]
push eax
push ebx
lea eax, [ebp - 4]
push eax
push ebx
push ebx
push 4
push 4
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_GetSecurityInfo]
cmp eax, ebx
je 0x105ce4c
push eax
xor esi, esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp esi, ebx
je 0x105cfe2
mov edi, dword [sym.imp.ADVAPI32.dll_GetAclInformation]
push 2
push 0xc
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 4]
call edi
mov esi, eax
cmp esi, ebx
je 0x105cfe2
push 1
push 4
lea eax, [ebp - 0xc]
push eax
push dword [ebp - 4]
call edi
mov esi, eax
cmp esi, ebx
je 0x105cfe2
mov dword [ebp + 0xc], ebx
cmp dword [ebp - 0x20], ebx
jbe 0x105cee7
lea eax, [ebp - 0x14]
push eax
push dword [ebp + 0xc]
mov dword [ebp - 0x14], ebx
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_GetAce]
mov esi, eax
cmp esi, ebx
je 0x105cfe2
mov edi, dword [ebp - 0x14]
cmp byte [edi], bl
jne 0x105cedc
mov eax, dword [ebp + 0x10]
cmp dword [edi + 4], eax
jne 0x105cedc
mov al, byte [edi + 1]
and al, byte [ebp + 0x14]
cmp al, byte [ebp + 0x14]
jne 0x105cedc
push dword [ebp - 8]
add edi, 8
push edi
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
jne 0x105cfda
inc dword [ebp + 0xc]
mov eax, dword [ebp + 0xc]
cmp eax, dword [ebp - 0x20]
jb 0x105ce90
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
add eax, 8
mov dword [ebp + 0xc], eax
mov edi, 0x216
cmp eax, 8
jae 0x105cf0c
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [ebp + 0xc]
xor esi, esi
lea ecx, [ebp + 0xc]
push ecx
push eax
push dword [ebp - 0x1c]
call fcn.0105e57f
test eax, eax
jge 0x105cf26
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor esi, esi
xor edi, edi
cmp esi, ebx
je 0x105cf58
push dword [ebp + 0xc]
call sub.msvcrt.dll_void____cdecl_operator_new___unsigned_int_
mov edi, eax
pop ecx
cmp edi, ebx
jne 0x105cf45
push 0xe
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor esi, esi
cmp esi, ebx
je 0x105cf58
push dword [ebp - 0xc]
push dword [ebp + 0xc]
push edi
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
mov esi, eax
mov dword [ebp + 0xc], ebx
cmp dword [ebp - 0x20], ebx
jbe 0x105cf9d
lea eax, [ebp - 0x14]
push eax
push dword [ebp + 0xc]
mov dword [ebp - 0x14], ebx
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_GetAce]
cmp eax, ebx
je 0x105cfe2
mov eax, dword [ebp - 0x14]
movzx ecx, word [eax + 2]
push ecx
push eax
push 0xffffffffffffffff
push dword [ebp - 0xc]
push edi
call dword [sym.imp.ADVAPI32.dll_AddAce]
mov esi, eax
cmp esi, ebx
je 0x105cfe2
inc dword [ebp + 0xc]
mov eax, dword [ebp + 0xc]
cmp eax, dword [ebp - 0x20]
jb 0x105cf60
cmp esi, ebx
je 0x105cfe2
push dword [ebp - 8]
movzx eax, byte [ebp + 0x14]
push dword [ebp + 0x10]
push eax
push dword [ebp - 0xc]
push edi
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAceEx]
mov esi, eax
cmp esi, ebx
je 0x105cfe2
push ebx
push edi
push ebx
push ebx
push 4
push 4
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_SetSecurityInfo]
cmp eax, ebx
je 0x105cfda
push eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor esi, esi
cmp esi, ebx
je 0x105cfe2
xor edi, edi
jmp 0x105cfea
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
push dword [ebp - 4]
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
call esi
push dword [ebp - 0x10]
mov dword [ebp - 4], ebx
call esi
push dword [ebp - 8]
mov dword [ebp - 0x10], ebx
call esi
mov eax, edi
pop edi
pop esi
pop ebx
leave
ret 0x10