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

Disassembly:
push 0x68
push 0x577cc8
call fcn.0043f128
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 0x408ba5
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0x7a
je 0x408874
call esi
push eax
push str.LookupAccountName___failed._Error__d_n
call fcn.0043f079
pop ecx
pop ecx
jmp 0x408ba5
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 0x40889f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.HeapAlloc___failed._Error__d_n
jmp 0x408868
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 0x408891
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 0x4088d9
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x408862
push 1
lea eax, [ebp - 0x78]
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
jne 0x4088fa
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.InitializeSecurityDescriptor___failed.Error__d_n
jmp 0x408868
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 0x408924
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetSecurityDescriptorDacl___failed._Error__d_n
jmp 0x408868
mov dword [ebp - 0x64], ebx
mov dword [ebp - 0x5c], ebx
mov dword [ebp - 0x60], 8
cmp dword [ebp - 0x2c], ebx
jne 0x408939
mov dword [ebp - 0x28], ebx
cmp dword [ebp - 0x28], ebx
je 0x408964
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 0x408964
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetAclInformation___failed._Error__d_n
jmp 0x408868
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 0x408891
push 2
push ebx
push esi
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
jne 0x4089aa
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.InitializeAcl___failed._Error__d_n
jmp 0x408868
mov dword [ebp - 0x40], edi
cmp dword [ebp - 0x28], edi
je 0x408a36
cmp dword [ebp - 0x64], edi
je 0x408a36
mov dword [ebp - 0x1c], edi
mov eax, dword [ebp - 0x64]
cmp dword [ebp - 0x1c], eax
jae 0x408a36
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 0x4089eb
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetAce___failed._Error__d_n
jmp 0x408868
mov eax, dword [ebp - 0x30]
test byte [eax + 1], 0x10
jne 0x408a36
add eax, 8
push eax
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
jne 0x408a31
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 0x408a2e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.AddAce___failed._Error__d_n
jmp 0x408868
inc dword [ebp - 0x40]
inc dword [ebp - 0x1c]
jmp 0x4089be
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 0x408a7a
push 3
push 2
push dword [ebp - 0x24]
call eax
test eax, eax
jne 0x408a9a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.AddAccessAllowedAceEx___failed._Error__d_n
jmp 0x408868
push 2
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
test eax, eax
jne 0x408a9a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.AddAccessAllowedAce___failed._Error__d_n
jmp 0x408868
cmp dword [ebp - 0x28], 0
je 0x408ae7
cmp dword [ebp - 0x64], 0
je 0x408ae7
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0x64]
jae 0x408ae7
lea ecx, [ebp - 0x30]
push ecx
push eax
push dword [ebp - 0x2c]
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
je 0x4089da
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 0x408a1d
inc dword [ebp - 0x1c]
jmp 0x408aa6
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 0x408b0d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetSecurityDescriptorDacl___failed._Error__d_n
jmp 0x408868
push str.SetSecurityDescriptorControl
push edi
call esi
push eax
call ebx
mov ebx, eax
xor edi, edi
cmp ebx, edi
je 0x408b93
cmp dword [ebp - 0x34], edi
je 0x408b93
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 0x408b53
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetSecurityDescriptorControl___failed.Error__d_n
jmp 0x408868
test word [ebp + 8], 0x400
je 0x408b62
mov eax, 0x500
jmp 0x408b6d
mov eax, 0x1000
test word [ebp + 8], ax
je 0x408b71
mov edi, eax
mov esi, eax
test si, si
je 0x408b93
push edi
push esi
lea eax, [ebp - 0x78]
push eax
call ebx
test eax, eax
jne 0x408b93
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetSecurityDescriptorControl___failed.Error__d_n
jmp 0x408868
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.00408bbc
mov eax, dword [ebp - 0x48]
call fcn.0043f16d
ret 8