Function at 0x58a5f4
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 0x58aa6d
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 0x58aa44
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 0x58a69e
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x58aa52
call sub.kernel32.dll_GetLastError
cmp eax, 0x7a
je 0x58a6ad
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 0x58a6c3
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 0x58a6eb
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 0x58a71c
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x58aa52
call sub.kernel32.dll_GetLastError
cmp eax, 0x7a
je 0x58a72b
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 0x58a741
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 0x58a760
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 0x58a77e
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 0x58a7a3
xor eax, eax
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0
je 0x58a7c6
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 0x58a7c6
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
cmp byte [ebp + 8], 0
je 0x58a824
cmp dword [ebp - 0x2c], 0
je 0x58a824
cmp dword [ebp - 0x468], 0
je 0x58a824
mov ebx, dword [ebp - 0x468]
dec ebx
test ebx, ebx
jb 0x58a824
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 0x58a800
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 0x58a820
mov bl, 1
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x58aa52
inc esi
dec ebx
jne 0x58a7e9
push 1
lea eax, [ebp - 0x45c]
push eax
call sub.advapi32.dll_InitializeSecurityDescriptor
test eax, eax
jne 0x58a83b
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 0x58a86d
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 0x58a882
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
cmp dword [ebp - 0x2c], 0
je 0x58a8f6
cmp dword [ebp - 0x468], 0
je 0x58a8f6
mov ebx, dword [ebp - 0x468]
dec ebx
test ebx, ebx
jb 0x58a8f6
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 0x58a8b6
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
mov edi, dword [ebp - 0x38]
test byte [edi + 1], 0x10
jne 0x58a8f6
lea eax, [edi + 8]
push eax
mov eax, dword [ebp - 0x18]
push eax
call sub.advapi32.dll_EqualSid
test eax, eax
jne 0x58a8f2
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 0x58a8f2
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
inc esi
dec ebx
jne 0x58a89f
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 0x58a912
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
cmp dword [ebp - 0x2c], 0
je 0x58a96c
cmp dword [ebp - 0x468], 0
je 0x58a96c
mov ebx, dword [ebp - 0x468]
dec ebx
test ebx, ebx
jb 0x58a96c
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 0x58a946
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 0x58a968
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
inc esi
dec ebx
jne 0x58a92f
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 0x58a989
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 0x58a9a3
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
xor ebx, ebx
xor esi, esi
mov word [ebp - 0x42], 0
test byte [ebp - 0x41], 4
je 0x58a9bb
mov bx, 0x500
mov esi, ebx
jmp 0x58a9c7
test byte [ebp - 0x41], 0x10
je 0x58a9c7
mov bx, 0x1000
mov esi, ebx
test bx, bx
je 0x58a9e3
push esi
push ebx
lea eax, [ebp - 0x45c]
push eax
call sub.advapi32.dll_SetSecurityDescriptorControl
test eax, eax
jne 0x58a9e3
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 0x58aa05
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 0x58aa4b
cmp dword [ebp - 0x18], 0
je 0x58aa27
mov eax, dword [ebp - 0x18]
call sub.rtl120.bpl__System__FreeMem_qqrpv
cmp dword [ebp - 0x20], 0
je 0x58aa35
mov eax, dword [ebp - 0x20]
call sub.rtl120.bpl__System__FreeMem_qqrpv
cmp dword [ebp - 0x34], 0
je 0x58aa43
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 0x58aa74
lea eax, [ebp - 8]
mov edx, 2
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
ret