Function at 0x49a1a8
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 0x49a621
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 0x49a5f8
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 0x49a252
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x49a606
call sub.kernel32.dll_GetLastError
cmp eax, 0x7a
je 0x49a261
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 0x49a277
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 0x49a29f
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 0x49a2d0
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x49a606
call sub.kernel32.dll_GetLastError
cmp eax, 0x7a
je 0x49a2df
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 0x49a2f5
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 0x49a314
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 0x49a332
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 0x49a357
xor eax, eax
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0
je 0x49a37a
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 0x49a37a
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
cmp byte [ebp + 8], 0
je 0x49a3d8
cmp dword [ebp - 0x2c], 0
je 0x49a3d8
cmp dword [ebp - 0x468], 0
je 0x49a3d8
mov ebx, dword [ebp - 0x468]
dec ebx
test ebx, ebx
jb 0x49a3d8
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 0x49a3b4
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 0x49a3d4
mov bl, 1
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x49a606
inc esi
dec ebx
jne 0x49a39d
push 1
lea eax, [ebp - 0x45c]
push eax
call sub.advapi32.dll_InitializeSecurityDescriptor
test eax, eax
jne 0x49a3ef
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 0x49a421
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 0x49a436
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
cmp dword [ebp - 0x2c], 0
je 0x49a4aa
cmp dword [ebp - 0x468], 0
je 0x49a4aa
mov ebx, dword [ebp - 0x468]
dec ebx
test ebx, ebx
jb 0x49a4aa
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 0x49a46a
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
mov edi, dword [ebp - 0x38]
test byte [edi + 1], 0x10
jne 0x49a4aa
lea eax, [edi + 8]
push eax
mov eax, dword [ebp - 0x18]
push eax
call sub.advapi32.dll_EqualSid
test eax, eax
jne 0x49a4a6
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 0x49a4a6
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
inc esi
dec ebx
jne 0x49a453
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 0x49a4c6
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
cmp dword [ebp - 0x2c], 0
je 0x49a520
cmp dword [ebp - 0x468], 0
je 0x49a520
mov ebx, dword [ebp - 0x468]
dec ebx
test ebx, ebx
jb 0x49a520
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 0x49a4fa
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 0x49a51c
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
inc esi
dec ebx
jne 0x49a4e3
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 0x49a53d
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 0x49a557
call sub.rtl120.bpl__Sysutils_RaiseLastOSError_qqrv
xor ebx, ebx
xor esi, esi
mov word [ebp - 0x42], 0
test byte [ebp - 0x41], 4
je 0x49a56f
mov bx, 0x500
mov esi, ebx
jmp 0x49a57b
test byte [ebp - 0x41], 0x10
je 0x49a57b
mov bx, 0x1000
mov esi, ebx
test bx, bx
je 0x49a597
push esi
push ebx
lea eax, [ebp - 0x45c]
push eax
call sub.advapi32.dll_SetSecurityDescriptorControl
test eax, eax
jne 0x49a597
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 0x49a5b9
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 0x49a5ff
cmp dword [ebp - 0x18], 0
je 0x49a5db
mov eax, dword [ebp - 0x18]
call sub.rtl120.bpl__System__FreeMem_qqrpv
cmp dword [ebp - 0x20], 0
je 0x49a5e9
mov eax, dword [ebp - 0x20]
call sub.rtl120.bpl__System__FreeMem_qqrpv
cmp dword [ebp - 0x34], 0
je 0x49a5f7
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 0x49a628
lea eax, [ebp - 8]
mov edx, 2
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
ret