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

Disassembly:
push 0x68
push 0x58e848
call fcn.00452540
mov dword [ebp - 0x34], ecx
xor ebx, ebx
mov dword [ebp - 0x44], ebx
mov dword [ebp - 0x38], ebx
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x48], ebx
mov dword [ebp - 4], ebx
lea eax, [ebp - 0x4c]
push eax
lea eax, [ebp - 0x38]
push eax
push ebx
lea eax, [ebp - 0x3c]
push eax
push ebx
push dword [ebp + 8]
push ebx
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
cmp eax, ebx
jne 0x40abb7
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0x7a
je 0x40a886
call esi
push eax
push str.LookupAccountName___failed._Error__d_n
call fcn.00452490
pop ecx
pop ecx
jmp 0x40abb7
push dword [ebp - 0x3c]
push 8
mov esi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
call esi
push eax
mov edi, dword [sym.imp.KERNEL32.dll_HeapAlloc]
call edi
mov dword [ebp - 0x20], eax
cmp eax, ebx
jne 0x40a8b1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.HeapAlloc___failed._Error__d_n
jmp 0x40a87a
mov eax, dword [ebp - 0x38]
add eax, eax
push eax
push 8
call esi
push eax
call edi
mov dword [ebp - 0x44], eax
cmp eax, ebx
je 0x40a8a3
lea ecx, [ebp - 0x4c]
push ecx
lea ecx, [ebp - 0x38]
push ecx
push eax
lea eax, [ebp - 0x3c]
push eax
push dword [ebp - 0x20]
push dword [ebp + 8]
push ebx
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
cmp eax, ebx
jne 0x40a8eb
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x40a874
push 1
lea eax, [ebp - 0x78]
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
jne 0x40a90c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.InitializeSecurityDescriptor___failed.Error__d_n
jmp 0x40a87a
lea eax, [ebp - 0x58]
push eax
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 0x34]
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorDacl]
test eax, eax
jne 0x40a936
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetSecurityDescriptorDacl___failed._Error__d_n
jmp 0x40a87a
mov dword [ebp - 0x64], ebx
mov dword [ebp - 0x5c], ebx
mov dword [ebp - 0x60], 8
cmp dword [ebp - 0x2c], ebx
jne 0x40a94b
mov dword [ebp - 0x28], ebx
cmp dword [ebp - 0x28], ebx
je 0x40a976
push 2
push 0xc
lea eax, [ebp - 0x64]
push eax
push dword [ebp - 0x2c]
call dword [sym.imp.ADVAPI32.dll_GetAclInformation]
test eax, eax
jne 0x40a976
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetAclInformation___failed._Error__d_n
jmp 0x40a87a
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov ecx, dword [ebp - 0x60]
lea ebx, [eax + ecx + 8]
push ebx
push 8
call esi
push eax
call edi
mov esi, eax
mov dword [ebp - 0x24], esi
xor edi, edi
cmp esi, edi
je 0x40a8a3
push 2
push ebx
push esi
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
jne 0x40a9bc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.InitializeAcl___failed._Error__d_n
jmp 0x40a87a
mov dword [ebp - 0x40], edi
cmp dword [ebp - 0x28], edi
je 0x40aa48
cmp dword [ebp - 0x64], edi
je 0x40aa48
mov dword [ebp - 0x1c], edi
mov eax, dword [ebp - 0x64]
cmp dword [ebp - 0x1c], eax
jae 0x40aa48
lea eax, [ebp - 0x30]
push eax
push dword [ebp - 0x1c]
push dword [ebp - 0x2c]
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
jne 0x40a9fd
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetAce___failed._Error__d_n
jmp 0x40a87a
mov eax, dword [ebp - 0x30]
test byte [eax + 1], 0x10
jne 0x40aa48
add eax, 8
push eax
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
jne 0x40aa43
mov eax, dword [ebp - 0x30]
movzx ecx, word [eax + 2]
push ecx
push eax
push 0xffffffffffffffff
push 2
push esi
call dword [sym.imp.ADVAPI32.dll_AddAce]
test eax, eax
jne 0x40aa40
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.AddAce___failed._Error__d_n
jmp 0x40a87a
inc dword [ebp - 0x40]
inc dword [ebp - 0x1c]
jmp 0x40a9d0
push str.AddAccessAllowedAceEx
mov edi, str.advapi32.dll
push edi
mov esi, dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
call esi
push eax
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcAddress]
call ebx
push dword [ebp - 0x20]
push dword [ebp + 0xc]
test eax, eax
je 0x40aa8c
push 3
push 2
push dword [ebp - 0x24]
call eax
test eax, eax
jne 0x40aaac
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.AddAccessAllowedAceEx___failed._Error__d_n
jmp 0x40a87a
push 2
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
test eax, eax
jne 0x40aaac
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.AddAccessAllowedAce___failed._Error__d_n
jmp 0x40a87a
cmp dword [ebp - 0x28], 0
je 0x40aaf9
cmp dword [ebp - 0x64], 0
je 0x40aaf9
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0x64]
jae 0x40aaf9
lea ecx, [ebp - 0x30]
push ecx
push eax
push dword [ebp - 0x2c]
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
je 0x40a9ec
mov eax, dword [ebp - 0x30]
movzx ecx, word [eax + 2]
push ecx
push eax
push 0xffffffffffffffff
push 2
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_AddAce]
test eax, eax
je 0x40aa2f
inc dword [ebp - 0x1c]
jmp 0x40aab8
push 0
push dword [ebp - 0x24]
push 1
lea eax, [ebp - 0x78]
push eax
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
jne 0x40ab1f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetSecurityDescriptorDacl___failed._Error__d_n
jmp 0x40a87a
push str.SetSecurityDescriptorControl
push edi
call esi
push eax
call ebx
mov ebx, eax
xor edi, edi
cmp ebx, edi
je 0x40aba5
cmp dword [ebp - 0x34], edi
je 0x40aba5
xor esi, esi
mov dword [ebp + 8], edi
mov dword [ebp + 0xc], edi
lea eax, [ebp + 0xc]
push eax
lea eax, [ebp + 8]
push eax
push dword [ebp - 0x34]
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorControl]
test eax, eax
jne 0x40ab65
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetSecurityDescriptorControl___failed.Error__d_n
jmp 0x40a87a
test word [ebp + 8], 0x400
je 0x40ab74
mov eax, 0x500
jmp 0x40ab7f
mov eax, 0x1000
test word [ebp + 8], ax
je 0x40ab83
mov edi, eax
mov esi, eax
test si, si
je 0x40aba5
push edi
push esi
lea eax, [ebp - 0x78]
push eax
call ebx
test eax, eax
jne 0x40aba5
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetSecurityDescriptorControl___failed.Error__d_n
jmp 0x40a87a
mov dword [ebp - 0x48], 1
push 5
pop ecx
lea esi, [ebp - 0x78]
mov edi, dword [ebp - 0x34]
rep movsd dword es:[edi], dword [esi]
mov dword [ebp - 4], 0xfffffffe
call fcn.0040abce
mov eax, dword [ebp - 0x48]
call fcn.00452585
ret 8