Function at 0x105f5d6
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 0x105f7a1
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 0x105f627
push eax
xor esi, esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp esi, ebx
je 0x105f7a1
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 0x105f7a1
push 1
push 4
lea eax, [ebp - 0xc]
push eax
push dword [ebp - 4]
call edi
mov esi, eax
cmp esi, ebx
je 0x105f7a1
cmp dword [ebp - 0x20], ebx
mov dword [ebp + 0xc], ebx
jbe 0x105f6c2
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 0x105f7a1
mov edi, dword [ebp - 0x14]
cmp byte [edi], bl
jne 0x105f6b7
mov eax, dword [ebp + 0x10]
cmp dword [edi + 4], eax
jne 0x105f6b7
mov al, byte [edi + 1]
and al, byte [ebp + 0x14]
cmp al, byte [ebp + 0x14]
jne 0x105f6b7
push dword [ebp - 8]
add edi, 8
push edi
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
jne 0x105f799
inc dword [ebp + 0xc]
mov eax, dword [ebp + 0xc]
cmp eax, dword [ebp - 0x20]
jb 0x105f66b
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov edi, eax
add edi, 8
cmp edi, 8
jae 0x105f6e2
push 0x216
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor esi, esi
mov eax, dword [ebp - 0x1c]
add edi, eax
cmp esi, ebx
mov dword [ebp + 0xc], ebx
je 0x105f719
push edi
call sub.msvcrt.dll_void____cdecl_operator_new___unsigned_int_
cmp eax, ebx
pop ecx
mov dword [ebp + 0xc], eax
jne 0x105f706
push 0xe
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor esi, esi
cmp esi, ebx
je 0x105f719
push dword [ebp - 0xc]
push edi
push dword [ebp + 0xc]
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
mov esi, eax
xor edi, edi
cmp dword [ebp - 0x20], ebx
jbe 0x105f758
lea eax, [ebp - 0x14]
push eax
push edi
push dword [ebp - 4]
mov dword [ebp - 0x14], ebx
call dword [sym.imp.ADVAPI32.dll_GetAce]
cmp eax, ebx
je 0x105f7a1
mov eax, dword [ebp - 0x14]
movzx ecx, word [eax + 2]
push ecx
push eax
push 0xffffffffffffffff
push dword [ebp - 0xc]
push dword [ebp + 0xc]
call dword [sym.imp.ADVAPI32.dll_AddAce]
mov esi, eax
cmp esi, ebx
je 0x105f7a1
inc edi
cmp edi, dword [ebp - 0x20]
jb 0x105f720
cmp esi, ebx
je 0x105f7a1
push dword [ebp - 8]
movzx eax, byte [ebp + 0x14]
push dword [ebp + 0x10]
push eax
push dword [ebp - 0xc]
push dword [ebp + 0xc]
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAceEx]
mov esi, eax
cmp esi, ebx
je 0x105f7a1
push ebx
push dword [ebp + 0xc]
push ebx
push ebx
push 4
push 4
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_SetSecurityInfo]
cmp eax, ebx
je 0x105f799
push eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor esi, esi
cmp esi, ebx
je 0x105f7a1
xor edi, edi
jmp 0x105f7a9
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