Function at 0x87809
Capabilities:
Compare security identifiers
Get session user name
Get user security identifier

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5fc
push ebx
push esi
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x17c]
xor ebx, ebx
mov esi, 0x80
push eax
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x20], esi
call dword [sym.imp.ADVAPI32.dll_GetUserNameA]
test eax, eax
je 0x87a8e
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x1fc]
push eax
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x7c]
push eax
lea eax, [ebp - 0x17c]
push eax
push ebx
mov dword [ebp - 0x1c], 0x44
mov dword [ebp - 0x24], esi
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameA]
test eax, eax
je 0x87a8e
lea eax, [ebp - 0x7c]
push eax
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov dword [ebp - 0x1c], eax
lea ecx, [ebp - 0x28]
push ecx
mov eax, 0x400
push eax
mov dword [ebp - 0x28], eax
lea eax, [ebp - 0x5fc]
push eax
push 5
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_GetFileSecurityA]
test eax, eax
je 0x87a8e
push edi
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0x5fc]
push eax
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorOwner]
xor edi, edi
inc edi
test eax, eax
je 0x8791d
push dword [ebp - 0xc]
lea eax, [ebp - 0x7c]
push eax
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x24], esi
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
jne 0x8791d
push 0x14
push 0x40
mov dword [ebp - 0x18], edi
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov esi, eax
cmp esi, ebx
je 0x8791d
push edi
push esi
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x87916
push ebx
lea eax, [ebp - 0x7c]
push eax
push esi
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorOwner]
test eax, eax
je 0x87916
push esi
push edi
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_SetFileSecurityA]
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x5fc]
push eax
mov dword [ebp - 0x14], ebx
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorDacl]
test eax, eax
je 0x87a8d
mov eax, dword [ebp - 0x10]
cmp eax, ebx
je 0x87a8d
and dword [ebp - 4], ebx
xor ecx, ecx
cmp cx, word [eax + 4]
jae 0x87a8d
lea ecx, [ebp - 8]
push ecx
push dword [ebp - 4]
push eax
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
je 0x87a2a
mov eax, dword [ebp - 8]
add eax, 8
xor esi, esi
mov dword [ebp - 0xc], eax
test ebx, ebx
jle 0x879ae
push dword [ebp - 0xc]
push dword [ebp + esi*4 - 0xfc]
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
jne 0x87999
inc esi
cmp esi, ebx
jl 0x87980
cmp esi, ebx
jge 0x879ae
push dword [ebp - 4]
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_DeleteAce]
mov dword [ebp - 0x14], edi
jmp 0x87a2d
cmp ebx, 0x20
jge 0x879be
mov eax, dword [ebp - 0xc]
mov dword [ebp + ebx*4 - 0xfc], eax
inc ebx
push dword [ebp - 0xc]
lea eax, [ebp - 0x7c]
push eax
call dword [sym.imp.ADVAPI32.dll_EqualSid]
mov ecx, dword [ebp - 8]
test eax, eax
je 0x879e5
mov eax, dword [ebp + 0xc]
neg eax
sbb eax, eax
and eax, 0x90046
add eax, 0x1601b9
jmp 0x879ea
mov eax, 0x1200a8
cmp dword [ecx + 4], eax
je 0x879f8
mov dword [ecx + 4], eax
mov ecx, dword [ebp - 8]
mov dword [ebp - 0x14], edi
cmp byte [ecx], 0
jne 0x87a03
test byte [ecx + 1], 0x10
je 0x87a2a
mov byte [ecx], 0
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 8]
test eax, eax
jne 0x87a19
mov eax, dword [ebp - 8]
mov byte [eax + 1], 0xb
jmp 0x87a27
mov ecx, dword [ebp - 8]
cmp eax, 0x50
setb al
add al, 2
mov byte [ecx + 1], al
mov dword [ebp - 0x14], edi
inc dword [ebp - 4]
mov eax, dword [ebp - 0x10]
movzx ecx, word [eax + 4]
cmp dword [ebp - 4], ecx
jb 0x8795b
cmp dword [ebp - 0x14], 0
je 0x87a8d
push 0x14
push 0x40
mov dword [ebp - 0x18], edi
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov esi, eax
test esi, esi
je 0x87a8d
push edi
push esi
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x87a86
push 0
push dword [ebp - 0x10]
push edi
push esi
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x87a86
push esi
push 4
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_SetFileSecurityA]
test eax, eax
je 0x87a86
mov dword [ebp - 0x18], edi
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
pop edi
mov eax, dword [ebp - 0x18]
pop esi
pop ebx
leave
ret