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

Disassembly:
push 0x68
push 0x576b68
call fcn.0043e354
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 0x408034
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0x7a
je 0x407d03
call esi
push eax
push str.LookupAccountName___failed._Error__d_n
call fcn.0043e2a2
pop ecx
pop ecx
jmp 0x408034
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 0x407d2e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.HeapAlloc___failed._Error__d_n
jmp 0x407cf7
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 0x407d20
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 0x407d68
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x407cf1
push 1
lea eax, [ebp - 0x78]
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
jne 0x407d89
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.InitializeSecurityDescriptor___failed.Error__d_n
jmp 0x407cf7
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 0x407db3
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetSecurityDescriptorDacl___failed._Error__d_n
jmp 0x407cf7
mov dword [ebp - 0x64], ebx
mov dword [ebp - 0x5c], ebx
mov dword [ebp - 0x60], 8
cmp dword [ebp - 0x2c], ebx
jne 0x407dc8
mov dword [ebp - 0x28], ebx
cmp dword [ebp - 0x28], ebx
je 0x407df3
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 0x407df3
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetAclInformation___failed._Error__d_n
jmp 0x407cf7
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 0x407d20
push 2
push ebx
push esi
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
jne 0x407e39
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.InitializeAcl___failed._Error__d_n
jmp 0x407cf7
mov dword [ebp - 0x40], edi
cmp dword [ebp - 0x28], edi
je 0x407ec5
cmp dword [ebp - 0x64], edi
je 0x407ec5
mov dword [ebp - 0x1c], edi
mov eax, dword [ebp - 0x64]
cmp dword [ebp - 0x1c], eax
jae 0x407ec5
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 0x407e7a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetAce___failed._Error__d_n
jmp 0x407cf7
mov eax, dword [ebp - 0x30]
test byte [eax + 1], 0x10
jne 0x407ec5
add eax, 8
push eax
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
jne 0x407ec0
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 0x407ebd
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.AddAce___failed._Error__d_n
jmp 0x407cf7
inc dword [ebp - 0x40]
inc dword [ebp - 0x1c]
jmp 0x407e4d
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 0x407f09
push 3
push 2
push dword [ebp - 0x24]
call eax
test eax, eax
jne 0x407f29
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.AddAccessAllowedAceEx___failed._Error__d_n
jmp 0x407cf7
push 2
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
test eax, eax
jne 0x407f29
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.AddAccessAllowedAce___failed._Error__d_n
jmp 0x407cf7
cmp dword [ebp - 0x28], 0
je 0x407f76
cmp dword [ebp - 0x64], 0
je 0x407f76
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0x64]
jae 0x407f76
lea ecx, [ebp - 0x30]
push ecx
push eax
push dword [ebp - 0x2c]
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
je 0x407e69
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 0x407eac
inc dword [ebp - 0x1c]
jmp 0x407f35
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 0x407f9c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetSecurityDescriptorDacl___failed._Error__d_n
jmp 0x407cf7
push str.SetSecurityDescriptorControl
push edi
call esi
push eax
call ebx
mov ebx, eax
xor edi, edi
cmp ebx, edi
je 0x408022
cmp dword [ebp - 0x34], edi
je 0x408022
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 0x407fe2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetSecurityDescriptorControl___failed.Error__d_n
jmp 0x407cf7
test word [ebp + 8], 0x400
je 0x407ff1
mov eax, 0x500
jmp 0x407ffc
mov eax, 0x1000
test word [ebp + 8], ax
je 0x408000
mov edi, eax
mov esi, eax
test si, si
je 0x408022
push edi
push esi
lea eax, [ebp - 0x78]
push eax
call ebx
test eax, eax
jne 0x408022
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetSecurityDescriptorControl___failed.Error__d_n
jmp 0x407cf7
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.0040804b
mov eax, dword [ebp - 0x48]
call fcn.0043e399
ret 8