Function at 0x5824c4
Capabilities:
Compare security identifiers
Get user security identifier

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffb98
push ebx
push esi
push edi
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__System__UStrAddRef_qqrpv
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrAddRef_qqrpv
xor eax, eax
push ebp
push 0x58293d
push dword fs:[eax]
mov dword fs:[eax], esp
xor ebx, ebx
xor eax, eax
mov dword [ebp - 0x18], eax
xor eax, eax
mov dword [ebp - 0x34], eax
xor eax, eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x40], 4
xor edx, edx
push ebp
push 0x582914
push dword fs:[edx]
mov dword fs:[edx], esp
xor eax, eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x14], 0x400
lea eax, [ebp - 0x448]
xor ecx, ecx
mov edx, dword [ebp - 0x14]
call sub.rtl120.bpl__System__FillChar_qqrpvib
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x448]
push eax
lea eax, [ebp - 0x1c]
push eax
push 0
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov esi, eax
push esi
push 0
call sub.advapi32.dll_LookupAccountNameW
test eax, eax
je 0x58256e
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x582922
call sub.kernel32.dll_GetLastError
cmp eax, 0x7a
je 0x58257d
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
mov eax, dword [ebp - 0x1c]
call sub.rtl120.bpl__System_AllocMem_qqrui
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jne 0x582593
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x448]
push eax
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0x18]
push eax
push esi
push 0
call sub.advapi32.dll_LookupAccountNameW
test eax, eax
jne 0x5825bb
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
xor eax, eax
mov dword [ebp - 0x20], eax
lea eax, [ebp - 0x24]
push eax
push 0
mov eax, dword [ebp - 0x20]
push eax
mov eax, dword [ebp - 0x40]
push eax
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov esi, eax
push esi
call sub.advapi32.dll_GetFileSecurityW
test eax, eax
je 0x5825ec
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x582922
call sub.kernel32.dll_GetLastError
cmp eax, 0x7a
je 0x5825fb
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
mov eax, dword [ebp - 0x24]
call sub.rtl120.bpl__System_AllocMem_qqrui
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
jne 0x582611
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
lea eax, [ebp - 0x24]
push eax
mov eax, dword [ebp - 0x24]
push eax
mov eax, dword [ebp - 0x20]
push eax
mov eax, dword [ebp - 0x40]
push eax
push esi
call sub.advapi32.dll_GetFileSecurityW
test eax, eax
jne 0x582630
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x2c]
push eax
mov eax, dword [ebp - 0x20]
push eax
call sub.advapi32.dll_GetSecurityDescriptorDacl
test eax, eax
jne 0x58264e
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
xor eax, eax
mov dword [ebp - 0x468], eax
xor eax, eax
mov dword [ebp - 0x460], eax
mov dword [ebp - 0x464], 8
cmp dword [ebp - 0x28], 0
jne 0x582673
xor eax, eax
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0
je 0x582696
push 2
push 0xc
lea eax, [ebp - 0x468]
push eax
mov eax, dword [ebp - 0x28]
push eax
call sub.advapi32.dll_GetAclInformation
test eax, eax
jne 0x582696
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
cmp byte [ebp + 8], 0
je 0x5826f4
cmp dword [ebp - 0x2c], 0
je 0x5826f4
cmp dword [ebp - 0x468], 0
je 0x5826f4
mov ebx, dword [ebp - 0x468]
dec ebx
test ebx, ebx
jb 0x5826f4
inc ebx
xor esi, esi
lea eax, [ebp - 0x38]
push eax
push esi
mov eax, dword [ebp - 0x28]
push eax
call sub.advapi32.dll_GetAce
test eax, eax
jne 0x5826d0
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
mov eax, dword [ebp - 0x38]
add eax, 8
push eax
mov eax, dword [ebp - 0x18]
push eax
call sub.advapi32.dll_EqualSid
test eax, eax
je 0x5826f0
mov bl, 1
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x582922
inc esi
dec ebx
jne 0x5826b9
push 1
lea eax, [ebp - 0x45c]
push eax
call sub.advapi32.dll_InitializeSecurityDescriptor
test eax, eax
jne 0x58270b
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
mov eax, dword [ebp - 0x18]
push eax
call sub.advapi32.dll_GetLengthSid
mov ebx, eax
add ebx, ebx
mov eax, dword [ebp - 0x464]
add eax, 0x18
add ebx, eax
sub ebx, 8
add ebx, ebx
mov eax, ebx
call sub.rtl120.bpl__System_AllocMem_qqrui
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0
jne 0x58273d
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
push 2
push ebx
mov eax, dword [ebp - 0x34]
push eax
call sub.advapi32.dll_InitializeAcl
test eax, eax
jne 0x582752
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
cmp dword [ebp - 0x2c], 0
je 0x5827c6
cmp dword [ebp - 0x468], 0
je 0x5827c6
mov ebx, dword [ebp - 0x468]
dec ebx
test ebx, ebx
jb 0x5827c6
inc ebx
xor esi, esi
lea eax, [ebp - 0x38]
push eax
push esi
mov eax, dword [ebp - 0x28]
push eax
call sub.advapi32.dll_GetAce
test eax, eax
jne 0x582786
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
mov edi, dword [ebp - 0x38]
test byte [edi + 1], 0x10
jne 0x5827c6
lea eax, [edi + 8]
push eax
mov eax, dword [ebp - 0x18]
push eax
call sub.advapi32.dll_EqualSid
test eax, eax
jne 0x5827c2
mov eax, dword [ebp - 0x38]
movzx eax, word [eax + 2]
push eax
mov eax, dword [ebp - 0x38]
push eax
push 0xffffffffffffffff
push 2
mov eax, dword [ebp - 0x34]
push eax
call sub.advapi32.dll_AddAce
test eax, eax
jne 0x5827c2
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
inc esi
dec ebx
jne 0x58276f
mov eax, dword [ebp - 0x18]
push eax
mov eax, dword [ebp - 0xc]
push eax
push 2
mov eax, dword [ebp - 0x34]
push eax
call sub.advapi32.dll_AddAccessAllowedAce
test eax, eax
jne 0x5827e2
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
cmp dword [ebp - 0x2c], 0
je 0x58283c
cmp dword [ebp - 0x468], 0
je 0x58283c
mov ebx, dword [ebp - 0x468]
dec ebx
test ebx, ebx
jb 0x58283c
inc ebx
xor esi, esi
lea eax, [ebp - 0x38]
push eax
push esi
mov eax, dword [ebp - 0x28]
push eax
call sub.advapi32.dll_GetAce
test eax, eax
jne 0x582816
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
mov eax, dword [ebp - 0x38]
movzx eax, word [eax + 2]
push eax
mov eax, dword [ebp - 0x38]
push eax
push 0xffffffffffffffff
push 2
mov eax, dword [ebp - 0x34]
push eax
call sub.advapi32.dll_AddAce
test eax, eax
jne 0x582838
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
inc esi
dec ebx
jne 0x5827ff
push 0
mov eax, dword [ebp - 0x34]
push eax
push 0xffffffffffffffff
lea eax, [ebp - 0x45c]
push eax
call sub.advapi32.dll_SetSecurityDescriptorDacl
test eax, eax
jne 0x582859
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
lea eax, [ebp - 0x48]
push eax
lea eax, [ebp - 0x42]
push eax
mov eax, dword [ebp - 0x20]
push eax
call sub.advapi32.dll_GetSecurityDescriptorControl
test eax, eax
jne 0x582873
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
xor ebx, ebx
xor esi, esi
mov word [ebp - 0x42], 0
test byte [ebp - 0x41], 4
je 0x58288b
mov bx, 0x500
mov esi, ebx
jmp 0x582897
test byte [ebp - 0x41], 0x10
je 0x582897
mov bx, 0x1000
mov esi, ebx
test bx, bx
je 0x5828b3
push esi
push ebx
lea eax, [ebp - 0x45c]
push eax
call sub.advapi32.dll_SetSecurityDescriptorControl
test eax, eax
jne 0x5828b3
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
lea eax, [ebp - 0x45c]
push eax
mov eax, dword [ebp - 0x40]
push eax
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
call sub.advapi32.dll_SetFileSecurityW
test eax, eax
jne 0x5828d5
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
mov dword [ebp - 0x3c], 0xffffffff
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x58291b
cmp dword [ebp - 0x18], 0
je 0x5828f7
mov eax, dword [ebp - 0x18]
call sub.rtl120.bpl__System__FreeMem_qqrpv
cmp dword [ebp - 0x20], 0
je 0x582905
mov eax, dword [ebp - 0x20]
call sub.rtl120.bpl__System__FreeMem_qqrpv
cmp dword [ebp - 0x34], 0
je 0x582913
mov eax, dword [ebp - 0x34]
call sub.rtl120.bpl__System__FreeMem_qqrpv
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x582944
lea eax, [ebp - 8]
mov edx, 2
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
ret