Function at 0x51a848
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 fcn.004061a8
mov eax, dword [ebp - 8]
call fcn.004061a8
xor eax, eax
push ebp
push 0x51acc1
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 0x51ac98
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 fcn.00403930
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 fcn.0040624c
mov esi, eax
push esi
push 0
call sub.advapi32.dll_LookupAccountNameW
test eax, eax
je 0x51a8f2
call fcn.00404d74
jmp 0x51aca6
call sub.kernel32.dll_GetLastError_1
cmp eax, 0x7a
je 0x51a901
call fcn.00477970
mov eax, dword [ebp - 0x1c]
call fcn.0040302c
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jne 0x51a917
call fcn.00477970
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 0x51a93f
call fcn.00477970
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 fcn.0040624c
mov esi, eax
push esi
call sub.advapi32.dll_GetFileSecurityW
test eax, eax
je 0x51a970
call fcn.00404d74
jmp 0x51aca6
call sub.kernel32.dll_GetLastError_1
cmp eax, 0x7a
je 0x51a97f
call fcn.00477970
mov eax, dword [ebp - 0x24]
call fcn.0040302c
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
jne 0x51a995
call fcn.00477970
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 0x51a9b4
call fcn.00477970
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 0x51a9d2
call fcn.00477970
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 0x51a9f7
xor eax, eax
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0
je 0x51aa1a
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 0x51aa1a
call fcn.00477970
cmp byte [ebp + 8], 0
je 0x51aa78
cmp dword [ebp - 0x2c], 0
je 0x51aa78
cmp dword [ebp - 0x468], 0
je 0x51aa78
mov ebx, dword [ebp - 0x468]
dec ebx
test ebx, ebx
jb 0x51aa78
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 0x51aa54
call fcn.00477970
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 0x51aa74
mov bl, 1
call fcn.00404d74
jmp 0x51aca6
inc esi
dec ebx
jne 0x51aa3d
push 1
lea eax, [ebp - 0x45c]
push eax
call sub.advapi32.dll_InitializeSecurityDescriptor
test eax, eax
jne 0x51aa8f
call fcn.00477970
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 fcn.0040302c
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0
jne 0x51aac1
call fcn.00477970
push 2
push ebx
mov eax, dword [ebp - 0x34]
push eax
call sub.advapi32.dll_InitializeAcl
test eax, eax
jne 0x51aad6
call fcn.00477970
cmp dword [ebp - 0x2c], 0
je 0x51ab4a
cmp dword [ebp - 0x468], 0
je 0x51ab4a
mov ebx, dword [ebp - 0x468]
dec ebx
test ebx, ebx
jb 0x51ab4a
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 0x51ab0a
call fcn.00477970
mov edi, dword [ebp - 0x38]
test byte [edi + 1], 0x10
jne 0x51ab4a
lea eax, [edi + 8]
push eax
mov eax, dword [ebp - 0x18]
push eax
call sub.advapi32.dll_EqualSid
test eax, eax
jne 0x51ab46
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 0x51ab46
call fcn.00477970
inc esi
dec ebx
jne 0x51aaf3
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 0x51ab66
call fcn.00477970
cmp dword [ebp - 0x2c], 0
je 0x51abc0
cmp dword [ebp - 0x468], 0
je 0x51abc0
mov ebx, dword [ebp - 0x468]
dec ebx
test ebx, ebx
jb 0x51abc0
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 0x51ab9a
call fcn.00477970
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 0x51abbc
call fcn.00477970
inc esi
dec ebx
jne 0x51ab83
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 0x51abdd
call fcn.00477970
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 0x51abf7
call fcn.00477970
xor ebx, ebx
xor esi, esi
mov word [ebp - 0x42], 0
test byte [ebp - 0x41], 4
je 0x51ac0f
mov bx, 0x500
mov esi, ebx
jmp 0x51ac1b
test byte [ebp - 0x41], 0x10
je 0x51ac1b
mov bx, 0x1000
mov esi, ebx
test bx, bx
je 0x51ac37
push esi
push ebx
lea eax, [ebp - 0x45c]
push eax
call sub.advapi32.dll_SetSecurityDescriptorControl
test eax, eax
jne 0x51ac37
call fcn.00477970
lea eax, [ebp - 0x45c]
push eax
mov eax, dword [ebp - 0x40]
push eax
mov eax, dword [ebp - 4]
call fcn.0040624c
push eax
call sub.advapi32.dll_SetFileSecurityW
test eax, eax
jne 0x51ac59
call fcn.00477970
mov dword [ebp - 0x3c], 0xffffffff
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x51ac9f
cmp dword [ebp - 0x18], 0
je 0x51ac7b
mov eax, dword [ebp - 0x18]
call fcn.0040307c
cmp dword [ebp - 0x20], 0
je 0x51ac89
mov eax, dword [ebp - 0x20]
call fcn.0040307c
cmp dword [ebp - 0x34], 0
je 0x51ac97
mov eax, dword [ebp - 0x34]
call fcn.0040307c
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x51acc8
lea eax, [ebp - 8]
mov edx, 2
call fcn.004061b8
ret